LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Wrote to partition while making image file w/ dd: Did I mess it up? (https://www.linuxquestions.org/questions/linux-general-1/wrote-to-partition-while-making-image-file-w-dd-did-i-mess-it-up-816019/)

vincebs 06-23-2010 08:03 PM

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.

pixellany 06-23-2010 08:53 PM

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.

vincebs 06-23-2010 09:52 PM

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...

pixellany 06-24-2010 08:18 AM

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.


All times are GMT -5. The time now is 03:29 PM.