Advertisement
efxtv

How to Create a Bootable Pen drive in Ubuntu CLI (for Ubuntu ISO)

Nov 14th, 2024
39
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.51 KB | Cybersecurity | 0 0
  1. How to Create a Bootable Pen drive in Ubuntu CLI (for Ubuntu ISO)
  2.  
  3. Note: (Balena Etcher GUI software can also be used) To create a Linux bootable USB, format the USB using the EXT4 file system. For Windows, use FAT32.
  4.  
  5. # Format USB in different file system (Replace /dev/sdX with the appropriate identifier for your USB drive.)
  6. EXT4 File System: sudo mkfs.ext4 /dev/sdX
  7. FAT32 File System: sudo mkfs.vfat -n "USB_LABEL" /dev/sdX
  8. NTFS File System: sudo mkfs.ntfs -f /dev/sdX
  9. exFAT File System: sudo mkfs.exfat /dev/sdX
  10.  
  11. Command to create any bootable disk with specific ISO: (ensure usb file system)
  12. sudo dd bs=4M if=Windows10.iso of=/dev/sda status=progress oflag=sync
  13.  
  14. # Detailed commands
  15. # Step 1: List the USB Stick
  16. sudo fdisk -l
  17. lsblk
  18.  
  19. # Step 2: Unmount the USB Disk
  20. sudo umount /dev/sda*
  21.  
  22. # Step 3: Create EXT4 Filesystem
  23. sudo mkfs.ext4 /dev/sda
  24.  
  25. # Step 4: Create Bootable USB
  26. sudo dd if=ubuntu.iso of=/dev/sda status=progress
  27.  
  28. How to Create a Bootable Pendrive in Ubuntu CLI (for Windows 10 ISO)
  29.  
  30. # Step 1: Unmount the Disk
  31. sudo umount /dev/sda*
  32.  
  33. # Step 2: Create FAT32 Filesystem
  34. sudo mkfs.vfat -n "WINDOWS10" /dev/sda1
  35.  
  36. # Step 3: Write ISO to USB
  37. sudo dd bs=4M if=Windows10.iso of=/dev/sda status=progress oflag=sync
  38.  
  39. # Explanation of Syntax
  40. - dd: Data duplicator utility.
  41. - bs=4M: Sets the block size to 4 megabytes, meaning dd will read and write data in chunks of 4 MB at a time.
  42. - oflag=sync: Ensures that dd writes all output data in a synchronized manner.
  43. - mkfs: Command to create a file system.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement