Wrote to partition while making image file w/ dd: Did I mess it up?
Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Wrote to partition while making image file w/ dd: Did I mess it up?
Hi everyone,
I recently bought a 500 GB hard disk to replace my 120 GB one. I have an external hard drive so I did:
sudo dd if=/dev/sda of=/media/LaCie/harddisk.img
in order to make an image of the entire hard disk on my external LaCie hard drive. But being bored (and stupid), I decided to go around and edit* a couple of files on the drive during the 12 hours it took to create the image file.
Now I took out the old hard disk and put in the new hard disk and booted using a Ubuntu 9.04 LiveCD and issued the command:
sudo dd if=/media/LaCie/harddisk.img of=/dev/sda
When I come back tomorrow, will my computer boot up? Or did my editing screw up my files?
*The "editing" is because I was using Ubuntu 10.04 on the hard disk I was trying to copy, so I probably moved things in and out of swap and temporary internet files, as well as accessing (but not editing, except for the time-stamps) of the other partitions on the hard disk.
I don't think there is any way of knowing what was affected until you try to restore from the disk image.
As you doubtless already know, what you did was not a good idea. BUT: The first thing to do is make sure the original HD is OK. If so, then just make a new image file.
The restoring of the image went better than expected, I had both Mac OS X and Ubuntu installed, both reported errors when they booted up on the new larger disk, but they managed to fix themselves. It sort of makes sense, since I probably affected only a couple hundred files out of 20,000+ files on the hard disk when I was making the image.
The main problem I have now is to convince Mac OS X and Ubuntu that the hard disk is now 500 GB and not 120 GB...
I don't recall if you stated what your partitioning setup is. For example, I would NEVER want to have a 500GB drive with only one partition.
Regardless, if you clone a partition to another drive, you get the same size partition that you started with. You can then re-size the partition using any of the standard tools. The GParted live CD is always good to keep handy.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.