Grub installed in usb pen drive Linux in HDD

I know some one whom I recommended Linux and is happy using it. But unfortunately he has to use it on a shared computer. In his case the computer is in dual boot and others who do not use Linux are always too inquisitive at the Grub stage (no matter how short that time is) and often try to mess around with it or find some reason to complain about it.

I thought of a way to solve this problem but not sure how to do it. Can any one give some advise.

I want the grub to be installed in a USB Pen Drive. When the pen drive is not in the usb port the computer boots normally through mbr in to windows. But if pen drive is found in the usb port, its boot priority being higher, the computer will try to follow the instruction of grub which will direct it to the partition in hdd that has linux.

So the pen drive just has grub and it serves as a ‘key’ for using linux and without which the computer will behave as if nothing other than windows is present in it.

@matrix

if you want to install the grub on usb just mount the flash-drive and install grub on that flash-drive

for ex:

#grub-install /dev/flash-drive name

for more information once look at

#info grub-install

if you want to boot the linux form usb then once look at the below link it may help you

You can use a persistent USB flash drive. Meaning it will be a live Linux USB, but every time you make changes, they will be saved on the flash drive.

But it will not be booting from the HDD. Will it be ?

Do we need to do this only when Linux is being installed ? Or it can be done even after that ?
In the second case, case how do we configure Grub to locate the Linux partition while booting ? Does it self detects as it does in case of a normal install ?

Also how do I remove grub in the computer so that it behaves as if there is no linux in that computer ?

@matrix

For removing grub from windows you have to use windows live cd

  1. Insert Windows 7 installation disc and boot from it

  2. Press a any key when you are prompted & select [language, time, currency, keyboard etc.] & click Next . Select Repair Your Computer option in the dialog window.

  3. In the ‘System Recovery Options’ window Click the 1st Option Startup Repair and wait a for some time

  4. If you still facing the issue then open the command prompt and type the fallowing commands

bootrec /fixmbr

bootrec /FixBoo

Otherwise use the third party tool [EsayBCD] for removing the GRUB and fallow the below tutorial

Grub is installed by Linux in a a dual boot computer, then why cant Linux remove it ?
Why do we need Windows to do that ?
I am sure there must be a way.

@matrix

Yes you can uninstall grub from linux as well for that fallow the below steps

  1. Open terminal

  2. #fdisk -l

  3. #dd if=/dev/zero of=/dev/sda bs=446 count=1

  4. #fdisk -l

here

The actual size of MBR is 512 bytes and it is located on the first sector of bootable disk typically /dev/sda or /dev/hda and the first 446 bytes on the disk belongs to the boot part. The next 66 bytes store the partition information, total of 512 bytes. If you want to just wipe the boot code, by running the above dd command you can wipe out the grub.

Thanks but I would first need to know, what I asked earlier !

Do we need to do this (install grub in pen drive) only when Linux is being installed ? Or it can be done even after that ?
In the second case, case how do we configure Grub to locate the Linux partition while booting ? Does it self detects as it does in case of a normal install ?