12

I have 13.04 installed on my hard drive in my laptop, I now also have 13.10 on an SSD in the same machine.

At the moment to boot 13.10 I have to set in bios to boot my hard drive (which is not the disk 13.10 is on) which I guess launches grub from my hd and then I can select to launch Ubuntu (which launches 13.10) or Ubuntu 13.04 - both work.

My question is - how do I move grub from the hd to the SSD so in future if my hd fails my instal won't? I don't really need the 13.04 install to keep working although it would be handy.

Many thanks.

1
  • go with sdb and never with sdbxy
    – rɑːdʒɑ
    Oct 26, 2013 at 5:44

3 Answers 3

7

Reinstalling GRUB 2 from a Working System

If Ubuntu is operating normally, boot into the working installation and run the following command from a terminal.

X is the drive (letter) on which you want GRUB to write the boot information.OP you placed your SSD /dev/ in the command. If you want to know that , after connecting your SSD to Ubuntu machine type df -h there you can find your SSD /dev/ code.

sudo grub-install /dev/sdX  # Example: sudo grub-install /dev/sda

This will rewrite the MBR information to point to the current installation and rewrite some GRUB 2 files (which are already working). Since it isn't done during execution of the previous command, running sudo update-grub after the install will ensure GRUB 2's menu is up-to-date.

6
  • It's the sudo fdisk -l command to list your /dev/sdx device.
    – nicoX
    Oct 24, 2013 at 11:11
  • Thanks :) my fdisk outputs that my ssd which I want grub on is: Disk /dev/sdb: 120.0 GB The table for it looks like: Device Boot Start End Blocks Id System /dev/sdb1 2048 499711 248832 83 Linux /dev/sdb2 501758 234440703 116969473 5 Extended /dev/sdb5 501760 234440703 116969472 8e Linux LVM Should I run th egrub command against sdb or sdb1 ?
    – Staple
    Oct 24, 2013 at 19:39
  • run the command for sdb and not recommended for sdbXY
    – rɑːdʒɑ
    Oct 26, 2013 at 5:43
  • I had to switch my bootloader (GRUB) from a dying primary hard disk (sda) to secondary hard disk (Sdb). ran "sudo grub-install /dev/sdb" and changed BIOS boot sequence to boot from secondary hard disk first. Worked like a charm.
    – Kingsly
    Apr 29, 2016 at 2:50
  • 1
    @nicoX I think the easiest and fastest command to find that is lsblk.
    – Melebius
    Jul 13, 2019 at 5:20
0

another option might be to clone the 13.04 with Clonezilla, then restore using Clonezilla to the SSD drive using a CZ boot stick/CD/DVD. I wont guarantee it but it would probably work. you might get the Ubuntu logo and top left corner says press S to continue, that requires the fstab file to be modified to reflect the new drive. https://clonezilla.org/

0

On pepperment "xubuntu" the simple copy of grub will not work when you switch boot from Bios, as sdb which has the grub copy became sda and many error messages then stop, however switching back will work with some error messages of files not found at where expected.

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.