Permission denied using dd to clone main drive
Solution 1
Try this: press Ctrl+Alt+T on your keyboard to open Terminal. When it opens, run the command(s) below:
sudo -i
That will give you a root shell, that way it'll all run as root.
Solution 2
I've always used Clonezilla when cloning drives for identical computers. It runs off a liveCD and is really easy to use. With this method you can create an img file of the base system. So in a few months if a system crashes you have that fresh image ready to go.
Related videos on Youtube
StephenTG
Updated on September 18, 2022Comments
-
StephenTG over 1 year
So I'm trying to clone the setup of one computer to 4 identical machines on the same network. I don't fancy the idea of meddling with the insides of the computer, so I'm following the method outlined here
However, whenever I try the method outlined in the accepted answer, I get
dd: opening 'dev/sda1':Permission denied
Since the drive I'm cloning is my main partition, I'm running both machines off of live CDs. I thought it might not be working because I can't clone the drive when it's mounted, but running
umount /dev/sda1 /
says it's not mounted.I'm not 100% set on using this particular method, if there's some other way that would also get the job done.
-
don.joey almost 11 yearsAnd you are sure your harddrive is sda1 and not sda2 or so?
-
StephenTG almost 11 yearsYeah, I checked, a couple of times just to be certain
-
-
StephenTG almost 11 yearsOk, trying with root shell. Any idea if this is supposed to give me an indication that something's happening? It isn't giving me permission denied messages or anything
-
StephenTG almost 11 yearsYeah, may have to go with this if things don't work out.
-
Mitch almost 11 yearsIt might take a while. Do you see any hard disk activity? like an led blinking?
-
Mitch almost 11 yearsI haven't done this before, but take a look at Corona688 comment, see if it helps.
-
StephenTG almost 11 yearsOk, looks like it's through 65 gig so far.
-
StephenTG almost 11 yearsWill do. I'm now curious as to why running in root shell works, while the sudos in the other answer didn't. Is there more to the root shell than just an implicit sudo in front of everything?
-
Mitch almost 11 yearsSometimes when you use the pipe
|
, sudo doesn't run on the whole command, just the part that uses sudo. -
StephenTG almost 11 yearsI see. But the sudo's in front of the dd in both cases, so that shouldn't matter unless it's the nc that needs it, and the permission denied was ostensibly from the dd.
-
StephenTG over 10 yearsSorry for the late update, had to leave before the cloning finished. The cloned computer boots fine, and it's looking clonelike (Going to have to change some stuff back to differentiate it) Thanks for the help!