Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
What problem are you really trying to solve? Isn't there a simpler solution for what you want to do? – JanC Oct 31 '10 at 23:10
up vote 4 down vote accepted

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|improve this answer
Ubuntu 14.04 fails with: "embedding is not possible, but this is required for cross-disk install" – Ciro Santilli 巴拿馬文件 六四事件 法轮功 Sep 12 '15 at 16:27
Try this: If that doesn't work, feel free to open a new question. – RolandiXor Sep 12 '15 at 22:51
@CiroSantilli巴拿馬文件六四事件法轮功 I think you need to set the --boot-directory parameter to a directory on the target flash drive. That should get it working. – starbeamrainbowlabs Jun 11 at 18:24

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.