Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: What is the easiest way to move grub from sdb to sda.

  1. #1
    Join Date
    Oct 2005
    Location
    Wabasha MN
    Beans
    2,571
    Distro
    Ubuntu

    What is the easiest way to move grub from sdb to sda.

    I just installed 13.10 on a external USB hard drive and while I installed it i chose this drive to be the boot drive. (sdb). so now when I boot I need to keep this drive plugged into the USB. This is not what I wanted.
    I would like to move the grub to sda so I don't need the USB drive to run windows. What is the easiest way to move the grub. I want to keep the one I have because I had to run Boot-Repair to get windows to boot.
    I tried
    Code:
    sudo grub-install /dev/sda
    but that didn't do it.
    I could do a re-install but I know there has to be an easier way to do this.
    Information on my Main laptop. Information on my small laptop Dell 11 3000
    Using a Asus 3632QM laptop with 8gig RAM, 250 SSD.
    Machine Registered 366271, 366273, 366275.
    Registered Ubuntu user number 18630. Registered Linux user number 458093.

  2. #2
    Join Date
    Nov 2009
    Beans
    3,336

    Re: What is the easiest way to move grub from sdb to sda.

    The way you showed above usually works for me ......... but I tend to out of habit

    always ensure things are then uptodate by doing update-grub before and straight after doing the grub install command ......

    Not sure if it makes any difference ........ but its an option .......

  3. #3
    Join Date
    Mar 2011
    Beans
    1,994

    Re: What is the easiest way to move grub from sdb to sda.

    Was this done on a UEFI machine? If so, maybe the nvram got changed by the USB install, even though there is nothing that should have changed in it. From Ubuntu, install and run efibootmgr -v and see what the nvram boot entries look like. The first will be the default, (maybe the USB), and the others should be tried in order (with maybe a /EFI/Boot/bootx64.efi attempt after the first failure). I put a copy of shim.efi in the /EFI/Boot/bootx64.efi location, have a signed copy of grubx64.efi there too, and when a USB update or install messes things up, I still have a working boot (on my Toshiba at least). The install-time bootloader location selection when given a device like /dev/sdb may ignore that and use the EFI partition on sda. Giving the explicit /dev/sdb? (whatever your EFI partition is on sdb) as the bootloader location seems to work better.
    To recap, you should have an EFI partition on SDB (your USB drive), Booting off USB should be first in Boot order, The USB bootloader defaults to /EFI/Boot/bootx64.efi, so make that a copy of grubx64.efi (unsigned for no secure boot), or shim.efi for secure boot (and have a copy of signed grubx64.efi present there too), grub's config file should be in sdb's EFI in /EFI/ubuntu/grub.cfg, nvram boot order after USB should have the Windows bootloader (bootmgfw.efi), and a backup bootloader on sda's /EFI/Boot/bootx64.efi. UEFI still a work in progress. Good luck

  4. #4
    Join Date
    Oct 2005
    Location
    Wabasha MN
    Beans
    2,571
    Distro
    Ubuntu

    Re: What is the easiest way to move grub from sdb to sda.

    I was confused by your post, but here is what I did. See screen shots.
    But this didn't do anything. I still need to have the USB drive plugged in to boot. If I don't it boots to a terminal screen with the prompt: grub:>
    With no menu choices to boot into any OS.

    irv@irv-Q500A: ~_003.png irv@irv-Q500A: ~_004.png
    Information on my Main laptop. Information on my small laptop Dell 11 3000
    Using a Asus 3632QM laptop with 8gig RAM, 250 SSD.
    Machine Registered 366271, 366273, 366275.
    Registered Ubuntu user number 18630. Registered Linux user number 458093.

  5. #5
    Join Date
    Mar 2011
    Beans
    1,994

    Re: What is the easiest way to move grub from sdb to sda.

    Sorry for the confusion. From your pics, the Windows bootloader (Boot0000) is second, so you probably want to move it to first place. I expected to see other entries in the list for "EFI USB device", "EFI network device", "EFI DVD device", but as long as you can successfully boot the USB, I guess that doesn't matter. efibootmgr may be used to change the boot order, see the man pages or -h help, but I think the -o switch is bootorder.
    With that change, I'd expect Windows to boot with no USB drive present, and Ubuntu to boot the way it does now with the drive present.

  6. #6
    Join Date
    Oct 2005
    Location
    Wabasha MN
    Beans
    2,571
    Distro
    Ubuntu

    Re: What is the easiest way to move grub from sdb to sda.

    That great, now how do I change the boot order in the efibootmgr. I can't open it with gedit.
    Information on my Main laptop. Information on my small laptop Dell 11 3000
    Using a Asus 3632QM laptop with 8gig RAM, 250 SSD.
    Machine Registered 366271, 366273, 366275.
    Registered Ubuntu user number 18630. Registered Linux user number 458093.

  7. #7
    Join Date
    Mar 2011
    Beans
    1,994

    Re: What is the easiest way to move grub from sdb to sda.

    I think just
    sudo efibootmgr -o 0000,0001
    might do it, but I've never done it myself.
    Check with the -v afterwards.

  8. #8
    Join Date
    Jun 2010
    Location
    London, England
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: What is the easiest way to move grub from sdb to sda.

    I have two hard drivers and several installs of Ubuntu and one of Winodws 8 preview. I have Grub installed into the MBR (no UEFI) of both disks. I can use the BIOS to select which hard disk has boot priority and hence which version of Grub to load.

    Can you not use the UEFI to set the machine to boot from the hard disk and not the USB disk when you want to use Windows and then set it again to boot from the USB disk when you want a choice of either Ubuntu or Windows? Or have I missed the point of what you want to do?

    Remember, by installing Grub into sda you will get a Grub menu that will show Ubuntu but will not boot Ubuntu unless the USB disk is connected. If Grub configuration files are not on a boot partition on sda then Grub will be broken for it will be looking for /boot on sdb for its configuration files and sdb will not be connected.

    Regards.
    It is a machine. It is more stupid than we are. It will not stop us from doing stupid things.
    Ubuntu user #33,200. Linux user #530,530


  9. #9
    Join Date
    Oct 2005
    Location
    Wabasha MN
    Beans
    2,571
    Distro
    Ubuntu

    Re: What is the easiest way to move grub from sdb to sda.

    OK, I got it so it will boot from the sda now without the USB plugged in.
    I did the:
    Code:
    sudo efibootmgr -o 0000,0001,0002
    And that fixed it.
    Now in Windows 8.1 the only way I can boot from a USB is to got into windows, and do a [SHIFT] reboot and it will give me an option to boot from a USB. I just chose Ubuntu and it will come up with the grub on the USB. Then I can select Ubuntu and it will run it off the USB.
    I am waiting until the 16th when 14.04 comes out and I am going to install it along side win 8.1.
    Thanks for all the help. Its time for me to wrap it up.
    Information on my Main laptop. Information on my small laptop Dell 11 3000
    Using a Asus 3632QM laptop with 8gig RAM, 250 SSD.
    Machine Registered 366271, 366273, 366275.
    Registered Ubuntu user number 18630. Registered Linux user number 458093.

  10. #10
    Join Date
    Apr 2011
    Location
    3rd Rock from the Sun
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: What is the easiest way to move grub from sdb to sda.

    Boot-Repair should do the job effortlessly. Have you tried it?
    To understand what is happening at/during boot we need to see the 'Bootinfo Summary'. Choose 'create bootinfo summary' option in Boot-Repair utility, note down the url link to the file and paste the link here if you have any difficulty in reading it.
    "Evolution is Nature's way of issuing upgrades."


Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •