You are not logged in.
Pages: 1
I recently needed to set up installation media on a usb device. I checked out the installation guide and subsequently the Wiki entry for methods to do this. (USB flash installation medium). The first method listed was:
# cat path/to/archlinux-version-x86_64.iso > /dev/disk/by-id/usb-My_flash_driveUsing this with sudo I get a permission denied error. After some research I found an explanation that sudo only applies to the cat part of the command and not the redirection. I have never found the Wiki to be wrong but I have often not fully understood it. What am I missing here? I understand this error can crop up in any command involving a redirection so would like to learn how to avoid it.
I had success with the dd command version.
Last edited by PonJar (2026-01-11 12:04:28)
Offline
try it after "sudo -i"
or try like this
sudo sh -c 'cat archlinux.iso > /dev/disk/by-id/usb-My_flash_drive'This works because the shell handling the redirection is running as root.
edit:
or with `tee`
sudo tee /dev/disk/by-id/usb-My_flash_drive < archlinux.iso > /dev/nullLast edited by 5hridhyan (2026-01-11 10:46:38)
We don’t finish life. We just learn to love the unfinished lines. — Grok
Offline
Using this with sudo I get a permission denied error. After some research I found an explanation that sudo only applies to the cat part of the command and not the redirection. I have never found the Wiki to be wrong but I have often not fully understood it. What am I missing here? I understand this error can crop up in any command involving a redirection so would like to learn how to avoid it.
the wiki is not wrong, the # means run the full command as root, as you described yourself redirection does not work with an escalation program
see the note here: https://wiki.archlinux.org/title/Help:R … other_user
Offline
Thanks for pointing me to the answer to this
Offline
Pages: 1