write image to usb drive - 'permission denied'

Questions about other topics - please check if your question fits better in another category before posting here
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
HilltopsGM
Level 4
Level 4
Posts: 231
Joined: Thu Mar 15, 2012 8:11 pm

write image to usb drive - 'permission denied'

Post by HilltopsGM »

I had a Live version of Linux Mint on this usb drive and I was trying to write an image of FreeNAS 8 to it using this command:

xzcat FreeNAS-8.2.0-RELEASE-p1-x64.GUI_Upgrade.xz | dd of=/dev/sdb1 bs=64k

For some reason I am getting this message:

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

I am not that familiar with all the termainal code nuances. Can someone assist?
(dd commands - I know are notorious for getting people into trouble - I have been warned)
(I am using the blkid command prior to to id the device I am looking for)

Thanks
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
cwsnyder

Re: write image to usb drive - 'permission denied'

Post by cwsnyder »

The command you list has a problem, I believe it should be:

Code: Select all

xzcat FreeNAS-8.2.0-RELEASE-p1-x64.GUI_Upgrade.xz | dd of=/dev/sdb bs=64k
dd does not like to write to a partition on the device from an image file, it should start writing from the beginning.
HilltopsGM
Level 4
Level 4
Posts: 231
Joined: Thu Mar 15, 2012 8:11 pm

Re: write image to usb drive - 'permission denied'

Post by HilltopsGM »

I did try that as well, but that didn't seem to work either. I am not getting access to the usb drive at all ===> permission denied.

Thanks for the response though. Any other ideas?
wazntme

Re: write image to usb drive - 'permission denied'

Post by wazntme »

Post the output of

Code: Select all

Sudo fdisk -l
zerozero

Re: write image to usb drive - 'permission denied'

Post by zerozero »

are you starting dd as root? or with sudo (tho i can't see it in the output?)
HilltopsGM
Level 4
Level 4
Posts: 231
Joined: Thu Mar 15, 2012 8:11 pm

Re: write image to usb drive - 'permission denied'

Post by HilltopsGM »

hmmmm, You know what . . . I didn't put the sudo in front.

I don't know what I was thinking.

I started off with
sudo blkid

to identify the devices.

I didn't think to put "sudo" infront of the command :oops:

That was probably it.

I'll try it again - thanks for that!
wazntme

Re: write image to usb drive - 'permission denied'

Post by wazntme »

Sudo may not survive the pipe.....may have to su to root
HilltopsGM
Level 4
Level 4
Posts: 231
Joined: Thu Mar 15, 2012 8:11 pm

Re: write image to usb drive - 'permission denied'

Post by HilltopsGM »

nope, sudo didn't work.

wazntme, how do you su to root?
zerozero

Re: write image to usb drive - 'permission denied'

Post by zerozero »

something like this

Code: Select all

zerozero@deb-kde ~ $ su

Code: Select all

Password: 

Code: Select all

deb-kde zerozero # 
HilltopsGM
Level 4
Level 4
Posts: 231
Joined: Thu Mar 15, 2012 8:11 pm

Re: write image to usb drive - 'permission denied'

Post by HilltopsGM »

could you expand on each piece of what was written zerozero?

zerozero ====> that's your username
@deb-kde ====> I don't know what that is. I am running Linux Mint 12 cinnamon still at this moment, and not the kde version. What would it be for cinnamon?

~ $ su =====> this I take I would just copy as is.

The Password I would take to be my sudo password, no?

thanks for the help.
zerozero

Re: write image to usb drive - 'permission denied'

Post by zerozero »

i guess i overcomplicated trying to make it easy :lol:
it's as simple as at the terminal prompt you do

Code: Select all

su
the rest is self-explanatory

above it's my username and the computer name (deb-kde)
HilltopsGM
Level 4
Level 4
Posts: 231
Joined: Thu Mar 15, 2012 8:11 pm

Re: write image to usb drive - 'permission denied'

Post by HilltopsGM »

Thanks for that. I just went back to terminal and realized what it was you were getting at. Thanks

I'll give that a go. Again, thanks.
HilltopsGM
Level 4
Level 4
Posts: 231
Joined: Thu Mar 15, 2012 8:11 pm

Re: write image to usb drive - 'permission denied'

Post by HilltopsGM »

thanks zerozero - it worked like a charm!

By the way, after it finished:

Greg-LinuxMint greg # xzcat FreeNAS-8.3.0-RELEASE-p1-x64.img.xz | dd of=/dev/sdb1 bs=64k
552+238777 records in
552+238777 records out
2000000000 bytes (2.0 GB) copied, 378.382 s, 5.3 MB/s
Greg-LinuxMint greg #



and I went to close terminal i got this message:
There is still a process running in this terminal. Closing the terminal will kill it.
What the heck would that have been? Any idea?

All I did was su to root, ran blkid to make sure I had the correct device, burn the image to the usb and close termainal. Nothing else.
cwsnyder

Re: write image to usb drive - 'permission denied'

Post by cwsnyder »

You had not exited su and it was complaining about it.

Also, using /dev/sdb1 wrote it to a partition and may not work to boot the image. You need to write to /dev/sdb for disk images.
HilltopsGM
Level 4
Level 4
Posts: 231
Joined: Thu Mar 15, 2012 8:11 pm

Re: write image to usb drive - 'permission denied'

Post by HilltopsGM »

Hi cwsnyder,

How do you "exit" from su once you are in it?

and you are right about the sdb comment - thanks.
cwsnyder

Re: write image to usb drive - 'permission denied'

Post by cwsnyder »

You exit from su the normal way you exit from the terminal, ie., you type exit by itself at the # prompt or press and hold the Ctl button while pressing the D button.
HilltopsGM
Level 4
Level 4
Posts: 231
Joined: Thu Mar 15, 2012 8:11 pm

Re: write image to usb drive - 'permission denied'

Post by HilltopsGM »

Excellent. I didn't know that.

I love tinkering with Linux, but (obviously) don't know A LOT about terminal and command line code.
I know enough to be really dangerous to myself though :lol: ===> love what I can do with dd (a.k.a the data destroyer :lol: )

.... but that's how you learn guess.

Thanks for the help.
Locked

Return to “Other topics”