Permission denied using dd to clone main drive

5,361

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.

Share:
5,361

Related videos on Youtube

StephenTG
Author by

StephenTG

Updated on September 18, 2022

Comments

  • StephenTG
    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
      don.joey almost 11 years
      And you are sure your harddrive is sda1 and not sda2 or so?
    • StephenTG
      StephenTG almost 11 years
      Yeah, I checked, a couple of times just to be certain
  • StephenTG
    StephenTG almost 11 years
    Ok, 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
    StephenTG almost 11 years
    Yeah, may have to go with this if things don't work out.
  • Mitch
    Mitch almost 11 years
    It might take a while. Do you see any hard disk activity? like an led blinking?
  • Mitch
    Mitch almost 11 years
    I haven't done this before, but take a look at Corona688 comment, see if it helps.
  • StephenTG
    StephenTG almost 11 years
    Ok, looks like it's through 65 gig so far.
  • StephenTG
    StephenTG almost 11 years
    Will 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
    Mitch almost 11 years
    Sometimes when you use the pipe |, sudo doesn't run on the whole command, just the part that uses sudo.
  • StephenTG
    StephenTG almost 11 years
    I 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
    StephenTG over 10 years
    Sorry 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!