Help with cloning opensuse to new HDD

I have a fully 250GB HDD which has XP and oS11.2 dual booting. openSUSE was installed after XP so grub was set up to boot from theb /boot partition leaving the XP MBR intact which is important because it also boots the factory recovery partition…

I’ve now got a new 500GB HDD and have reinstalled XP on it and now want to clone oS11.2 from my old disk to the new disk. I’ve set fstab and the grub menu list to use generic disks as opposed to disk IDs. I then created images of each oS partions using clonezilla.

When I restore the partiton images to the new disk the disk won’t boot. It seems the MBR has been messed up. I tried booting from an oS install DVD and repairing grub by setting it to boot from the /boot partition but that hasn’t helped either.

Can someone please tell me how I can clone oS and keep the MBR intact so it doesn’t affect boot XP. At themoment I’m stuck without XP or oS booting.

To backup and restore the mbr:


dd if=/dev/hda of=/root/hda.boot.mbr bs=512 count=1
dd if=/mnt/hda1/root/hda.boot.mbr of=/dev/hda bs=512 count=1

to copy whole partitions, maybe it is necessary to play with the blocksize value to suit your needs:


dd if=/dev/hda of=/dev/hdb conv=noerror,sync bs=4k

Other alternatives would be dd_rescue or clonezilla

Thanks. Just some questions to confirm the sequence of the process.
I have the old disk in the laptop and the new disk in a caddy attached by USB.
With the system booted on the old disk I do

dd if=/dev/hda of=/root/hda.boot.mbr bs=512 count=1

Do I then just run

dd if=/dev/hd of=/dev/hdb conv=noerror,sync bs=4k

to copy the MBR to the new drive. Do I need to mount the drive first? I assume not as you mount partitions as opposed to a whole device - is that correct?

Oops, just spotted a bit of copy / paste trouble. The second dd command should have been

dd if=/mnt/hda1/root/hda.boot.mbr of=/dev/hdb conv=noerror,sync bs=4k

I will actually be substituting hd* for sd*.

Well that messed things up. I’ve now lost the partitions on my new drive. From 10 partitions I am done to 4 and the sizes are all wrong. Seems like I lost the data and will have to start again :frowning:

hmm, the commands where meaned as an example, not just a plane copy/past job. All is very dependent on your own setup.

joostvanrooij wrote:
> hmm, the commands where meaned as an example, not just a plane copy/past
> job. All is very dependent on your own setup.

yep, your participation and help here is highly appreciated, but
(seeing your sig) i guess it is now obvious that many (most?) here
won’t know enough about everything to know what is exactly what they
should use and what is an example of what they need to adapt to their
situation…

usually it is best to assume that specific instructions are
needed…of course then occasionally you will get “i am NOT an idiot”
or “i KNOW that” or “do you think i’m a n00b, or what?” etc…sigh…

can’t win!


palladium

Yes, I took joosvanrooij’s answer literally and virtually copy / pasted the command after changing the /dev/* bits to suit my partitions.

I did learn from the experience though and have successfully cloned my old HDD after battling a little with getting grub working.