0

I have a dual boot laptop that was built by Dell with Windows/Red Hat. The grub configuration says that it was made by Anaconda.

The partitions are as follows:

/dev/hda1  Dell Utility
/dev/hda2  Windows 2000
/dev/hda3  extended (presumably Windows)
/dev/hda5  Linux [\]
/dev/hda6  Linux Swap
/dev/hda7  Linux [\home]

The bootable partition is /dev/hda2, the Windows partition. I get that the Dell Utility partition is booted by the BIOS, so I can ignore that.

What I don't understand is how Grub (which is located, I assume, on hda5, which is where its configuration files are) is starting when the machine boots, since it must be booting /hda2, at least according to the BIOS.

  • It seems like the simplest answer would be correct, in that GRUB is being found first when your computer is looking for boot configurations. It is possible to have GRUB on a Windows partition as well, it will just chain load to Windows Boot Loader. – No Time Jul 31 '14 at 4:33
  • IIRC you can just change the bootable partition (with e.g. fdisk and a) and it will not affect grub at all. Grub can also be installed on a partition and chain loaded. This is all independent of where the files for grub are, they can be on any partition assuming grub can handle the filesystem type of the partition. – Anthon Jul 31 '14 at 5:23
  • dev/hda1,dev/hda2, and dev/hda3 are primary partitions. "Extended" means that dev/hda3 contains logical partitions: presumably dev/hda7 and dev/hda5. The Linux Swap partition,dev/hda6, could be a logical partition - that is it could be part of dev/hda3, but the typical recommendation is that the Linux Swap disk use a primary partition. Why do all this? is a good question. Traditional PC hardware only allows 4 primary partitions (any/all/none can be extended). help.ubuntu.com/community/HowtoPartition/PartitioningBasics – ben rudgers Jul 31 '14 at 11:57
1

First, there are two rather different versions of Grub. The older version can be referred to as "Grub" or "Grub legacy". The newer version is Grub2. In the places where a user typically wants to make changes they work very differently (Grub legacy is simpler, Grub2 offers finer control).

When booting, execution jumps from BIOS to the first boot device. On a hard disk, Grub works by installing itself at the location of the Master Boot Record which is useful because that is where execution lands.

Unfortunately, the Master Boot Record is only 512 bytes (or at least that's all Grub can rely on). Fortunately, that's enough space to contain data about partitions and sufficient code to jump execution to one of them. At that point, space isn't really at a premium anymore and that's where the rest of the code for booting lives - e.g. menus, boot scripts, and the rest of the Grub code.

Manual for Grub Legacy.

Tutorial for Grub Legacy.

Manual for Grub2.

Tutorial for Grub2.

  • oops, sorry... you're completely right. my apologies. if you edit your answer I can remove my downvote. – countermode Jul 31 '14 at 12:46
  • ....no worries. – ben rudgers Jul 31 '14 at 12:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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