3

I have cloned my HDD to an external HDD and now I need to install GRUB to make the external HDD bootable.

The external HDD is meant as a mirror backup for my current HDD (I mean that once the external HDD is bootable, I will place it into my PC and boot it; I am not going to boot from the mirror backup while keeping it into its external enclosure).

As far as I know, the standard procedure to install GRUB is to place the HDD into your PC and boot with a live CD, but I would rather using a live CD and do everything from my existing Linux installation. Is this is possible?

3

Use grub-install. If your external drive is /dev/sdb and GRUB images are in /boot/grub/ of its first partition, typically you can do as follows:

mount /dev/sdb1 /mnt
grub-install --boot-directory=/mnt/boot /dev/sdb
1

Make sure you've cloned the original disk's master boot sector and whatever is at the beginning of the disk, by doing something like dd if=/dev/sda of=/dev/sdb bs=512 count=2048 - assuming sda is the original drive and sdb is the mirrored drive, tune that as necessary.

Then try simply unplugging the current disk and plug the mirrored disk in its place. Worst case it won't work and you'll revert right back.

A quick google finds me a guide that shows clonezilla being used in the context of boot loaders - http://clonezilla.org/show-live-doc-content.php?topic=clonezilla-live/doc/03_Disk_to_disk_clone

  • 1
    @JosipRodin There is a grey area between what is a comment and what is an answer. As you worded your post as a question, it looks more like a comment asking for more information than like an answer. I changed it so it looks more like an answer, you can roll back if you don't like the change – Anthon Jun 4 '15 at 13:03
  • @Josip Rodin: No, I didn't clone the MBR, because the HDDs are different (manufacturer and size). I only cloned the partitions by using CloneZilla. – Elena Jun 4 '15 at 14:19
  • @Elena I'm not sure what CloneZilla does, but just in case included a hint on how to clone the MBR in the answer above, try it. – Josip Rodin Jun 5 '15 at 16:21
  • Just copying the first sector (MBR) is insufficient in most cases. GRUB utilize the gap between MBR and the first parition to store its stage1.5 or core.img. See this image found in Wikipedia. – yaegashi Jun 5 '15 at 17:16
  • Then just expand the amount to cover the first megabyte. Since the point is to make an identical copy, it should be safe enough. – Josip Rodin Jun 5 '15 at 19:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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