LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-04-2012, 05:55 PM   #1
RJ MacReady
LQ Newbie
 
Registered: Feb 2012
Location: Smithson
Posts: 4

Rep: Reputation: Disabled
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?
 
Old 02-04-2012, 06:18 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974
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.
 
Old 02-04-2012, 06:19 PM   #3
RJ MacReady
LQ Newbie
 
Registered: Feb 2012
Location: Smithson
Posts: 4

Original Poster
Rep: Reputation: Disabled
Thanks, that fixed it!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Fuse installation problems: "cannot remove `/sbin/mount.fuse': Permission denied" kvm1983 Linux - Software 3 02-06-2012 12:34 AM
Exclude "Permission denied" files for "ls -al" grob115 Linux - Newbie 3 12-03-2010 10:45 AM
[SOLVED] du says "cannot read directory" and "permission denied", but I have rwx permissions mrtwice Linux - Software 14 04-21-2010 01:38 PM
can't execute c++ binaries, "permission denied"... even though permission is 777 SerfurJ Programming 14 02-20-2009 05:50 AM
"Permission denied" and "recursive directory loop" when searching for string in files mack1e Linux - Newbie 5 06-12-2008 08:38 AM


All times are GMT -5. The time now is 07:06 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration