Here's a complete step-by-step guide using cat to write an Arch Linux ISO to a USB drive, including privilege handling and verification steps:
Complete Guide: Writing Arch Linux ISO to USB with cat
1. Identify Your USB Device
First, find the correct device identifier for your USB drive:
ls -l /dev/disk/by-id/usb-*
Example output:
lrwxrwxrwx 1 root root 9 May 10 14:30 /dev/disk/by-id/usb-Kingston_DataTraveler_2.0_408D5C1654FDB471E98BED5C-0:0 -> ../../sdb
Verify with lsblk to confirm it’s not mounted:
lsblk
Look for your USB (e.g., sdb) and ensure no partitions (e.g., sdb1) are mounted under the MOUNTPOINTS column.
2. Unmount if Necessary
If any partitions are mounted (e.g., /dev/sdb1), unmount them:
sudo umount /dev/sdb1
3. Write the ISO to USB with cat
Run the following command as root (use sudo or switch to root):
sudo cat path/to/archlinux-version-x86_64.iso > /dev/disk/by-id/usb-Kingston_DataTraveler_2.0_408D5C1654FDB471E98BED5C-0:0
Replace:
path/to/archlinux-version-x86_64.iso with the actual ISO path (e.g., ~/Downloads/archlinux-2024.05.01-x86_64.iso).
/dev/disk/by-id/usb-... with your USB’s identifier from Step 1.
Note:
- No progress bar will be shown (unlike
dd or pv). Wait until the command prompt returns.
- Do not interrupt the process; it may corrupt the USB.
4. Sync and Verify
After completion, force-write all cached data to the USB:
sudo sync
Verify the write was successful (optional but recommended):
sudo cmp -n $(stat -c %s path/to/archlinux-version-x86_64.iso) path/to/archlinux-version-x86_64.iso /dev/disk/by-id/usb-Kingston_DataTraveler_2.0_408D5C1654FDB471E98BED5C-0:0
- If no output, the files match (success).