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
Let's assume that :
sda5
andsdc5
matches (otherwise it would not make sense, or you will need to rungparted
to resize the filesystem ifsda5
is smaller thansdc5
)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).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 againstdd
.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 thandd
, probably faster, too.