You are not logged in.

#1 2026-01-11 10:15:53

PonJar
Member
Registered: 2019-07-05
Posts: 49

[SOLVED]USB flash installation medium

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_drive

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.

I had success with the dd command version.

Last edited by PonJar (2026-01-11 12:04:28)

Offline

#2 2026-01-11 10:18:09

5hridhyan
Member
From: 127.0.0.1
Registered: 2025-12-25
Posts: 73

Re: [SOLVED]USB flash installation medium

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/null

Last edited by 5hridhyan (2026-01-11 10:46:38)


We don’t finish life. We just learn to love the unfinished lines.  — Grok

Offline

#3 2026-01-11 10:38:13

system72
Member
Registered: 2025-11-22
Posts: 469
Website

Re: [SOLVED]USB flash installation medium

PonJar wrote:

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

#4 2026-01-11 12:06:25

PonJar
Member
Registered: 2019-07-05
Posts: 49

Re: [SOLVED]USB flash installation medium

Thanks for pointing me to the answer to this

Offline

Board footer

Powered by FluxBB