0

(I am aware I may be duplicating post, but no sure where should I ask my quesiton)

I installed a second harddisk to my laptop so that I can test on new linux distribution without trashing my working one.

I did the following:

  1. Installed linux mint 15 to my first drive sda and use it as my working linux
  2. Installed linux mint 16 to my second drive sdb and test it
  3. I used sudo update-grub when boot to sda so that I can dual boot the two distributions
  4. since linux mint 15 is no longer supported, I did my backup, cloned sdb to sda using Clonzilla
  5. I want to use the sudo update-grub trick again so that I can dual boot both linux mint 16 distributions at sda and sdb.

I went to step 5, but things don't go as expected, if I plugged sdb into my laptop, it automatically boot to sdb, no matter which distribution I choose.

How should I adjust grub?

update 01

I have extracted my grub info using boot-repair and can be accessed via: http://paste2.org/NG99V4Fs

1 Answer 1

0

If you clone a disk, you clone along with it its UUID. This hexadecimal string is used to uniquely identify your partition. Since grub uses these identifiers to keep track of partitions, cloning disks in this case is a bad idea, because the UUID isn't unique anymore.

EDIT 05.08.2014 The follwing will most likely break your bootprocess because config files will refer to old UUIDs. I leav it here to keep trak of changes: One way to work around this problem is to recreate your partition table manually on the target disk and dump the content of the source partition over to the target partition. Doing so will create new UUID's for your target partitions. You can do this by using fdisk/gdisk and dd command.

This might work. But I don't see the issue with using sdb as your standard boot drive and use sda for further experiments. If want to test distros frequently I would recommend you to use some kind of visualization like Virtual-box or similar. This saves you a lot of tempering with the basic setup of your machine.

EDIT: 05.08.2014: Answer to further OP questions:

I have spent some more time to think about your plans. Copying the partitions as mentiond above will fix youre UUID problem in the bootloader. But will brake all configfiles that contain UUIDs. So it's generally a bad idea to do as I pointed out above.

If you install a new OS to a drive, the install script will make new partitions with new UUIDs. A grub-update will make both os bootable from one bootloader. But be careful about the boot drive given to the BIOS. The bootloader is usaully placed in the mbr of the disk the os was installed too (unless you instruct it to do otherwise). This means the os on sda will maintain it's bootloader on sda, likewise the os on sdb its bootloader on sdb. If you now install a new os, test it and finally want to keep it do as follows:

  1. Change the default bootdisk int the BIOS to the disk you want to keep
  2. Update the booloader with the update script in the os you want to keep
  3. Make sure both os are boot able from the disk you want to keep
  4. Nuke the other disk... or do what ever you want to it.
  5. Boot the the os you wanted to keep.
  6. Update the bootloader again to make it aware of the changes on the other disk.

This process will switch you working disk every time you switch the OS. You might want to keep your home-dir somewhere else and just mount it automatically via /etc/fstab. Or simply make a back up and copy the data back and forth

I would still suggest that you use Virtualbox (or some other virtualisation software) for testing purpose and then install the new OS to a drive you want to use. With a separate /home you can keep your personal data in place while changing the OS.

And remember: Before you make any changes to your system back up your data!

1
  • thanks, let say I do what you say that I used sdb as my working drive, I installed new version of linux mint in sda and decided to clone it to working drive, since the cloning direction is changed, will this present the same problem but in a different way that sda need to be removed in order to boot sdb. I am using my laptop's cd drive sata port as sdb, so it is a lot easier for my to unplug sdb if needed.
    – lokheart
    Aug 2, 2014 at 23:26

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .