Dd: opening `/ dev / sdb ': permission denied

I am trying to write a Linux image on a CF card, as shown in * :

When I do this:

sudo bzcat debian-for-alix-cf2g.img.bz2 | dd of=/dev/sdb bs=16k

I get:

dd: opening `/dev/sdb': Permission denied

In mtab, I see that / dev / sdb matches the target CF connected to the USB port.

Line in mtab file

/dev/sdb1 /media/2020-2020 vfat rw,nosuid,nodev,uhelper=udisks,uid=1000,gid=1000,shortname=mixed,dmask=0077,utf8=1,showexec,flush 0 0

Before doing

sudo bzcat debian-for-alix-cf2g.img.bz2 | dd of=/dev/sdb bs=16k

I turned off the device using

umount /media/2020-2020

Why can't I write to / dev / sdb?

+5
source share
2 answers

Try running it as root:

user ~ $ sudo -s
Password: 
root ~ # bzcat debian-for-alix-cf2g.img.bz2 | dd of=/dev/sdb bs=16k

The way you tried does not work, probably because the addition sudois done bzcatas root, but not dd.

+7
source

or put sudo after the pipe, | sudo dd ...

sudo bzcat debian-for-alix-cf2g.img.bz2 | sudo dd of=/dev/sdb bs=16k

Although this may require a password twice, so I prefer using sudo -s or sudo -i

+3

All Articles