Wednesday, May 1, 2024
 Popular · Latest · Hot · Upcoming
14
rated 0 times [  14] [ 0]  / answers: 1 / hits: 55523  / 2 Years ago, tue, february 15, 2022, 4:11:16

Can I Install grub on an USB and make it a rescue disk?



Question: Is it safe to run the following commands?



sudo grub-install /dev/sdb    (where sdb is my USB drive)
update-grub2



  • Question: Would I really get a grub menu from USB (provided that it boot first
    at my BIOS) whenever I cannot boot from my hard disk?

  • Question: Does update-grub2 delete itself from one drive when installing to
    another, will I boot from hard disk also than from USB, depending on
    my BIOS options?


More From » boot

 Answers
4

The question is about installing GRUB on USB drive. Let's start with the questions first:




  1. The command sudo grub-install /dev/sdb (where sdb is my USB drive) should work when booted from the hard drive with USB drive connected. However, since GRUB puts its config files in /boot/grub, where those will go depends on what kind of Ubuntu installation you have in the USB drive.




    • If it is a live USB, the /boot/grub folder includes a loopback.cfg
      and installing the rest of grub there may have unintended effects.

    • If you have a full installation of Ubuntu in a 8GB or larger USB drive, See more at
      How do I install Ubuntu to a USB key? (without using Startup Disk Creator),
      then GRUB should be installed at the time of Ubuntu installation. If
      for some reason GRUB is not installed, you can mount the USB boot
      partion (assuming sdb1) and specify where the rest of grub goes by



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


  2. Yes, you can get a GRUB menu from USB drive provided you have a full Ubuntu installation in that USB drive.


  3. No, update grub should not delete information from the internal drive. You can control which GRUB will be updated by using sudo chroot /mnt after mounting sdb1 to mnt.




Hope this helps.


[#35951] Wednesday, February 16, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
musining

Total Points: 171
Total Questions: 124
Total Answers: 121

Location: Zambia
Member since Thu, Jun 25, 2020
4 Years ago
;