Take the 2-minute tour ×

I'm working on a legacy project with a small single board computer running Ubuntu 10.04 on a compact flash card. I need to be able to save away a working image (via dd) and copy said image to other compact flash cards for use in other single board computers (with identical hardware)

I'm able to copy the image to other flash cards and bootup on other systems no problem. But I'm seeing strange behavior. For instance, I can't use sudo on the new system (“sudo: must be setuid root”). I've gone down the path of trying to fix this, but have run into a slew of other issues.

General question is: what do I need to be aware of when moving a hard disk containing Ubuntu (in my case a compact flash card) to another computer? I was hoping it would be seamless to Ubuntu since it's moving to a system with identical hardware. Is there something that needs to be done to make it "portable"?

share|improve this question
Can you compare both cards on a 3rd pc? You did the dd from the running system, including /proc and /dev? –  ott-- Aug 28 '12 at 18:59
You are not booted to the system you are trying to copy when you use dd right? You are mounting the old and new CF on some other system and performing the copy? Using DD to copy a read-write mounted filesystem is a bad idea. –  Zoredache Aug 28 '12 at 19:06
To create the image to be copied, I pop the compact flash card out of the system, put it into a CF reader on a separate Linux machine, and create the image with "sudo dd if=/dev/sdb of=28aug2012.img bs=1M conv=noerror". sdb is how the CF card shows up to the system. –  Tim Aug 28 '12 at 19:15
add comment

1 Answer

You're right it ought to be seamless. If you crate a complete image of the flash disk using dd and transfer it to another flash disk of equal or bigger size it should just work. That should include the boot record too, unless you only "dd'ed" individual partitions.

The error you reported normally isn't caused by this method. It could happen if you only copy over things like /home and /usr, but leave / itself to be (re-)created by (re-)installing the OS.

Could you post any other issues you are seeing? Also could you write down which commands you used to create the flash disk image and copy it over.

The audio problem you mention in your comment is something you could expect as a result of moving a system this way. The sudo problem I would suspect something else to be the culprit. What that would be I don't know, it could be something that went funky due to audio not working, but that's just a guess and unlikely to be linked. Check your logs on the new system after the time of moving for anything that might indicate a problem.

share|improve this answer
sudo dd if=16aug2012.img of=/dev/sdb bs=1M conv=noerror –  Tim Aug 28 '12 at 19:00
The image is an exact 4GB copy from another compact flash card, just swapped the "if" and "of". Most things work fine on the "transplanted" system. But I first noticed there was a problem when the audio wasn't working. If I try to launch menu System->Preferences->Sound, I get "waiting for sound system to respond". Which led me to the sudo problem. –  Tim Aug 28 '12 at 19:06
I updated my answer. –  aseq Aug 28 '12 at 21:01
add comment

Your Answer


