How to install grub on usb flash drive?

36,625

Open a terminal, and type sudo fdisk -l (your USB flash drive should show up in the list if it is inserted). Now, type sudo grub-install /dev/<insert flash drive name here> to install it on your flash drive.

for example:

sudo grub-install /dev/cookies

Be careful with these commands (don't mess up) or you could damage your system. Make sure you are installing to the flash drive and not something else.

I'm not completely sure that this will allow you to boot your system as you wish, but if it doesn't you can edit your grub configuration on the flash drive to find your built in hard drives.

Share:
36,625

Related videos on Youtube

Jorge Castro
Author by

Jorge Castro

Updated on September 17, 2022

Comments

  • Jorge Castro
    Jorge Castro over 1 year

    I was wondering if I could make an os-selecting-hardware-key or something like that.

    I'm currently using a dual boot system (ubuntu 10.10 + win7) and i want to use an usb drive to specify the OS I want to boot. So if the usb key is plugged in during the boot, it will start one operating system, if it isn't, it will boot the other one.

    I want to edit my currently installed grub to recognize only one OS, and install a second grub to the usb key, with the other OS in it. After that I just need to set up booting from the usb key in the BIOS. I may be completely wrong about it, but mainly I need some advices how to install grub(2) on the usb key.

    • Admin
      Admin over 13 years
      What problem are you really trying to solve? Isn't there a simpler solution for what you want to do?
  • Ciro Santilli OurBigBook.com
    Ciro Santilli OurBigBook.com over 8 years
    Ubuntu 14.04 fails with: "embedding is not possible, but this is required for cross-disk install"
  • Jason Southwell
    Jason Southwell over 8 years
    Try this: ubuntuforums.org/showthread.php?t=1913517 If that doesn't work, feel free to open a new question.
  • Asifa.K
    Asifa.K almost 8 years
    @CiroSantilli巴拿馬文件六四事件法轮功 I think you need to set the --boot-directory parameter to a directory on the target flash drive. That should get it working.