Logo 
Search:

Unix / Linux / Ubuntu Answers

Ask Question   UnAnswered
Home » Forum » Unix / Linux / Ubuntu       RSS Feeds
  on Nov 29 In Unix / Linux / Ubuntu Category.

  
Question Answered By: Adah Miller   on Nov 29

The problem is likely one of where grub is installed. If grub is installed on a
removable drive then it won't work properly. It should be installed of the drive
that boots first.

I have two hard drives. I usually want grub installed on my first drive hda and
not my second drive sda because hda is the primary master and sda is the primary
slave. The BIOS will boot hda first. If I press ESC on boot up my HP comes up
with a menu which allows me to choose which device to boot. If I choose sda, the
second drive, it will not have grub and will load Windows which is the first OS
on sda. If I add other OSes to sda, then a second grub menu will pop up which is
entirely different from the previous grub and it will give me choices instead of
booting Windows. In other words you can have more than one grub menu and you can
write them to different drives.

I have a usb stick which I have also had OSes on. Once I had two versions of
Linux on the usb stick. In this case a grub menu was added to the usb stick to
allow me to choose which OS to boot. It made no reference to any other OSes,
only to the ones on the usb stick.

If you install Linux to a removable drive and grub is written to it instead of
the permanent one then you will get the situation that grub is missing when the
drive is removed and you won't be able to choose which OS to boot from the
permanent drive. The solution is to have two grub menus, one for the removable
and one for the permanent one.

Possible problems can occur when you fool around with grub and removable drives.
Drives are named in sequence. When they are mounted they become sda1, sda2, sda3
or hda1, hda2, etc. However grub uses (hd0,0), (hd0,1), (hd0,2) instead of sda1,
sda2, sda 3 for the first drive and it uses (hd1,0), (hd1,1) (hd1,2) for the
second drive. These things are relative to when grub was written. If you modify
grub and a drive that you had in sequence is removed at the time you can foul
things up. For example if you remove the drive that was hd0, the second drive is
now hd0 as far as the machine is concerned. But grub will still point to hd1 for
that drive which is what it was at the time grub was saved to the drive and it
will not boot unless you press 'e' in grub and change (hd1,0) to (hd0,0) then
press 'b'.

This should be clear as mud, but it shows that grub is incredibly logical and
when we mess with things it throws the machine off.

Share: