The command sudo cp archlinux-2025.05.01-x86_64.iso > /dev/sdb is attempting to copy the ISO file to the /dev/sdb device, but it's using redirection (>). This redirection is performed by the shell before sudo is even executed, meaning the user trying to write to /dev/sdb is the unprivileged user. That's why you get "Permission denied".
The correct and safe way to copy an ISO to a drive for booting is using dd or bsdtar (from the libarchive package) or a dedicated tool like usbimager.
Here's how to fix it using dd:
sudo dd bs=4M if=archlinux-2025.05.01-x86_64.iso of=/dev/sdb status=progress
sync
Explanation:
sudo: Executes the command with superuser privileges. This is essential when writing to /dev/sdb.
dd: A powerful (and potentially dangerous!) command for copying data.
bs=4M: Sets the block size to 4MB. This can significantly improve copy speed. You can experiment with different block sizes, but 4MB is a good starting point.
if=archlinux-2025.05.01-x86_64.iso: Specifies the input file (your ISO image). Double-check the filename!
of=/dev/sdb: Specifies the output device (your USB drive). WARNING: This will overwrite ALL data on /dev/sdb. Make ABSOLUTELY SURE this is the correct device! Using the wrong device can destroy your data. Use lsblk before running this command to identify the correct USB drive. Look at the size column and compare with the known size of your USB stick. Also, be very sure it's not /dev/sda!
status=progress: Shows the progress of the copy operation. This requires dd version 8.2 or later. If it doesn't work, you can remove it.
sync: Forces the operating system to flush all buffered data to the disk. This ensures that all data is written before you remove the drive. It's crucial to wait for this to complete!
Important Precautions:
-
Identify the Correct Drive: Use lsblk to list block devices before running any commands. Carefully identify your USB drive. The output of lsblk will show the device name (e.g., /dev/sdb, /dev/sdc), its size, and any partitions on it. If you choose the wrong device, you could overwrite your hard drive!
lsblk
-
Double-Check the Command: Review the dd command carefully before pressing Enter. Incorrect parameters can lead to data loss.
-
Wait for Completion: The dd command might take a while to complete. Be patient and wait until the process finishes and returns to the command prompt. Don't interrupt the process. With status=progress it will show progress. Without it, you just have to wait.
-
Unmount Before Removing: After sync finishes and the command prompt returns, unmount any partitions on the USB drive before physically removing it:
sudo umount /dev/sdb1 # If /dev/sdb1 is mounted
sudo umount /dev/sdb2 # If /dev/sdb2 is mounted
If you're not sure if any partitions are mounted, you can try unmounting them, and if they aren't mounted you'll just get an error message which you can ignore. It's better to be safe than sorry.
Important: Do not run sudo umount /dev/sdb directly. Unmounting the device itself is generally not supported and can lead to problems. Only unmount partitions.
-
Consider Using a GUI Tool: If you're uncomfortable with the command line, consider using a GUI tool like usbimager or Rufus (if you are on Windows). These tools provide a user-friendly interface for writing ISO images to USB drives and help prevent accidental errors. usbimager is especially good as it is open source and lightweight. You'll need to install it, usually with sudo apt install usbimager or similar depending on your distribution.
Example lsblk output:
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 465.8G 0 disk
├─sda1 8:1 0 512M 0 part /boot/efi
├─sda2 8:2 0 97.7G 0 part /
└─sda3 8:3 0 367.6G 0 part /home
sdb 8:16 1 14.5G 0 disk <-- This is likely your USB drive. Note the size.
└─sdb1 8:17 1 14.5G 0 part /media/user/USBDRIVE
In this example, /dev/sdb is most likely the USB drive because of its size (14.5G). Also note the /dev/sdb1 partition is mounted, so you'd need to sudo umount /dev/sdb1 after dd completes.
Using bsdtar:
If libarchive is installed, another option is:
sudo bsdtar -xvf archlinux-2025.05.01-x86_64.iso -C /dev/sdb
sync
This can sometimes be faster than dd. It extracts the ISO to the device. The same warnings about using the correct device apply. This assumes the ISO is a valid tar archive, which is usually the case.
Recommendation:
For ease of use and safety, I recommend using usbimager. It's less error-prone than dd and provides progress feedback. If you must use the command line, double-check everything before pressing Enter, and be especially careful with the of=/dev/sdb part of the dd command.