Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I just cloned the Linux partition of my laptop to be used on the desktop.

However, this was just a straight DD execution, and the MBR of the new drive is not affected. How can I change the new drive to be bootable?

The exact DD command I used was dd if=/dev/sda5 of=/dev/sdc5

share|improve this question
    
Using dd to copy a partition could, I suppose be done. But it involves tedious details which I would never want to mess with unless I had no other choice. Why not boot the Ubuntu Live CD or USB and use gparted to copy the partition? That way the partition table in the MBR will be properly updated as well as any other file system parameters that might need to be "tweaked" as a result of the relocation. –  irrational John May 20 '12 at 4:41
1  
Please include exact dd command line used in question. –  izx May 20 '12 at 5:24
add comment

1 Answer

Let's assume that :

  • Your destination partition table is correctly defined
  • Sizes of sda5 and sdc5 matches (otherwise it would not make sense, or you will need to run gparted to resize the filesystem if sda5 is smaller than sdc5)

You will probably want to copy just the first 440 bytes of the MBR since the partition table is whithin the MBR sector (see wikipedia entries (en) or (fr) with dd command examples).

dd if=/dev/sda of=/dev/sdc bs=1 count=440

Anyway, gparted allows you to easily and quickly copy data between partitions since it analyzes filesystems and only copies the bytes needed, so I would recommend gparted against dd.

The only exception would be in the case you want to recover a broken drive, in that case I would recommend you to extract data with dd_rescue which is more resilient to errors than dd, probably faster, too.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.