-   Linux - Newbie (
-   -   dd, nc, and "permission denied" problems (

RJ MacReady 02-04-2012 05:55 PM

dd, nc, and "permission denied" problems
I'm trying to clone a drive from one computer to another over my LAN with dd. On the destination machine, I've booted with a LiveCD, confirmed that the only drive present is /dev/sda (brand new unformatted drive), and started with:

sudo nc -l -p 7777 | gzip -d | dd of=/dev/sda bs=16M

and I get the error:
dd: opening '/dev/sda': Permission denied

I can't figure out why I am getting this permission denied error when running the command with sudo.

Any ideas what I can try to fix it?

acid_kewpie 02-04-2012 06:18 PM

you're only running the first command with sudo, not everything in the pipeline.

run "sudo -i" to get a root shell and run it there, and it will all run as root.

RJ MacReady 02-04-2012 06:19 PM

Thanks, that fixed it!

All times are GMT -5. The time now is 09:27 PM.