Re: 1hdd 4os's boot loader/shared swap files?

On 2/14/2011 6:19 PM, The Natural Philosopher wrote:
Mike S wrote:
I have a friend who wants 4 OS's on his hdd, and he has a few
questions about the best way to proceed:

- can he use one swap file partition and have Debian, Slackware and
Suse all share it, instead of having one swap file partition for each

I think so, if its a separate partition.

- what is the recommended boot loader to handle 4 OS's (incl. Win2k)?
Is there any advantage to using lilo over grub?


- what is the recommended location for the boot loader. I would think
a separate partition would be the safest, but if anyone has any
recommended reading or experience with this I'll be happy to hear it.

i thought boot loaders lived outside partitions.

could be wrong at that.

IIUC the boot loader can go in the MBR, in a separate partition (where resizing partitions from Windows and other Windows operations won't delete it) and in a SuperBlock.

Grub in the MBR:

How does GRUB work?
When a computer boots, the BIOS transfers control to the first boot device, which can be a hard disk, a floppy disk, a CD-ROM, or any other BIOS-recognized device. We'll concentrate on hard disks, for the sake of simplicity.
The first sector on a hard is called the Master Boot Record (MBR). This sector is only 512 bytes long and contains a small piece of code (446 bytes) called the primary boot loader and the partition table (64 bytes) describing the primary and extended partitions.
By default, MBR code looks for the partition marked as active and once such a partition is found, it loads its boot sector into memory and passes control to it.
GRUB replaces the default MBR with its own code.
Grub in a separate partition:

Another example is when you have a separate boot partition which is mounted at /boot. Since GRUB is a boot loader, it doesn't know anything about mountpoints at all. Thus, you need to run grub-install like this:

# grub-install --root-directory=/boot /dev/hda
Grub in the superblock:

3.3. MBR vs. Superblock

The first stage of the GRUB and LILO boot loaders does not always have to be installed in the Master Boot Record of the hard disk. Sometimes it is convenient to install the boot loader in the first sector, or superblock, of the root partition, particularly for systems that have multiple operating systems. Check the boot loader's man page for details on how to specify the installation location.

Relevant Pages

  • fixing grub : mbr fix when windows install after linux
    ... "There is not a boot manager screen at all, ... windows but GRUB boot window does not appear. ... "I forgot to install GRUB, I didn't install GRUB in the MBR, I chose ... Fedora but that was not an active primary partition". ...
  • Re: FreeBSD/amd64 on ASUS Transformer T100 kconvertible tablet?
    ... As expected the machine did not boot. ... MBR: MBR only ... Main partition table overlaps the first partition by 34 blocks! ... Logical sector size: 512 bytes ...
  • Re: OT File recovery Software
    ... > I guess some of you never used the fix MBR command? ... > The Master Boot Record will be created when you create the first ... > partition on the hard disk. ... > first sector on the disk. ...
  • Re: Fedora Core 2/Windows XP dual boot: selecting Linux doesnt work
    ... grub is installed on the /root partition, which is the first partition on hdc: hdc1, or in grub notation. ... Stage1 is the unpatched 512-byte file, that is patched and copied to the boot record during setup. ... This byte is initialized to 0xff in the stage1 file, but patched to 0x81 in your setup, to say "we are booting from disk." ...
  • Re: FreeBSD for serious performance?
    ... Having just been recently convinced to switch over to GPT (from MBR) I do ... BSD from a partition but I never got that to work. ... boot the MBR of a different disk which then booted BSD. ...