LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Boot problem after cloning to new drive (https://www.linuxquestions.org/questions/linux-newbie-8/boot-problem-after-cloning-to-new-drive-4175444855/)

barneyw 01-09-2013 02:13 PM

Boot problem after cloning to new drive
 
Hi - and thanks in advance for any help!

I've been trying to clone my old 80Gb hard drive (which boots into Ubuntu) onto a partition in a larger 1Tb drive using dd.

I set up an 80Gb partition, marked it as 'bootable' and copied the entire device of the old drive to the new partition.
Code:

dd if=/dev/sda of=/dev/sdb1 bs=100M
It won't boot at all!

If I copy the 80Gb onto the 1Tb drive without partitioning first, the computer boots from the drive no problem.... but I don't then have the partitions i want.

My question is what else do I need to do to make my partition bootable? I have no experience with Grub or Lilo as I have not seemed to need them so far...

Regards,

Barneyw

lykwydchykyn 01-09-2013 02:23 PM

I'm not entirely sure, but I suspect the problem is that your "dd" command is copying a drive (including partition table and MBR) to a partition.

When I've done this sort of thing in the past, I've found it worked better to create the partition and then copy the contents of the old partition using rsync. If your fstab and bootloader config use UUIDs to point to the parititons, you'll need to either update those or trade them out for device or label notation instead.

Alternately, you could copy the drive first, then edit the partition table with gparted or somesuch after the fact.

spiky0011 01-09-2013 02:33 PM

Hi

You could get the drive to boot, your 2nd option then use gparted from a live cd to shrink the partition to what you want, 1 thought I have never done this on a big drive like that so not sure how long it will take

Sorry missed the last bit in previous post

yancek 01-09-2013 05:18 PM

Quote:

dd if=/dev/sda of=/dev/sdb1 bs=100M
If you copied to the partition, you didn't put the Grub2 in the master boot record. You could Grub2 to the mbr of sdb.


All times are GMT -5. The time now is 12:18 AM.