Click to See Complete Forum and Search --> : How to install and boot 145 operating systems in a PC


saikee
12-30-2006, 07:01 PM
--- Updated 4 Jun 10 - The gpt partitioning scheme can have 128 partitions inside. No good for the 32-bit MS Windows but alright for Linux with Grub2. More details available here (http://www.justlinux.com/forum/showthread.php?threadid=153121).

--- Updated 8 Apr 09, Good news! kernel 2.6.28 and newer have finally decided to support large partitions. A report is here (http://www.justlinux.com/forum/showthread.php?t=152404). I have managed to run a Ubuntu from sda130! Currently I am trying a 1.5 TB hard disk with 60 partitions and will report the progress later. The new kernel 2.6.28 is not universally available in every Linux and many teething troubles will have to overcome before a user can install a large number of operating systems into a hard disk but it is coming this way.

--- Updated 17 Sep 07, A warning added in Post #21 on 63 partitions in a Pata hard disk is no longer supported by Linux kernel newer than 2.6.20-------------------

--- Updated 20 Sep 07, a new nested Grub menu system + added Solaris and BSD systems showned in Post #32, #33 and #34 ----------------

Author's notes - This thread has picked up some interest from the Internet by readers who commented the title without reading its content. For this reason I summarize the information briefly as follow:-

(1) A simple howto procedure, which is applicable from 1 to 300+ systems, is described. (Let me know if there is anything simpler or easier)
(2) One standard Linux boot loader controls all the systems. (indirectly becasue every system has its own original boot loader preserved)
(3) The controlling boot loader is not attached to any operating system (This is my own choice. Grub can be attached to any OS, even in ntfs partition as work around available).
(4) 3 Dos, 5 Windows, 137 Linux (more Linux since added plus one Solaris and 2 BSD) using 3 Pata and 2 Sata hard disks) (The number is limited by the availability of partitions/hard disks)
(5) Every system is booted identically and universally by the same 3 lines of commands. No need to worry what OS it is. (using the exactly the method every Linux boots a Windows but on all other systems)
(6) The 145-system booting menu can be created ahead of the installation of the systems. (I believe this has not been tried before)
(7) A nested Grub menu system is showed (Showned in Post #32 to #34. This probably has not been tried before)

Although not indicated by the thread these points should be obvious to experienced PC users

(a) The described procedure is applicable to any boot loader. (Grub happens to be the easiest while the others may have various limitations or take too long or too much work to achieve the similar goal).
(b) Everything is standard, no new thing invented, no hacking involved and the technology has been there all the time (Anyone can do it. I am just the one who is willing to write about it)
(c) The arrangement makes every system suitable for booting manually, say by a Grub floppy or booted by any other boot loader(Every system is self sufficient with its own boot loader inside the boot sector of the residing partition)

----------------------------------------------------------------------------------------------------------

How to install and boot 145 operating systems in a PC

This is the "howto" I promised to write after this thread (http://www.justlinux.com/forum/showthread.php?threadid=143973).

The 145 systems are:-

3 Dos
5 Windows
137 Linux

I have also installed most of the PC-based BSD and Solaris together with a Darwin x86 too but these systems dislike to co-exist with a large number of other systems so I have to keep them off in another PC until I find a way to tackle the technical issues. (edited : latest arrangement in Post #32, #33 and #34)

There are only 3 steps in this howto.

Step 1 – A simple hardware scheme

An operating system needs to reside in a home. That is a partition to me. I used 2x300Gb Pata disk and 2x200 Sata Disk to set up 152 partitions. I always put one operating system in one partition. As an extended partition of each hard disk has no storage of its own, one data-only partition is needed for my personal data, another data-only partition to house the common boot loader and one Swap partition is needed for all the Linux I ended up losing 7 partitions leaving 145 partitions to house the 145 operating systems.

Step 2 – A simple boot scheme

I put Grub in a data-only partition, created a boot menu to boot all the partitions before any of the operating systems was installed. When a partition is filled the system inside becomes bootable instantly. This scheme is dead simple, technically sound, perfectly applicable is every situation but can be viewed unconventional to some PC users. For those who know nothing about Grub it is just one of the two boot loaders commonly used in Linux. The other one is called Lilo possibly used by less than 40% of the Linux distros at the begining of 2007.

In a nutshell I use this Grub to boot up the boot loader of any of the 145 systems that I choose to use. Afterward it is the duty of the second boot loader that brings up its master.

Step 3 – A simple installation scheme

It is really simple. I just installed each system inside a single partition. For MS systems there is more work as I had to install each as a stand alone system so that it always boot to a “C” drive. I then moved the disks with the MS systems to the final position and edit Grub's menu file to boot it back to a “C” drive status.

My scheme depends every system having a boot loader inside its root partition. This is inherent in every MS systems and other operating systems that rely on booting from a bootable primary partition. For Linux it is an optional choice.


Hardware used

The PC is a self-assembled unit using the cheap components available. Nothing to write home about. Just average for an ordinary PC user say 5 years behind the latest technology as this is all I can afford.

Motherboard : Asrock 939NF4G-SATA2
CPU : AMD 939 64 +3200
Ram :1025Mb
Video : Onboard integrated NV44 graphics DX9.0 VGA
Hard disk 2x300Gb Maxtor 133/Mb/s Pata Diamond Max 10
2x200Gb 150Mb/s Sata-I Maxtor Diamond Maxline III
Sound card : SoundBlaster 5.1
Network card : Generic Realtek 8139 10/100 Entrnet
Keyboard : Generic PS/2 keyboard
Mouse : Generic PS/2 mouse

Essential tools

(1) A bootable Grub floppy or a bootable Grub CD.

(2) A Linux Live CD. Ideally one that has Grub inside.

(3) A Dos 6 or above bootable floppy with fdisk.exe inside

(4) A Win2k or XP installation CD

For the production of the Item (1) above and how to use the rest see the last link of my signature.


Partition tables

Here is the details of the partitioning scheme as output by “fdisk-l” Linux command.
Warning: omitting partitions after #60.
They will be deleted if you save this partition table.

Disk /dev/hda: 300.0 GB, 300090728448 bytes
255 heads, 63 sectors/track, 36483 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hda1 * 1 122 979933+ 16 Hidden FAT16
/dev/hda2 123 244 979965 16 Hidden FAT16
/dev/hda3 245 366 979965 16 Hidden FAT16
/dev/hda4 367 36483 290109802+ 5 Extended
/dev/hda5 367 609 1951866 82 Linux swap
/dev/hda6 610 1217 4883728+ 83 Linux
/dev/hda7 1218 1825 4883728+ 83 Linux
/dev/hda8 1826 2433 4883728+ 83 Linux
/dev/hda9 2434 3041 4883728+ 83 Linux
/dev/hda10 3042 3649 4883728+ 83 Linux
/dev/hda11 3650 4257 4883728+ 83 Linux
/dev/hda12 4258 4865 4883728+ 83 Linux
/dev/hda13 4866 5473 4883728+ 83 Linux
/dev/hda14 5474 6081 4883728+ 83 Linux
/dev/hda15 6082 6689 4883728+ 83 Linux
/dev/hda16 6690 7297 4883728+ 83 Linux
/dev/hda17 7298 7905 4883728+ 83 Linux
/dev/hda18 7906 8513 4883728+ 83 Linux
/dev/hda19 8514 9121 4883728+ 83 Linux
/dev/hda20 9122 9729 4883728+ 83 Linux
/dev/hda21 9730 10337 4883728+ 83 Linux
/dev/hda22 10338 10945 4883728+ 83 Linux
/dev/hda23 10946 11553 4883728+ 83 Linux
/dev/hda24 11554 12161 4883728+ 83 Linux
/dev/hda25 12162 12769 4883728+ 83 Linux
/dev/hda26 12770 13377 4883728+ 83 Linux
/dev/hda27 13378 13985 4883728+ 83 Linux
/dev/hda28 13986 14593 4883728+ 83 Linux
/dev/hda29 14594 15201 4883728+ 83 Linux
/dev/hda30 15202 15809 4883728+ 83 Linux
/dev/hda31 15810 16417 4883728+ 83 Linux
/dev/hda32 16418 17025 4883728+ 83 Linux
/dev/hda33 17026 17633 4883728+ 83 Linux
/dev/hda34 17634 18241 4883728+ 83 Linux
/dev/hda35 18242 18849 4883728+ 83 Linux
/dev/hda36 18850 19457 4883728+ 83 Linux
/dev/hda37 19458 20065 4883728+ 83 Linux
/dev/hda38 20066 20673 4883728+ 83 Linux
/dev/hda39 20674 21281 4883728+ 83 Linux
/dev/hda40 21282 21889 4883728+ 83 Linux
/dev/hda41 21890 22497 4883728+ 83 Linux
/dev/hda42 22498 23105 4883728+ 83 Linux
/dev/hda43 23106 23713 4883728+ 83 Linux
/dev/hda44 23714 24321 4883728+ 83 Linux
/dev/hda45 24322 24929 4883728+ 83 Linux
/dev/hda46 24930 25537 4883728+ 83 Linux
/dev/hda47 25538 26145 4883728+ 83 Linux
/dev/hda48 26146 26753 4883728+ 83 Linux
/dev/hda49 26754 27361 4883728+ 83 Linux
/dev/hda50 27362 27969 4883728+ 83 Linux
/dev/hda51 27970 28577 4883728+ 83 Linux
/dev/hda52 28578 29185 4883728+ 83 Linux
/dev/hda53 29186 29793 4883728+ 83 Linux
/dev/hda54 29794 30401 4883728+ 83 Linux
/dev/hda55 30402 31009 4883728+ 83 Linux
/dev/hda56 31010 31617 4883728+ 83 Linux
/dev/hda57 31618 32833 9767488+ 83 Linux
/dev/hda58 32834 34049 9767488+ 83 Linux
/dev/hda59 34050 34657 4883728+ 83 Linux
/dev/hda60 34658 35265 4883728+ 83 Linux

Disk /dev/hdc: 300.0 GB, 300090728448 bytes
255 heads, 63 sectors/track, 36483 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hdc1 1 122 979933+ 16 Hidden FAT16
/dev/hdc2 123 730 4883760 1c Hidden W95 FAT32 (LBA)
/dev/hdc3 731 3162 19535040 17 Hidden HPFS/NTFS
/dev/hdc4 3163 36483 267650932+ 5 Extended

/dev/hdc5 3163 3770 4883728+ 83 Linux
/dev/hdc6 3771 4378 4883728+ 83 Linux
/dev/hdc7 4379 4986 4883728+ 83 Linux
/dev/hdc8 4987 5594 4883728+ 83 Linux
/dev/hdc9 5595 6202 4883728+ 83 Linux
/dev/hdc10 6203 6810 4883728+ 83 Linux
/dev/hdc11 6811 7418 4883728+ 83 Linux
/dev/hdc12 7419 8026 4883728+ 83 Linux
/dev/hdc13 8027 8634 4883728+ 83 Linux
/dev/hdc14 8635 9242 4883728+ 83 Linux
/dev/hdc15 9243 9850 4883728+ 83 Linux
/dev/hdc16 9851 10458 4883728+ 83 Linux
/dev/hdc17 10459 11066 4883728+ 83 Linux
/dev/hdc18 11067 11674 4883728+ 83 Linux
/dev/hdc19 11675 12282 4883728+ 83 Linux
/dev/hdc20 12283 12890 4883728+ 83 Linux
/dev/hdc21 12891 13498 4883728+ 83 Linux
/dev/hdc22 13499 14106 4883728+ 83 Linux
/dev/hdc23 14107 14714 4883728+ 83 Linux
/dev/hdc24 14715 15322 4883728+ 83 Linux
/dev/hdc25 15323 15930 4883728+ 83 Linux
/dev/hdc26 15931 16538 4883728+ 83 Linux
/dev/hdc27 16539 17146 4883728+ 83 Linux
/dev/hdc28 17147 17754 4883728+ 83 Linux
/dev/hdc29 17755 18362 4883728+ 83 Linux
/dev/hdc30 18363 18970 4883728+ 83 Linux
/dev/hdc31 18971 19578 4883728+ 83 Linux
/dev/hdc32 19579 20186 4883728+ 83 Linux
/dev/hdc33 20187 20794 4883728+ 83 Linux
/dev/hdc34 20795 21402 4883728+ 83 Linux
/dev/hdc35 21403 22010 4883728+ 83 Linux
/dev/hdc36 22011 22618 4883728+ 83 Linux
/dev/hdc37 22619 23226 4883728+ 83 Linux
/dev/hdc38 23227 23834 4883728+ 83 Linux
/dev/hdc39 23835 24442 4883728+ 83 Linux
/dev/hdc40 24443 25050 4883728+ 83 Linux
/dev/hdc41 25051 25658 4883728+ 83 Linux
/dev/hdc42 25659 26266 4883728+ 83 Linux
/dev/hdc43 26267 26874 4883728+ 83 Linux
/dev/hdc44 26875 27482 4883728+ 83 Linux
/dev/hdc45 27483 28090 4883728+ 83 Linux
/dev/hdc46 28091 28698 4883728+ 83 Linux
/dev/hdc47 28699 29306 4883728+ 83 Linux
/dev/hdc48 29307 29914 4883728+ 83 Linux
/dev/hdc49 29915 30522 4883728+ 83 Linux
/dev/hdc50 30523 31130 4883728+ 83 Linux
/dev/hdc51 31131 31738 4883728+ 83 Linux
/dev/hdc52 31739 32346 4883728+ 83 Linux
/dev/hdc53 32347 32954 4883728+ 83 Linux
/dev/hdc54 32955 33562 4883728+ 83 Linux
/dev/hdc55 33563 34170 4883728+ 83 Linux
/dev/hdc56 34171 34778 4883728+ 83 Linux
/dev/hdc57 34779 35386 4883728+ 83 Linux
/dev/hdc58 * 35387 35994 4883728+ 83 Linux
/dev/hdc59 35995 36483 3927861 83 Linux

Disk /dev/sda: 203.9 GB, 203928109056 bytes
255 heads, 63 sectors/track, 24792 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 5099 40957686 7 HPFS/NTFS
/dev/sda2 5100 6315 9767520 83 Linux
/dev/sda3 6316 6923 4883760 83 Linux
/dev/sda4 6924 24792 143532742+ 5 Extended
/dev/sda5 6924 7531 4883728+ 83 Linux
/dev/sda6 7532 8139 4883728+ 83 Linux
/dev/sda7 8140 8747 4883728+ 83 Linux
/dev/sda8 8748 9355 4883728+ 83 Linux
/dev/sda9 9356 9963 4883728+ 83 Linux
/dev/sda10 9964 10571 4883728+ 83 Linux
/dev/sda11 10572 11179 4883728+ a9 NetBSD
/dev/sda12 11180 11787 4883728+ 83 Linux
/dev/sda13 * 11788 12395 4883728+ 83 Linux
/dev/sda14 12396 23916 92542401 c W95 FAT32 (LBA)
/dev/sda15 23917 24792 7036438+ 83 Linux

Disk /dev/sdb: 203.9 GB, 203928109056 bytes
255 heads, 63 sectors/track, 24792 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sdb1 * 1 1216 9767488+ 7 HPFS/NTFS
/dev/sdb2 1217 1338 979965 1b Hidden W95 FAT32
/dev/sdb3 1339 1460 979965 83 Linux
/dev/sdb4 1461 24792 187414290 f W95 Ext'd (LBA)
/dev/sdb5 1461 2676 9767488+ 83 Linux
/dev/sdb6 2677 3892 9767488+ 83 Linux
/dev/sdb7 3893 6324 19535008+ 83 Linux
/dev/sdb8 6325 8756 19535008+ 83 Linux
/dev/sdb9 8757 11188 19535008+ 83 Linux
/dev/sdb10 11189 13620 19535008+ 83 Linux
/dev/sdb11 13621 16052 19535008+ 83 Linux
/dev/sdb12 16053 18484 19535008+ 83 Linux
/dev/sdb13 18485 20916 19535008+ 83 Linux
/dev/sdb14 20917 23348 19535008+ 83 Linux
/dev/sdb15 23349 24792 11598898+ 83 Linux
My hda has partitions hda61, hda62 and hda63 but they are not shown by fdisk program.

Continued with next post

saikee
12-30-2006, 07:02 PM
Here is the Grub menu.lst that boots 145 systems
#Grub menu booting 3 Dos, 5 Windows & 100+ Linux----------------------------
color white/green black/light-gray
title You are now booting from hda3 data-only partition
boot

title DOS 6.22 (FAT16) @ hda1
root (hd0,0)
unhide (hd0,0)
makeactive
chainloader +1

title Win 3.11 @ hda2
root (hd0,1)
hide (hd0,0)
unhide (hd0,1)
makeactive
chainloader +1

#hda3 is the data-only partition hosting Grub to boot all other systems

#hda4 is the extended partition

#hda5 is the common swap partition for all Linux

title Puppy 1.0.6 @ hda6
root (hd0,5)
chainloader +1

title Videolinux 2.0 @ hda7
root (hd0,6)
chainloader +1

title Mandrake 9.2 @ hda8
root (hd0,7)
chainloader +1

title Turbo Linux V7 @ hda9
root (hd0,8)
chainloader +1

title elive 0.3 @ hda10
root (hd0,9)
chainloader +1

title Red Hat 9 @ hda11
root (hd0,10)
chainloader +1

title Lycoris 4 @ hda12
root (hd0,11)
chainloader +1

title Libranet 2.8.1 @ hda13
root (hd0,12)
chainloader +1

title Mandrake 10 @ hda14
root (hd0,13)
chainloader +1

title Debian Woody 3.0 @ hda15
root (hd0,14)
chainloader +1

title Yoper 2.0.0 @ hda16
root (hd0,15)
chainloader +1

title Knoppix 3.6 @ hda17
root (hd0,16)
chainloader +1

title Buffalo 1.5 @ hda18
root (hd0,17)
chainloader +1

title Kanotix 9.2004 @ hda19
root (hd0,18)
chainloader +1

title Kalango 3.2 @ hda20
root (hd0,19)
chainloader +1

title Blag 30001 @ hda21
root (hd0,20)
chainloader +1

title Fedora Core 4 @ hda22
root (hd0,21)
chainloader +1

title Debian Sarge @ hda23
root (hd0,22)
chainloader +1

title Red Flag 4.1 @ hda24
root (hd0,23)
chainloader +1

title Linare Ed 2 @ hda25
root (hd0,24)
chainloader +1

title Tiny Sofa 2.0 @ hda26
root (hd0,25)
chainloader +1

title Slackware 10 @ hda27
root (hd0,26)
chainloader +1

title Xandros 201 @ hda28
root (hd0,27)
chainloader +1

title Vine 3.2 @ hda29
root (hd0,28)
chainloader +1

title Specifix 0.15 @ hda30
root (hd0,29)
chainloader +1

title Ubunto 5.04 @ hda31
root (hd0,30)
chainloader +1

title PCLinuxos 0.91 @ hda32
root (hd0,31)
chainloader +1

title Asian Linux 2.0 @ hda33
root (hd0,32)
chainloader +1

title Ubuntu 6.04 Dapper @ hda34
root (hd0,33)
chainloader +1

title Wolvix 1.0.4 @ hda35
root (hd0,34)
chainloader +1

title Mepis 3.4.2 RC2 @ hda36
root (hd0,35)
chainloader +1

title DreamLinux 1.0 @ hda37
root (hd0,36)
chainloader +1

title Slampp 1.1 @ hda38
root (hd0,37)
chainloader +1

title Slax 5.0.6 @ hda39
root (hd0,38)
chainloader +1

title PCLinuxos 0.92 @ hda40
root (hd0,39)
chainloader +1

title Netsecl 2.0 @ hda41
root (hd0,40)
chainloader +1

title Vector 5.1 @ hda42
root (hd0,41)
chainloader +1

title Suse 10 @ hda43
root (hd0,42)
chainloader +1

title Kororaa 2005 Beta 2 @ hda44
root (hd0,43)
chainloader +1

title smgl 0.95 @ hda45
root (hd0,44)
chainloader +1

title Lunar 1.6 rc3 @ hda46
root (hd0,45)
chainloader +1

title Foresight 0.93 @ hda47
root (hd0,46)
chainloader +1

title SkoleLinux Sarge @ hda48
root (hd0,47)
chainloader +1

title Nepalinux 1.0 @ hda49
root (hd0,48)
chainloader +1

title Klax 3.5 @ hda50
root (hd0,49)
chainloader +1

title SciLinux 2005 @ hda51
root (hd0,50)
chainloader +1

title Progeny 2.0 @ hda52
root (hd0,51)
chainloader +1

title grml 0.6 @ hda53
root (hd0,52)
chainloader +1

title Karamad 1.4.2 @ hda54
root (hd0,53)
chainloader +1

title Whax 3.0 @ hda55
root (hd0,54)
chainloader +1

title Troppix 1.2 @ hda56
root (hd0,55)
chainloader +1

title TopologLinux 6.0 @ hda57
root (hd0,56)
chainloader +1

title Haansoft 2006 WS @ hda58
root (hd0,57)
chainloader +1

title Fedora Core 3 @ hda59
root (hd0,58)
chainloader +1

title ScientificLinux 4.0 @ hda60
root (hd0,59)
chainloader +1

title Slynux 2.0 @ hda61
root (hd0,60)
chainloader +1

title Slax 5.1.8 @ hda62
root (hd0,61)
chainloader +1

title Elive 2 @ hda63
root (hd0,62)
chainloader +1


#Starting point of another hard disk----------------------------

title DOS 7.1 @ hdc1
root (hd1,0)
hide (hd0,0)
hide (hd0,1)
hide (hd0,2)
unhide (hd1,0)
makeactive
map (hd1) (hd0)
map (hd0) (hd1)
chainloader +1

title Win98 @ hdc2
root (hd1,1)
hide (hd0,0)
hide (hd0,1)
hide (hd0,2)
hide (hd1,0)
unhide (hd1,1)
makeactive
map (hd1) (hd0)
map (hd0) (hd1)
chainloader +1

title Vista @ hdc3
root (hd1,2)
hide (hd0,0)
hide (hd0,1)
hide (hd0,2)
hide (hd1,0)
hide (hd1,1)
unhide (hd1,2)
makeactive
map (hd1) (hd0)
map (hd0) (hd1)
chainloader +1

#hdc4 is the extended partition

title B2D Pure KDE 2005 @ hdc5
root (hd1,4)
chainloader +1

title CollegeLInux @ hdc6
root (hd1,5)
chainloader +1

title Berry 0.76 @ hdc7
root (hd1,6)
chainloader +1

title Morphix 0.4 @ hdc8
root (hd1,7)
chainloader +1

title Feather 0.74 @ hdc9
root (hd1,8)
chainloader +1

title Buffalo 1.7.3.9 @ hdc10
root (hd1,9)
chainloader +1

title Cento 4.1 @ hdc11
root (hd1,10)
chainloader +1

title Vector 4.3 @ hdc12
root (hd1,11)
chainloader +1

title Tao Linux 4 @ hdc13
root (hd1,12)
chainloader +1

title Fedora Core 2 @ hdc14
root (hd1,13)
chainloader +1

title Agnula Demudi 1.2 @ hdc15
root (hd1,14)
chainloader +1

title Damn Small Linux 2.1 @ hdc16
root (hd1,15)
chainloader +1

title Monoppix 1.1.8 @ hdc17
root (hd1,16)
chainloader +1

title Sympony A4 beta @ hdc18
root (hd1,17)
chainloader +1

title Pocket Linux 1.2 @ hdc19
root (hd1,18)
chainloader +1

title UltimaLInux 4.0 @ hdc20
root (hd1,19)
chainloader +1

title Vlos 1.2 @ hdc21
root (hd1,20)
chainloader +1

title Tinny Sofa Ceara @ hdc22
root (hd1,21)
chainloader +1

title 64 Studio 0.6 @ hdc23
root (hd1,22)
chainloader +1

title KateOS 2.2 @ hdc24
root (hd1,23)
chainloader +1

title Rubix 1.0 @ hdc25
root (hd1,24)
chainloader +1

title Sam 2006-1 @ hdc26
root (hd1,25)
chainloader +1

title Parsix 0.85 @ hdc27
root (hd1,26)
chainloader +1

title Foxdesktop 1.0 @ hdc28
root (hd1,27)
chainloader +1

title Kanotix 64 2005-4 @ hdc29
root (hd1,28)
chainloader +1

title Pardus 1.0 @ hdc30
root (hd1,29)
chainloader +1

title rPath 0.99.2 @ hdc31
root (hd1,30)
chainloader +1

title Stx 1.0 rc2 @ hdc32
root (hd1,31)
chainloader +1

title Stux 0.9.2 @ hdc33
root (hd1,32)
chainloader +1

title StartCom 4.0.4 Raam @ hdc34
root (hd1,33)
chainloader +1

title Slackware 10.2 @ hdc35
root (hd1,34)
chainloader +1

title Foresight 0.9 @ hdc36
root (hd1,35)
chainloader +1

title Xandros 3.0 @ hdc37
root (hd1,36)
chainloader +1

title Ubuntu 5.10 @ hdc38
root (hd1,37)
chainloader +1

title Kubuntu Dapper @ hdc39
root (hd1,38)
chainloader +1

title Gentoo 2006.1 @ hdc40
root (hd1,39)
chainloader +1

title LinuxTLE 8.0 @ hdc41
root (hd1,40)
chainloader +1

title Underground 2.2 @ hdc42
root (hd1,41)
chainloader +1

title DreamLinux 2.1 @ hdc43
root (hd1,42)
chainloader +1

title Linux Mint 2.1 @ hdc44
root (hd1,43)
chainloader +1

title Pioneer 1125 @ hdc45
root (hd1,44)
chainloader +1

title Ubuntu 7.04 @ hdc46
root (hd1,45)
chainloader +1

title Bayanihan 4 @ hdc47
root (hd1,46)
chainloader +1

title Mandriva 2007 @ hdc48
root (hd1,47)
chainloader +1

title Freespire 1.1.73 @ hdc49
root (hd1,48)
chainloader +1

title Caixa Majica 11 @ hdc50
root (hd1,49)
chainloader +1

title Ehad 2006 classic @ hdc51
root (hd1,50)
chainloader +1

title Vlos 1.3 @ hdc52
root (hd1,51)
chainloader +1

title Backtrack 2006-2 @ hdc53
root (hd1,52)
chainloader +1

title Ubuntu 6.06 @ hdc54
root (hd1,53)
chainloader +1

title Blag 30002 @ hdc55
root (hd1,54)
chainloader +1

title Fedora Core 5 @ hdc56
root (hd1,55)
chainloader +1

title Suse 9.1 Professional @ hdc57
root (hd1,56)
chainloader +1

title Vine 4.0 @ hdc58
root (hd1,57)
chainloader +1

title Wolvix 1.0.5 @ hdc59
root (hd1,58)
chainloader +1

#Starting point of another hard disk----------------------------

title XP Pro @ sda1
root (hd2,0)
hide (hd0,0)
hide (hd0,1)
hide (hd0,2)
hide (hd1,0)
hide (hd1,1)
hide (hd1,2)
unhide (hd2,0)
makeactive
map (hd2) (hd0)
map (hd0) (hd2)
chainloader +1

title Xenoppix 3.03 @ sda2
root (hd2,1)
chainloader +1

title Musix 0.39 @ sda3
root (hd2,2)
chainloader +1

#sda4 is the extended partition

title GeoLivre 5 @ sda5
root (hd2,4)
chainloader +1

title Ututu x2 2005.1 @ sda6
root (hd2,5)
chainloader +1

title Helix 1.7 @ sda7
root (hd2,6)
chainloader +1

title MagicLinux 2 rc2 @ sda8
root (hd2,7)
chainloader +1

title Zenwalk 1.2 @ sda9
root (hd2,8)
chainloader +1

title MedianLinux 4.0 @ sda10
root (hd2,9)
chainloader +1

title NetBSD i386 3.0 @ sda11
root (hd2,10)
chainloader +1

title Arabian 0.6 rc1 @ sda12
root (hd2,11)
chainloader +1

title Mepis 3.3.2 @ sda13
root (hd2,12)
chainloader +1

#sda14 is Fat32 partition holding personal data

title Slamd64 11 @ sda15
root (hd2,14)
chainloader +1

#Starting point of another hard disk----------------------------

title Win 2k @ sdb1
root (hd3,0)
hide (hd0,0)
hide (hd0,1)
hide (hd0,2)
hide (hd1,0)
hide (hd1,1)
hide (hd1,2)
hide (hd2,0)
unhide (hd3,0)
hide (hd3,1)
makeactive
map (hd3) (hd0)
map (hd0) (hd3)
chainloader +1

title FreeDos @ sdb2
root (hd3,1)
hide (hd0,0)
hide (hd0,1)
hide (hd0,2)
hide (hd1,0)
hide (hd1,1)
hide (hd1,2)
hide (hd2,0)
hide (hd3,0)
unhide (hd3,1)
makeactive
map (hd3) (hd0)
map (hd0) (hd3)
chainloader +1

title System Rescue CD 2.1.6 @ sdb3
root (hd3,2)
chainloader +1

#sdb4 is the extended partition

title Xfld 2.0 @ sdb5
root (hd3,4)
chainloader +1

title Kanotix 2006-1 @ sdb6
root (hd3,5)
chainloader +1

title Paipix 5.00 2006-3 @ sdb7
root (hd3,6)
chainloader +1

title Frugalware 0.4 @ sdb8
root (hd3,7)
chainloader +1

title Sabayon x86_64 3.0 @ sdb9
root (hd3,8)
chainloader +1

title Quantian 0.7.9.1 @ sdb10
root (hd3,9)
chainloader +1

title Suse 10.1 x86 64 @ sdb11
root (hd3,10)
chainloader +1

title Slackware 11 @ sdb12
root (hd3,11)
chainloader +1

title Knoppix 4.0.2 @ sdb13
root (hd3,12)
chainloader +1

title Mandriva 2006 0.4 @ sdb14
root (hd3,13)
chainloader +1

title Fedora Core 6 @ sdb15
root (hd3,14)
chainloader +1

I know I know this page is boring unless you are interested in the details. So how about these statistics

No
of
disros Country
2 Argentina
1 Asia
4 Australia
1 Austria
1 Belgium
4 Brazil
1 Bulgaria
5 Canada
3 China
2 Czech
2 Europe
7 France
14 Germany
3 Global
1 Hungary
1 India
2 Iran
1 Ireland
5 Isle of Man
3 Israel
5 Italy
5 Japan
1 Nepal
2 Netherland
1 New Zealand
4 Norway
1 Philippines
2 Poland
2 Portugal
2 Puerto Rico
1 S Korea
1 Sweden
2 Switzerland
1 Syria
1 Taiwan
1 Thailand
1 Turkey
5 UK
44 USA
145 Total

39 countries are contributing the operating systems.

The 3 Dos are Dos 6.22, Dos 7.1 and Freedos.

The 5 Windows are Win 3.11, Win98, Win2k, XP home and Vista

There are 114 unique systems as 17 of then have more two versions, 3 of them have 3 different versions and 2 have 5 versions. For example I have kept Fedora core for ver. 2, 3, 4, 5 and 6.

I only paid for all the MS systems except the free downloadable experimental Vista. All Linux are free downable systems.

A Linux can be freely downloadable from many Internet sites as an iso file that can be burn into a bootable CD. Once the CD booted up a user can follow the instruction to install the system as quickly as 10 to 12 minutes.

Many Linux distros also produce Live CD with which a user can have a full operating system without being installed into a hard disk.

Continued with next post

saikee
12-30-2006, 07:02 PM
Technical details

Hard disk considerations

Most MS systems are designed to reside in a primary partition and there can be a maximum of four of 4 primaries in each hard disk. To get more partition a user “must” give up one primary to turn it into an extended partition. In Linux a Pata (or IDE) disk can have 63 partitions maximum and the limit of a Sata or SCSI disk is 15.

The number of partition plus the whole disk itself make up 64 and 16 devices repeactively.

(Updated note: Since the publication of this thread Linux kernel 2.6.20 and newer have ceased to support Pata disk names and the 63 partitions limit, stated in the blue text above, is no longer supported. Please read Post #21 for further explanation)

Latest 8 Apr 09 - Kernel 2.6.28 and later have decided to breach the maximum 15 partitions per hard disk. The number of partitioins is currently open-ended. This is because the number of logical partition in a hard disk, since Dos era, is also bottomless. However the individual software has not yet been updated to cope with the new changes. The 130+ partitions have not been rejected by MS systems and Linux with the new kernel. More information will be offered later.

An extended partition also consume a device name but cannot be used for storage because it is just the border defining the beginning and the finishing points of the logical partitions.

Linux can be installed and booted from either a primary or a logical partition so it pays to give the primaries to MS systems that dependent on them.

Linux always name the first logical partition as the 5th partition in any hard disk. Therefore theoretically in a Pata disk, say a hda, the maximum usage is hda1, hda2 and hda3 as the primaries, hda4 being the extended partition holding a maximum 59 logical partitions inside (from hda5 to hda63).

In practice some Linux programs stop to display beyond the 60th partition and some distros, like those from the Red Hat family, do not show partitions beyond the 15th, even the distros itself has been installed beyond this limit.

The maximum number of partition one can get out of 2 Pata and 2 Sata is 2*(63+15)= 156. Thus I could have 4 partitions more if I want.

The partitioning scheme

I let the MS systems to have all the primary partitions and Linux are house mainly in logical partitions. One swap, also in a logical partition, to serve all the Linux. For BSD and Solaris systems I use separate hard disks.

As a rule I always install an operating system in a single partition. It is easier to maintain, to boot and to understand. It may not the optimum solution but it works in every Linux I installed.

Here are the partition sizes I allocate to each system

(a) Dos in 1 or 2Gb (primary, type fat16 or fat32)
(b) XP and Vista in 25Gb and 20Gb (primary, type NTFS)
(c) For Win2k I used 15Gb (primary, type NTFS)
(d) For Win98 I used 5Gb (primary, type fat32)
(e) Linux 5Gb (majority) and 10Gb ( say for a few for big distros) (logical, either Ext3 or Reiserfs filing types)
(f) One swap 1 Gb common to all Linux
(g) Personal data 95Gb large fat32

Actual sizes can be seen in the fdisk -l output in Post #1.

I use exclusively one Linux partitioning tool “cfdisk” and use “fdisk” as a second check. Both programs are standard tools in a Linux Live CD. I specify the partition type number of 83, 82, 6, c and 7 for native Linux, swap, fat16, fat32 and ntfs partitions respectively. In using cfdisk for partitioning the partition type is 83 by default and this is recognised by every Linux installer.

I never format the partitions myself as every installer wouldn’t trust me and likes to format its own home.

At a later date I started to use a free partitioning tool called “gparted” which has been branched into “Parted Magic”. They are available as free downable iso files that could burn into a CD.

I believe it is a good strategy to have the partition ready and in the correect partition type so that it is recognised by the system installer. If you you make life easier for the installer. In return it will give musch less trouble.

The mother of all booting schemes - Grub in a data-only partition

This is really my suggestion and is completely unnecessary to a normal Linux user, who can lay his/her hand on the first Grub he/she comes across and make this Grub to do all the things I say below. However my proposal carries the following advantages if taken up

(1) Grub is not attached to any operating system and so it can be used manually as a mini operating system.
(2) Every operating system can be booted indirectly (known as chain loading) using an identical set of commands with only difference in the partition reference. It works for all the operating systems regardless it is a Dos, Windows, Linux, BSD or Solaris.
(2) Every MS system and Linux can control Grub if it is installed in a partition, say type fat16 or fa32, which every system can read, write and alter its boot menu.
(3) Grub is the only boot loader that can be arranged to boot a partition even before its is created, formatted and installed with an operating system. That has to be the coolest thing in booting.
(4) The data-only partition, where Grub resides, has no operating system inside but can be booted by any Linux. Any Dos or Windows MBR can also boot this Grub if it is housed in a “primary” partition with the bootable flag set active.

It should be understood that I propose to install Grub “WITHOUT” being attached to any operating system! Grub cannot read a ntfs filing system so it should be installed into a fat16 or fat32 partition. I put it in the 3nd partition of my 1st Pata disk. In Linux it is known as hda3, as my 1st, 2nd, 3rd and 4th disks are hda, hdc, sda and sdb respectively.

To install Grub into a data-only partition involving the following steps

(A) Format the data partition first say in fat16 format. Best way is boot up a Linux Live CD, click terminal mode and issue the command for formatting a partition hda3 in fat16
mkdosfs –F16 /dev/hda3
Alternatively the partition can be formatted by a Dos floppy, downloadable from Bootdisk.com, in a Dos command prompt with command
format c:/, assuming any partition before hda3 is non-Dos or hidden.

The use of Fat16 is deliberate because with such a filing system a Dos cannot address hard disk beyond 2Gb, cannot recognise a Sata but we can still use Grub there to boot 145 systems in the PC.

(B) The next task is to get hold of 3 files Grub needs for installation. They are called stage1, stage1.5 and stage2, which are held together in a directory, and are available in any Linux Live CD that supports Grub. So just boot up a Live CD and ask Linux to report to you their position by command
find / -name stage1
you will find these files are typically held in the following directories

Red Hat, Fedora C2 to C6
/usr/share/grub/x86_64-redhat/stage1
/usr/share/grub/i386-redhat/stage1

Mandriva
/lib/grub/i386-mandriva/stage1

Mandrake
/usr/local/lib/grub/i386-pc/stage1
/usr/lib/grub/i386-pc/stage1


Suse
/usr/lib/grub/i386-suse/stage1

Gentoo, Knoppix, Mepis, Xubuntu, Ubuntu, Kubuntu, Debian
/lib/grub/i386-pc/stage1


Frugalware, Kanotix
/usr/lib/grub/i386-pc/stage1

Next stage is to create a temporary directory in the directory /mnt of the boot-up Live CD Linux, mount the data-only hda3 partition, create /boot/grub directory inside it, copy all the Grub’s stage1, stage1.5 and stage2 files into it, invoke a Grub shell, setup Grub in the MBR and exit. Using Ubuntu CD as an example the commands would be
mkdir /mnt/hda3
mount /dev/hda3 /mnt/hda3
mkdir /mnt/hda3/boot
mkdir /mnt/hda3/boot/grub
cp /lib/grub/i386-pc/* /mnt/hda3/boot/grub
grub
root (hd0,2)
setup (hd0)
quit
On a reboot the hda3 will be booted to a Grub prompt and nothing else. This indicates Grub is now in charge of the MBR, linked to partition hda3 and is controllable by the configurator file always named “menu.lst” if there is one in the /boot/grub or /boot directory of hda3. When Grub can't find it it defaults to a Grub prompt.

Note some versions of Grub, especially in the Red Hat family, can be modified to read "Grub.conf" instead.

Although the Grub Manual does not claim it but it is in my experience no PC operating system cannot be booted by a Grub prompt. It doesn’t look much at the first sight but there is seldom something so simple can be so powerful.

(C) Now is the time to write a menu to boot 145 systems. It is just a text file must named menu.lst to be stored in the subdirectory /boot/grub. Grub boots each system iy 3 lines as follow:-

A “title” statement to display the name of the system in the screen. Any ttext after the word "title" is displayed and has consequence to the booting except to remind you what the system is.

A “root” statement specifies the root of the operating system. This means the partition the target system residing. Grub counts everything from 0 so to boot a system at the 9th partition of the 2nd disk is “root (hd1,8)”. Similarly (hd0,0) mean the 1st partition of the 1st disk.

A “chainloader” statement which always ends with “+1”.

So you see there is nothing to it. Even a simpleton like me can cope with this.

Being lazy I wrote a small program to generate the booting menu because it is just doing 4 loops, each loop per hard disk in my case.

Therefore my menu.lst initially will look like this
title Empty @ hda1
chainloader (hd0,0)+1

title Empty @ hda2
chainloader (hd0,1)+1

title Empty @ hda3
chainloader (hd0,2)+1

title Empty @ hda4
chainloader (hd0,3)+1

and so on

The menu is edited whenever I wish to update it with the name of the operating system replacing the word “Empty”. Life could be so simple except the MS systems which needs extra work. That I shall go into later.

The simplified installation scheme

Linux is easy to install so I describe it first.

Linux rarely need to defrag its filing system because it makes use of a scratch area call swap. Thus a swap partition is needed for the first Linux system. Thereafter all the other Linux will proceed to use it without saying a thank you. There is nothing needed done except to create it using the Linux cfdisk program, to the size about twice the physical memory, and select it partition type as 82. Every Linux installer will know how to use it. Some insist on checking it, others ask you for permission to format it and many don’t even tell you what they do with it. I create one in partition hda5 so whenever an installer asks for it I just respond with “hda5”.

In the installation of every Linux we can “instruct” the installer to place Linux in any partition we want. This is done by nominating a single partition to mount the root or “/” of the Linux. If no more than one partition is given to an installer it will place a Linux's directories of /boot, /home, /usr…..as subdirectories to "/" inside the single partition, stacking them back to back so that you only need to worry only if the accummulative content starts to excced the overall partition capacity.

The choice of the boot loader, usually either Lilo or Grub, is immaterial to the proposed scheme.

When it comes to the location of the boot loader it is another matter. Every Linux installer would let the boot loader installed either in (a) the MBR or (b) the root partition of the Linux being installed. My proposed scheme “ONLY” works if the latter is chosen. Some naughty Linux could omit giving you a choice and steals the MBR position. You could also having tea and press the wrong button to lose the MBR. In such a case you can claim the original MBR back again by booting up the Live CD (with Grub inside), click terminal and fire these commands to restore Grub
root (hd0,2)
Setup (hd0)
which literally asking Grub to “source” the necessary file from the specified root and install itself in the whole of disk (hd0) and that could only be the MBR.

A word of caution on Linux’s ability to be installed/booted at high-number partitions or beyond 137Gb barrier in a hard disk

The systems that I arranged can all be booted as per menu.lst. Some older distros will have difficulties to recognise partitions higher than 16, not anticipating device names for high-number partitions and can’t access beyond 137 Gb in the hard disk. These distros have to be installed at the lower-number partitions and inside the first 137Gb of the hard disk. If you find a distro refuses to boot or install take a look at my menu.lst and check the partition position it is known to work.

Dos and Windows systems

There are many ways to install MS systems. For simplicity, ease of control and maintenance I recommend each system to be installed in a “C” drive as a stand-alone independent system. This is to say no dual booting among the MS systems by NTLDR. I have a mobile rack system so I can pull out all the other hard disks and leave only one to install a MS system. Thus every MS system in my case was installed as the first bootable disk. Once installed I do not change its partition position but can put hard disk in other positions. Grub has a facility to re-map the hard disk order on-the-fly and gives back the first bootable disk status to a MS system.

To install a MS system in a “C” drive means there should be no partition recognised by the installer except the partition for installation so it can rightfully claim the first partition status. If there is a partition the MS can recognised, say a Dos partition, then this can be overcome by hiding it, using the Live CD again. If one wants to hide the first disk’s 1st partition, unhide the 2nd partition and make it bootable for a MS system the command in Grub prompt are
hide (hd0,0)
Unhide (hd0,1)
Makeactive

Hiding a partition in a PC doesn’t physically hide the partition away. It just alters its partition type number. Normally a digit “1” is added. Thus if a fat32 and ntfs partition with type c and 7 will become invisible to a MS system when the type number is altered to 1c and 17 respectively. To unhide it is to strip off the digit “1”. It is the oldest trick in a PC, invented at the time Dos was the de facto operating system, to allow a user to bootmore than one operating system.

A MS system may need its own MBR for an installation. It has come to my notice that the MS systems share a common MBR. This MBR's function is to search each of the 4 primary partitions and load the one with the booting flag switched on.

As an example these are brief steps of how I installed Windows Vista in hdc3

Removed disk hda, sda and sdb disks and slide hdc into the rack previously occupied by hda. The original hdc3 partition is know as (hd0,2) to Grub.

Boot up a Dos floppy and restore the MS MBR into the hard disk by command
fdisk /mbr

Boot up a Grub floppy and hide the first two partitions and then check disk geometry
hide (hd0,0)
Hide (hd0,1)
Geometry (hd0)The geometry command is to check everything is in order before installation. Hda3 should have already been created with sufficient space in type 7 for ntfs filing system.

Install Windows Vista and select the 3rd partition for its home.

Check Vista working satisfactory on a reboot after installation.

Power down the PC, add the hard disk that is intended for the permanent home for the Vista, say this is a slave drive called hdc already has in the third primary position a partition with identical size as hda3, insert a Live CD, boot up the system and clone the Vista system across by root terminal command
dd if=/dev/hda3 of=/dev/hdc3 bs=32768

I then power down again, restore all the hard disk, boot up a Live CD again and use it to amend the /boot/grub/menu.lst in hda3 with the following entries for booting hdc3 partition
title Vista @ hdc3
root (hd1,2)
hide (hd0,0)
hide (hd0,1)
hide (hd0,2)
hide (hd1,0)
hide (hd1,1)
unhide (hd1,2)
makeactive
map (hd1) (hd0)
map (hd0) (hd1)
chainloader +1
The two map statement instructed Grub to swap the (hd0) and (hd1) position so that when Vista boots it will find itself still in the first bootable disk as per the original installation. The 5 hide statements are necessary to hide the 5 Dos and Windows partitions which if Vista picks up can upset its “C” drive status.

I used the same principle on every other MS systems and managed to get 3 Versions of Dos and 5 versions of Windows in the same PC. More MS systems can be accommodated but these are all I got.


Ending notes

My original intention was to learn Linux, understand how it work and be able to boot it. It was a huge surprise to see how easy and logical in a Linux world. It almost seems everything I could not understand how a computer works, after all these years with MS systems, suddenly become comprehensible in Linux when the inner working of the system is a published public knowledge.

People can say anything they like about Linux but my 2.5 years with it has taught me using one of the oldest partition (fat16) to house an obsolete boot loader (as the Grub described here is known as the Grub legacy that the GNU/Grub maintainers had already declared cesation of support to move their effort to the new Grub 2 at the time I started Linux) to boot the 145 operating systems I can access. The scheme is laughingly simple.

I am hugely indebted to many GNU/Linux volunteers who unselfishly maintain and develop the open source software. I come to know some of them could risk litigations from the money-grabbing corporation because their effort has reduced our dependency on the commercial software.

From the 2.5 years into Linux I witnessed a huge leap in functionalties and user-friendliness in Linux. I am also inspired by so many nations contributing efforts in bringing this operating system to the public. Many of their distros are technically outstanding.

saikee
12-30-2006, 07:06 PM
Explanatory notes of the booting scheme.

(1) Under the normal circumstance a Linux user can take the first Grub available from any distro and uses its menu.lst for booting all the remaining 144 systems.

(2) Standard Grub implementation uses menu.lst as the menu file stored either in /boot or /boot/grub directory. A very small number of distros especially those belonging to the Red Hat family make a symbolic link to Grub.conf. I have only come across one or two distros that has no menu.lst and use Grub.conf exclusively.

(3) The simple Grub booting scheme makes any operating system instantly bootable on completion of its installation, as long as a boot has been implanted inside the root partition. Some earlier distros like Suse and Debian operate a two-stage installation when a reboot is needed to complete an install. This installation method does not affect the proposed booting scheme. Just boot the required partition after the first stage and the installer will finish the remainder of the procedure.

(4) The proposed booting scheme is a good demonstration of how booting works in general and Grub in particular.


(5) It is not possible to use NTLDR, a boot loader used for the NT Windows like Win2k and XP, to boot the number of Dos and Windows in my list, let alone the number of Linux involved as Windows boot,ini has a static screen for a maximum of 10 entries. I haven’t tried and so cannot comment on Vista’s new boot loader which I understand is different to NTLDR.

(6) It is also technically impossible to employ Lilo for such a booting scheme because (a) Lilo checks every booting entry and refuses implementation if it is not a valid bootable partition so no hope for Lilo to accept an empty partition for booting. (b) Lilo also uses a static booting screen permitting a maximum of 27 images. Thus if one wants to boot a large number of systems Grub is the only choice.

(7) Grub have different characteristics according the version releases. It is advisable to implement the latest Version 0.97 for the booting scheme. Grub can fail if you ask a lower version to “chainload” a later version.

(8) Grub is most robust boot loader when being used in the proposed simple booting scheme. This is because the booting process is totally independent of any system including the Linux kernel. Once Grub is built inside a Linux, say when being called up as a Grub shell in Bash terminal, it would suffer the deficiencies whatever the kernel might bring. As an example before a Linux is booted Grub can see all the partition devices obtainable from the Bios. However when an old Linux is booted its kernel may not anticipate high-number partitions, would not load all the devices and so that leaves Grub with no access to the high-number Bios-drives. Thus a user wishing to restore Grub inside a high-number partition of say hda60 this Linux command may fail
grub-install /dev/hda60
Whereas booting up Grub from a floppy the same task would invariably yield success by commands
root (hd0,59)
setup (hd0,59)


(9) The booting scheme as proposed can be executed by a floppy.

(10) Like a Dos Grub currently suffers from the inability to recognise a USB device and I am not aware any Grub has been able to boot from a USB device. Remember when Grub is loaded it does not have access to a kernel and as such it cannot detect removable devices without substantially increasing its code. The computer code for Grub is apparently among the biggest by the boot loader standard.

(10) If for any reason the boot loader is faulty or improperly installed in the root partition it can be restored with reference to this link. (http://www.justlinux.com/forum/showthread.php?t=144294) An installer has probably more bugs than the operating system itself.

Explanatory notes of the installation scheme.

(a) One of the problems of installing a large number of distros in the same hard disk can surprise some Linux as their installers can go to pieces. This is especially true for older distros that seem to have a limit on the device names . For example many has partition name stop at hda20 or hda24 or hda32.

(b) It is possible in extreme cases to install a Linux on a separate disk with no more than 15 partitions ( because Linux supports SCSI/Sata which has a maximum 15 partition) and migrate it to the final position in another hard disk, using Linux's "dd" or "tar" command. However the partition reference should be updated in the boot loader configuration file, which is either menu.lst or lilo.conf, and the system file /etc/fstab. To get a Linux to expand it /dev list check this thread (http://www.justlinux.com/forum/showthread.php?threadid=147954) and follow the advice by Exodus2001 and bwkaz.

zheepeez
09-14-2007, 03:07 AM
I registered a membership at this forum for the sole purpose of asking...


why?

saikee
09-14-2007, 03:33 AM
zheepeez,

Welcome to Justlinux.

This thread is to show how booting is laughingly simple in Linux.

It also demonstrates that Grub can boot all of them identically with the same commands regarless the type of the operating system. Grub can do this without the need of being installed inside an operating system, although for most users it is simpler just to use Grub available from any Linux or Solaris.

As part of the same system I also have some BSD and Solaris booted but have not included them because the arrangement is slightly complicated as I have to nest several Grub menus and hide the whole extended partitions to avoid complaints by the Linux systems.

This thread is a bit dated now that Linux has stopped to use Pata disk device names and so the 63 partitions in a Pata disk is no longer supported by the kernel newer than 2.6.20. All SCSI/Sata/Pata/USB disks can only have 15 partitions and special arrangement is needed to get 44 partitions out of a hard disk. One can go with LVM but that may not be friendly to non-Linux systems.

The current thread is sort of "Howto" as answers to questions raised in a thread posted 12 months earlier describing a Grub menu booting 100+ systems. The earlier thread has generated some interest in the Internet and forced me to find a simple way to explain how to install and boot a large number of systems. I eventually decided the minimum amount of work for me to by explaining operating system is booted by chainloading. Thus I can show that a Grub menu can be written first even before installing any of the 145 systems.

Since nearly all Linux, BSD and some Solaris are free there is a trend of increasing number of Linux users booting more than one system. I hope my thread can allay fear of handling multiple systems.

JustLinux has this "How I did it" subforum allowing me to post the above information. I started learning Linux here on the date I joined Justlinux in June 2004. The moderators and member stook me by the hand to boot 4 systems after the first month. I see myself as a live example of how a beginner can learn Linux with help from a forum.

There may be things difficult in Linux but I don't think booting is one of them.

chinhnt2k3
09-14-2007, 11:25 AM
It's cool man!
Would be great if you can show off some pics :D
Or better make some videos and YouTube :D
You'll be a penguin hero in no time!

saikee
09-14-2007, 01:08 PM
chinhnt2k3,

Welcome to JustLinux.

I am merely documenting the steps. I think the partition tables and the Grub menu.lst are sufficient to define my systems.

I started to learn Linux on the day I joined Justlinux and have written a few threads. These threads document that as an absolute beginner I learned from JustLinux to multiboot 4 systems in 19 days, 19 systems in 60 days, 30 systems in 129 days and 100+ systems in 550 days. The current thread is to document the simplest way a user can multiboot a modest number of systems. I am just passing/summarizing the knowledge people in Justlinux have taught me.

Kaliatri
09-14-2007, 07:17 PM
Holy mackarel you're an OS god!

saikee
09-14-2007, 07:24 PM
Kaliatri,

Welcome to JustLinux.

Kaliatri
09-14-2007, 07:28 PM
Thanks, I came here from Digg - that's amazing, although sorta pointless, but still amazing.

saikee
09-14-2007, 07:56 PM
There are a couple of uncommon features, which are useful to demonstrate how Grub works, in the thread

The boot loader Grub can be arranged first to boot all 145 systems before any of them is installed.

Every system is booted identically by the same 3 lines of Grub commands regardless it is a Dos, Windows and Linux (also BSD and Solaris, although not shown but are in the PC).

Grub in the MBR was installed in a data-only partition which has no operating system inside.

Otherwise everything is standard, no hacking, just arrange the systems the way they would behave normally.

alpha754293
09-14-2007, 08:28 PM
I came here from Digg as well. Interesting. You left out the UNIX flavors though. :(

Albeit you could have accomplished the task probably a heck of a lot easier using virtualization (if say...you want to develop cross-platform software, and retaining legacy code/kernel for compatibilty checks), or perhaps on a Sun workstation with a PC-on-a-card as an add-on. (Although you probably won't be able to run Vista on it, but I don't think too many people would miss it if they're running 145 distros of Linux).

saikee
09-15-2007, 06:20 AM
alpha754293,

Welcome to Justlinux.

The XP in the above 145 systems has VMware and a couple of LInux as guest systems inside.

VMware, or at least my free version, is a disappointment because it must assign a portion of the ram to run each each guest system making the every system terribly slow. The Linux in such a case is also boxed in a virtual partition and cannot communicate with the outside except to the host. In other word I haven't been able to mount it between the guest systems. The guest also has no boot loader of its own as it is not booted. Not all guest systems can be installed because their installers may not have been written with residing in a virtual machine in mind. The VMware document does not recommend more than 4 guests because by that time each system has about only 1/4 of the usable ram. VMware does not recommend more than 4 systems to be run at any one time, though this may be partly compensated by keep adding ram until the limit in the mobo is breached. So yes I tried virtual machine layer too but not impressed by it.

The above 145 systems can access each other's data if the relevant partition is mounted. One Linux can access the Bash shell of another by using "chroot" and in some cases can operate another X-windows too. I have not investigated in this area but it appears one Linux may "chroot" about 3 other fellow systems to run their Desktop simultaneously, though not always successfully.

Unix-like systems use BSD-subparts and sub-slices which are detected as logical partitions by Linux. This conflict makes BSD and Solaris systems objectionable to Linux systems. Also some Unix systems cannot accept 63 partitions in a Pata hard disk and will not installed (same for Linux with kernel newer than 2.6.20). Systems like FreeBSD can be installed if there is no hard disk with such a large number of partition but will refuse to boot as soon as such a hard disk is inserted.

I have actually developed a way to run Unix-like systems and operate them in the PC with 145 systems which has since had another 23 systems added and an extra Pata disk introduced. I have intended to published this technique which has been used in this thread. (http://www.justlinux.com/forum/showthread.php?t=149956) showing how to hide the entire extended partition and nest a series of Grub menus.

in answering some of the questions people raised on my thread on a Grub menu booting 100+ systems published Dec 2005 I wrote the current thread showing the simplest and easiest way to installed and boot a large number of OSs, In so doing I had to migrate the original 100+ systems to another PC, tried different methods and then documented the simplest way to install and boot them while the number of systems increased over a period of 12 months.

The current thread was published in the Justlinux forum in Dec2006 and is already 9 months ago today! Readers in Digg mistaken it as a current "claim" on the number of systems but it is really about "one of the the easiest and simplest ways to install a large number of operating systems".

I am running 3 PC using a KVM switch which allows me to access different operating systems both physically and virtually (the latter by running XP with VMware). A virtual machine operates by physically grabbing a portion of the system memory so both the host and guest suffer the performance losses. I find such system response is no match to running it in an old PC hooked up by a KVM. Virtual machine management layer has its place but in my limited experience it does not appear to be the universal cure.

The method described by the current thread works equally well for just 1 system or another additional 200 systems. The 145 is just an example!

alpha754293
09-15-2007, 09:43 AM
I didn't know that you were trying to concurrently boot into the various distros.

Although I would agree with you that unless you have a centralized, off-host (SAN/NAS/separate file server) that you wouldn't be able to see/utilize data across platforms.

I haven't used VMWare in probably at least 3 years or so, and there's supposed to be a lot of improvements to it since then. I haven't gotten around to testing them though.

I wasn't particularly impressed with VMWare back then because of the dog slow performance. I suppose that it would work great for enterprise computing where RAM is made more widely available.

I also know that in the latest release of Solaris, there is a way to run Linux natively within Solaris via Solaris Containers for Linux. Unfortunately, this is still limited to 32-bit Linux applications and I have not tested this either to find out what its nuiances are and the performance differences between an native Linux distro on the host system as a separate install.

On the PC-on-a-card though (like the Sun PCi II Co-processor card), with the possible exception of Vista, and the 64-bit OSes, you can also switch between each fully isolated distro, and again with a shared data pool, treated as an external file server (I haven't figured out how to make it talk to a data pool contained on the host system without having to route through the network) by changing the hard drive image to boot the co-processor card to.

I'm currently controlling 6 PCs via KVM, 7th via a separate attachment to my monitor (13W3), mouse and keyboard (Sun Type 5). 8th and 9th are offline. 10th is arriving within the week. And two separate laptops.

4 are file servers (1 offline, 8th), 1 is a compute node (only), 1 "normal use/daily use", 2 workstations, 1 general server (9th), 1 more fileserver incoming (10th), with a total of 30 (or so) processors total, 60 hard drives, 80 GFLOPS of total computing power.

saikee
09-15-2007, 10:48 AM
alpha754293,

Looks like you are in a hardware paradise with 30 processors. I get confused when starting to work on the 3rd system.

The Solaris Container for Linux, is it a open source?

chinabiue
09-15-2007, 12:38 PM
You are my idol! :eek:

clw54
09-15-2007, 01:18 PM
After reading this, I've learned enough to try Grub next time instead of Lilo. I've been using Lilo out of habit all this time. Thanks for this thread, saikee.

saikee
09-15-2007, 01:19 PM
chinabiue

Welcome to JustLinux.

--------------------------------------------------------------

clw54

Lilo is about 2 to 3 times harder than Grub to deploy. Operational wise there is little to choose between the two. Grub does have the following advantages over Lilo.

(1) Lilo needs a revalidation every time its /etc/lilo.conf is amended. Grub never needs such attention.

(2) Lilo checks every partition it is asked to boot and refuses to implement it if there is an error. Grub is totally different. The above thread shows that none of the operating systems needs to be installed before Grub's menu.lst is written out.

(3) Lilo is "Linux Loader". As such it cannot survive outside Linux. Grub can be installed without any operating system attached to it.

(4) Lilo works only after a Linux has been booted. Grub can operate as a mini operating system before any operating system is booted and hence can be used to boot any system manually.

(5) Lilo uses a static screen which has space for just 27 entries. Grub uses a scrolling screen and the sky is the limit as far as the number of booting entries is concerned.

(6) To restore Lilo one has to use another Linux to change root to the original Linux to access its Bash shell, although using a different Bash shell is also possible. Grub can be restored by a Grub prompt without booting up an operating system. Thus one can restore Grub for several distros in one operation regardless the location of the distros which could be in any internal or external disk or even USB device.

(7) Lilo works only on hard disks but Grub has component (stage2_eltorito) for booting from a CDrom too. Grub is equally at home booting USB thumb drives.

Lilo does have the advantage of being a lot smaller and able to fit into the boot sector. Thus if one nuke the Linux Lilo can be still operational from the boot sector for booting other systems. Grub is very big and nuking the Linux will cripple Grub.

I have seriously considered to write an alternative Lilo booting menu system for the above 145 systems as I am pretty sure we can do relays with any boot loaders. This is to say menu1 boots the first 27 images with the 27th Linux opens up another 27 images and so on. The work will be at least 50 times more than using one Grub. Thus I did NOT think the effort worth to pursue.

alpha754293
09-15-2007, 07:33 PM
alpha754293,

Looks like you are in a hardware paradise with 30 processors. I get confused when starting to work on the 3rd system.

The Solaris Container for Linux, is it a open source?

Uh.....I could always use more processors/systems. :D

Whether power, cooling, space, (and finances) will support it is a whole 'nother question.

Solaris Containers for Linux IS an open source project (via OpenSolaris.org) http://www.opensolaris.org/os/community/brandz/.

It has been officially rolled into the "mainstream" Solaris (the part open-part closed source Solaris now) although more and more stuff is being rolled in from the OpenSolaris initiative.

I don't think of it as proprietary/non-proprietary - but more along the lines of OpenSolaris and Solaris Express are like beta Solarises (and they'd constantly be in beta stage for various projects), while the official releases are the stable builds, and rolled in with the rest of the OS/installer, which makes it easy for non-programmers like me to use/install/configure, etc.

It isn't "bad". With regards to Linux, it probably (still, almost certainly) has it's limitations. For Apache, MySQL, PHP (AMP), it's supposed to be great. I don't know, I've only used it for Apache and Samba (SMB) before (still using it for SMB and as my giant file servers with ZFS). (Even then, ZFS has it's own quirks). Ultimately, it depends on what you use it for I guess. To each their own.

saikee
09-17-2007, 06:04 AM
----An update 17 Sep 2007 ----

Warning

Since Feb 2007 Linux kernel 2.6.20 and later have incorporated the Pata disk names into the SCSI/Sata/USB disk family and so in future Pata disks will all be called sda, sdb, sdc... etc. This makes a Pata disk incapable of having more than 15 partitions.

The current thread was written in Dec 2006 when the kernel version was 2.6.18 and 63 partitions in a Pata disk were supported. With the new kernels a hard disk with more than 15 partitions could be ignored by Linux and may be treated as a raw disk. Some new kernels still support Pata names but the trend is to go with the SCSI/Sata/USB convention controlled by the libATA driver.

The implication is unless you use a set of old distros that have kernels older than 2.6.20, you may now need a lot more hard disks to repeat what I have done in this thread, because I could use 63 partitions in a Pata disk then but not now.

However I have been working on a method to get as many partition out of a hard disk and 44 partitions out of a SCSI/Sata/Pata/USB disk is technically possible. I have reported it in this thread (http://www.justlinux.com/forum/showthread.php?t=149956). The other alternative is to use a LVM to accomondate the large number of Linux. I am currently runing satisfactorily a 44-partition Sata nearly filled with Linux.

The 44-partition thread also shows how to "nest" a group of Grub menus together. Thus BSD and Solaris can be booted together with Dos, Windows and Linux in the same PC. If there is any conflict just use the Grub menus to hide the partitions that causes problems before booting up the chosen distro. One can hide the entire extended partition in the same way of hiding a logical or primary partition. I have summarized a few tips of partition hiding in this thread. (http://www.justlinux.com/forum/showthread.php?t=149828&highlight=hidden)

The latest Grub menu system of this thread has been posted in Post #32 to #34 where Solaris and BSD systems have since been included.

alpha754293
09-17-2007, 06:17 AM
----An update 17 Sep 2007 ----

Warning

Since Feb 2007 Linux kernel 2.6.20 and later have incorporated the Pata disk names into the SCSI/Sata/USB disk family and so in future Pata disks will all be called sda, sdb, sdc... etc. This makes a Pata disk incapable of having more than 15 partitions.

The current thread was written in Dec 2006 when the kernel version was 2.6.18 and 63 partitions in a Pata disk were supported. With the new kernels a hard disk with more than 15 partitions could be ignored by Linux and may be treated as a raw disk. Some new kernels still support Pata names but the trend is to go with SCSI/Sata/USB convention.

The implication is unless you use a set of old distros that have kernels older than 2.6.20, you may now need a lot more hard disks to repeat what I have done in this thread, because I could use 63 partitions in a Pata disk then but not now.

However I have been working on a method to get as many partition out of a hard disk and 44 partitions out of a SCSI/Sata/Pata/USB disk is technically possible. I have reported it in this thread (http://www.justlinux.com/forum/showthread.php?t=149956). The other alternative is to use a LVM to accomondate the large number of Linux. I am currently runing satisfactorily a 44-partition Sata nearly filled with Linux.

The 44-partition thread also shows how to "nest" a group of Grub menus together. Thus BSD and Solaris can be booted together with Dos, Windows and Linux in the same PC. If there is any conflict just use the Grub menus to hide the partitions that causes problems before booting up the chosen distro. One can hide the entire extended partition in the same way of hiding a logical or primary partition. I have summarized a few tips of partition hiding in this thread. (http://www.justlinux.com/forum/showthread.php?t=149828&highlight=hidden)

Question: MUST the individual Linux installs be on separate partitions?

For example, is it possible to clump all Linuxes that work/run on ext3 into one giant ext3 partition, and only separate the boot information/files by moving them into different directories?

i.e.
Fedora Core 2
/boot/FC2

Fedora Core 3
/boot/FC3

??? Just thinking out loud...

If it works, it would eliminate the need for LVM, and the OSes would be grouped by fstype.

saikee
09-17-2007, 07:09 AM
As far as Grub is concerned there are two hard disk addresses needed to boot a Linux. One is in the "root" statement to find the Linux kernel. The other one is for the kernel to find the root filing system. The latter is a kernel parameter to be passed during boot time.

The basic deal is Grub load the kernel with the first hard disk address and buggers off.

The loaded kernel will then fetch files according to the specified root location. The syntax of the latter is "root=/dev/sda?". Therefore it is always a device name and not a folder name. This does not get changed if the partition is identified by the by-label or by-uuid method.

Therefore I don't think storing several Linux in a same device or partition is acceptable to the Linux boot loader because Lilo also use the similar "root=" statement for a device.

At a working level, say if one does manage to put several Linux into the same root filing system the structure of Linux will prohibit mixing of system pararmeters with another distro. In fact if a Linux user re-installs the newer version of the same distro over an existing filing system there is a risk the kernel panics over some parameters not properly updated. Therefore adding additional different Linux to the same root filing system would be inadvisble even if it is technically possible.

Furthermore sharing even the same /home directory over several Linux is a difficult feat because different ways the different distros use the common programs and storing their own different settings.

I have avoided the LVM up to now because I could see extra maintenance work but little if any real benefit. May be I should exhaust this option. I know for a fact that we can't house non-Linux systems inside and managing different kernel and initrd files is going to be pig's job in one per /boot.

In the 145 systems above one does have the benefit of keeping the kernel, initrd and boot loader intact for each system in the location arranged by the original installer. The availablity of 145 boot loaders and how they were arranged taught me how I can simplify and standardise every system with Grub.

Putting one system in one partition is "a lot" easier to control, to boot, to mount, to remove, to maintain, to resize and ultimately to migrate.

alpha754293
09-17-2007, 07:13 AM
Good point. I'm probably worse off than you are because I prefer to separate different OSes at the BIOS level. There'd be no way that I'd be able to convince my BIOS to take 145 (different) installations.

Luckily, I don't use more than 2 on any given system.

saikee
09-17-2007, 07:44 AM
As a joke often after solving a problem and receiving thanks I would ask the Linux user to chop his/her hand and send it to me after he/she got into the trouble by fiddling with the booting queue in the Bios. I would tell him I have collected enough meat to open a sauage factory.

Both Lilo and Grub can alter the Bios setting "on-the-fly" during the booting process and to me that is a boot loader's job. Example of Grub and Lilo using "map" statement for this purpose are showed in Section A here (http://www.justlinux.com/forum/showthread.php?s=&threadid=130715).

In the 3 Dos and 5 Winodws I run in the 145 systems I always installed each MS system on its own into a "C" drive and moved the disk to the final position by using Grub to "re-map" its original installed booting position. To keep one MS system interfering with another I hide all MS systems ahead of the booting queue to the one I wish to boot.

I truly believe fiddling with the Bios for the purpose of booting is a worst respect a Linux user can show to a Linux boot loader because it is a lack of truct of what a Linux boot loader is made for.

alpha754293
09-17-2007, 08:40 AM
However, the idea behind using the BIOS to control the boot order also means that the installations are completely independent of each other. Therefore, even if LILO or GRUB fails (and/or the hard drive with the LILO/GRUB dies), it does not prevent the other OS (on a physically separate drive) from booting, espectially if told to do so via the BIOS.

Also as far as I know, most Linux distros cannot write to NTFS partitions, which is almost a requirement for partitions > 32 GB (IIRC). (My smallest NTFS partition (on a boot drive) is 73 GB and largest is 146 GB). Therefore, using GRUB (unless GRUB for Windows is explicitly available) (or Linux with LILO/GRUB) for the sole purpose of controlling boot order may not work for partitions > 32 GB, and also makes it dependent on the host system/drive with the bootloader.

If, for example, in Windows, and the Windows and/or the drive dies, (presuming that user data resides on a separate drive), then it is a simple matter of reinstalling (the drive) and Windows.

For a dead Linux drive, booting may become tricky, if at all possible pre- or post-boot drive resuscitation.

(Yes, I've had GRUB die on my WITH the OS (and data) installed into a 4-drive RAID5 array. And no, I have absolutely no idea how to bring it back to life. :( (Host OS is Redhat 9, I forget the kernel version). I was planning on building a test system such that nearly identical, and performing tests/practicing how to bring it back to life while leaving the data intact because on that system, being able to bring the array safely back online is of the utmost importance. I just lack the experience on disaster recovery with Linux.

saikee
09-17-2007, 10:58 AM
Personally I have not run into any partition size-related problem from the Linux boot loader Lilo and Grub. If Lilo and Grub can address to the 63th partition of a 500Gb Pata disk it would be booting to the last 10Gb of that disk and I have used one 320Gb fat32 partition for data is accessible by all systems. In fact I am stilling using one 500Gb ntfs partition for storing iso files and even use Linux, with ntfs-3g support, to write the download files onto this disk.

I would say even when I started entering Linux some 3.5 years ago Lilo had already no problem addressing large hard disk, as I was reading the 1024 cylinders barrier in the Lilo related literature but could not find it in practice with the kernel versions then. I have tested the oldest Grub 0.91 in my possession and found it didn't has any fear of large hard disk either.

If a Windows dies in my system I can remove all the other hard disks in seconds, as they are all mounted on mobile racks and caddies, and reinstall the system if needed. For booting, as long as I know the disk it was installed, normally the first one and known to Grub as (hd0) I can sert it anywhere say as the 4th disk (hd3) and boot it with two extra statements in Grub
map (hd0) (hd3)
map (hd3) (hd0)
This procedure works for every Windows of Win9x, Win2k, XP and Vista.

For simplicity I have satyed away from the Raid systems. The last time I used a stripped Raid (Raid 0 I think) I believe the boot loader was actrually located in first disk. Thus if the Raid is arranged by Bios then any Grub should be able to boot it but I do not have practical experince to back this up. It depends on how the Raid is set up and can be transparaent to the OS by a management layer. If I remember it correctly Grub is in only on one disk and the loaded kernel looks after the filing systems in the Raid (from information off the Bios).

You may consider starting a thread on this problem. Some of the forum members are pretty switched on with Raids.

daqq
09-17-2007, 12:10 PM
Someone has too much time on his hands :-D

Hah! Well done!
(registered only to congratulate, and mayhap later bother the local residents with anoying newbie questions on ubuntu)

zheepeez: Well, you should be asking the question Why not? ;-)

David

alpha754293
09-17-2007, 01:28 PM
Oops, *edit*. FAT32 partitions is a cannot address more than 127 GB. I guess that it's different if Linux configures the FAT32 partition rather than Windows.

For the current generation Windows to run with FAT32 isn't as good as if it were to run on NTFS.

I may start the thread at a later time. I don't know yet. Waiting for my 9th system to arrive so that I would be able to test the procedure with that.

薛一琦
09-19-2007, 03:55 AM
晕!装145个系统有意思吗?把时间都用在了选系统上,真的没啥意思!

saikee
09-19-2007, 04:43 AM
薛一琦 ,

Welcome to JustLinux.

I hope you would excuse me not replying your question in Chinese. Possibly because 3 out of the 145 systems were "sourced" from China I notice the current thread has been translated into Chinese in one of the web site.

Yes the installations did take time but since Linux can be moved from partition to partition and hard disk to hard disk so a system once installed takes no more time.

At the later stage I started to install the iso file directly from the hard disk and the fast time I clocked is 6 minutes for installing Sidux. A modern Linux generally takes less than 15 minutes to install.

I do hellp others on booting problems. The large number generally covers whatever systems a member would have so it is reassuring to him/her that at least "one" solution is readily available.

The threads does have some unusual features, like having a Grub manual before installing the systems, there is no operating system controlling the Grub in the MBR (so every system can alter it), that every system is booted identically regardless of operation type, etc.

At a personal level finding a way to write a "howto" install and boot 145 systems and able to keep it even simpler than installing 2 or 3 systems is not easy. Also as a Linux users, and a beliver in the principle in open source, trying out distros from 39 countries is an experience, especially dealing with a foreign installer. I survived only by the common knowledge I have in Linux and after installation to alter the language and keyboard back to English and UK. Thus the time I spent has been worthwile to me, especially for the appreciation of Linux as an international operating system. It is one of the rare things in life the people in different countries and in different religions can work together and have something in common and in agreement.

saikee
09-19-2007, 06:54 PM
In view of the number of readers interested in the Grub menu of booting 145 systems I now post my current nested system of 5 Grub menus (spread into Post #32, #33 & #34 due to a maximum of 2000 characters permitted in each post). The original one long menu.lst in Post #1 has been superseded since.


menu.lst is the master menu that boots up 4 submenus for "Frequently used", "Dos/Windows only", "Linux only" and "Solaris/BSD only".
menuFreq.lst contains Linux I frequently use
menuWin.lst contains booting entries of 2 Dos and 5 Windows (Dos 7.10 temporarily dropped)
menulin.lst contains all the Linux
menuBSD.lst contains one Solaris and 2 BSD systems


A Grub menu is just a text file that every PC user can create for himself/herself. It should be apparent that more menus can be introduced if desired, like breaking the booting chices into Red Hat famiy, Debian family, Slackware family etc.

Since the publication of the current thread 9 months ago I have since move Vista from hdc3 to hdc1 when upgrading the disk to 500Gb. Thus the displaced Dos 7.10 cannot be installed into the vacanted hdc3 because hdc1 is now 28Gb and Dos 7.10 in a fat16 partition is unable to address beyond 2Gb in a hard disk.

In order to add BSD and Solaris I have added another Pata hard disk hdd which also has 63 partitions. The 4th being the extended partition and so hdd1, hdd2 and hdd3 have been used for installing Solaris 10, PCBSD and FreeBSD. This 5th disk is partially filled with another 23 Linux systems. Thus the total number of bootable systems in the box is about 165.

I have mentioned a few times that BSD and Solaris when co-existing with Linux in extended partition can cause conflicts. Yoiu can see in Post #34 the hard disk hdd, between partition hdd2 and hdd2, an error message has been reported for this type of corruption problem which currently does not stop the operation of the systems. A few veteran Solaris users have indicated the corruption in the partition table does not necessarily harm either the Solaris or the Linux systems. However a hard disk such such error/conflict can become incresingly difficult to handle with time.

Every time I boot a BSD or a Solaris system I hide the entire extended partition to avoid conflicts. The arrangement is detailed in my nested Grub menus. When I boot the Linux I hide the BSD and Solaris partitions and unhide the extended partition.

Since kernel 2.6.20 and newer cease to support Pata disk names I find it increasingly difficult to add new Linux to this PC because the installer cannot cope with a hard disk with more than 15 partitions.

Anyway for those interested here are my Grub menu systems.

(1) Master menu.lst
color black/green yellow/cyan
title This is the Master menu controlling all systems
boot

title Frequently used
unhide (hd0,3)
unhide (hd1,3)
unhide (hd2,3)
#unhide (hd3,3)
#unhide (hd4,3)
unhide (hd2,0) #Solaris unhide=hide
hide (hd2,1)
hide (hd2,2)
root (hd0,2) #(hd0,2)
configfile /boot/grub/menufreq.lst

title Dos/Windows-only sub-menu
root (hd0,2) #(hd0,2)
configfile /boot/grub/menuwin.lst

title Linux-only sub-menu
unhide (hd0,3)
unhide (hd1,3)
unhide (hd2,3)
#unhide (hd3,3)
#unhide (hd4,3)
unhide (hd2,0) #Solaris unhide=hide
hide (hd2,1)
hide (hd2,2)
root (hd0,2) #(hd0,2)
configfile /boot/grub/menulin.lst

title BSD-only sub-menu
hide (hd0,3)
hide (hd1,3)
hide (hd2,3)
#hide (hd3,3)
#hide (hd4,3)
configfile /boot/grub/menubsd.lst

title floppy on (fd0)
rootnoverify (fd0)
chainloader (fd0)+1

title Super MS-DOS 7.10 Boot Disk (requires Dos 7.10 floppy in the drive)
root (fd0)
chainloader /boot/msdos.bs

title Boot from CD Drive (requires Dos 7.10 floppy in the drive)
root (fd0)
chainloader /boot/cdboot.bs

title Power down computer
halt
The main ussage of this master menu are


To break up the booting choices in to groups
To hide the Solaris and BSD partitions while running Linux and vice versa (to avoid partition table corruption)

(2) Frequently used Linux menuFreq.lst
color red/brown black/light-gray

title This is the frequently use Linux booting menu
boot

title Return to Master menu
root (hd0,2)
configfile /boot/grub/menu.lst

title Puppy 1.0.6 @ hda6
root (hd0,5)
chainloader +1

title PCLinuxos 0.92 @ hda40
root (hd0,39)
chainloader +1

title Suse 10 @ hda43
root (hd0,42)
chainloader +1

title Foresight 0.93 @ hda47
root (hd0,46)
chainloader +1

title Klax 3.5 @ hda50
root (hd0,49)
chainloader +1

title Whax 3.0 @ hda55
root (hd0,54)
chainloader +1

title Troppix 1.2 @ hda56
root (hd0,55)
chainloader +1

title Slax 5.1.8 @ hda62
root (hd0,61)
chainloader +1

title Sam 2006-1 @ hdc26
root (hd1,25)
chainloader +1

title Kanotix 64 2005-4 @ hdc29
root (hd1,28)
chainloader +1

title Gentoo 2006.1 @ hdc40
root (hd1,39)
chainloader +1

title Underground 2.2 @ hdc42
root (hd1,41)
chainloader +1

title Ubuntu 7.04 @ hdc46
root (hd1,45)
chainloader +1

title Mandriva 2007 @ hdc48
root (hd1,47)
chainloader +1

title Ubuntu 6.06 @ hdc54
root (hd1,53)
chainloader +1

title Wolvix 1.0.5 @ hdc59
root (hd1,58)
chainloader +1

title Musix 0.39 @ sda3
root (hd3,2)
chainloader +1

title Slackware 11 @ sdb12
root (hd4,11)
chainloader +1

title Knoppix 4.0.2 @ sdb13
root (hd4,12)
chainloader +1

title Mandriva 2006 0.4 @ sdb14
root (hd4,13)
chainloader +1

title Fedora Core 6 @ sdb15
root (hd4,14)
chainloader +1


(3) Dos/Windows only menuWin.lst
color yellow/black yellow/light-gray
title You are now booting from hda3 data-only partition
boot

title Return to Master menu
root (hd0,2) #(hd0,2)
configfile /boot/grub/menu.lst

title DOS 6.22 (FAT16) @ hda1
root (hd0,0)
unhide (hd0,0)
makeactive
chainloader +1

title Win 3.11 @ hda2
root (hd0,1)
hide (hd0,0)
unhide (hd0,1)
makeactive
chainloader +1

title Vista @ hdc1
root (hd1,0)
hide (hd0,0)
hide (hd0,1)
hide (hd0,2)
unhide (hd1,0)
makeactive
map (hd1) (hd0)
map (hd0) (hd1)
chainloader +1

title Win98 @ hdc2
root (hd1,1)
hide (hd0,0)
hide (hd0,1)
hide (hd0,2)
hide (hd1,0)
unhide (hd1,1)
makeactive
map (hd1) (hd0)
map (hd0) (hd1)
chainloader +1

#title Vista @ hdc3 (Has a problem with hdd inserted)
# hdc3 currently not used

title XP Pro @ sda1
root (hd3,0)
hide (hd0,0)
hide (hd0,1)
hide (hd0,2)
hide (hd1,0)
hide (hd1,1)
hide (hd1,2)
unhide (hd3,0)
makeactive
map (hd3) (hd0)
map (hd0) (hd3)
chainloader +1

title Win 2k @ sdb1
root (hd4,0)
hide (hd0,0)
hide (hd0,1)
hide (hd0,2)
hide (hd1,0)
hide (hd1,1)
hide (hd1,2)
hide (hd2,0)
hide (hd2,13) # need to hide data partition
unhide (hd4,0)
hide (hd4,1)
makeactive
map (hd4) (hd0)
map (hd0) (hd4)
chainloader +1

title FreeDos @ sdb2
root (hd4,1)
hide (hd0,0)
hide (hd0,1)
hide (hd0,2)
hide (hd1,0)
hide (hd1,1)
hide (hd1,2)
hide (hd2,0)
hide (hd3,0)
unhide (hd4,1)
makeactive
map (hd4) (hd0)
map (hd0) (hd4)
chainloader +1


To be continued with the next post

saikee
09-19-2007, 06:54 PM
Continue from previous post

(4) Linux only menulin.lst

color purple/black red/light-gray
title This is Linux only booting menu
boot

title Return to Master menu
root (hd0,2)
configfile /boot/grub/menu.lst

#hda3 is the data-only partition hosting Grub to boot all other systems

#hda4 is the extended partition

#hda5 is the common swap partition for all Linux

title Puppy 1.0.6 @ hda6
root (hd0,5)
chainloader +1

title Videolinux 2.0 @ hda7
root (hd0,6)
chainloader +1

title Mandrake 9.2 @ hda8
root (hd0,7)
chainloader +1

title Turbo Linux V7 @ hda9
root (hd0,8)
chainloader +1

title elive 0.3 @ hda10
root (hd0,9)
chainloader +1

title Red Hat 9 @ hda11
root (hd0,10)
chainloader +1

title Lycoris 4 @ hda12
root (hd0,11)
chainloader +1

title Libranet 2.8.1 @ hda13
root (hd0,12)
chainloader +1

title Mandrake 10 @ hda14
root (hd0,13)
chainloader +1

title Debian Woody 3.0 @ hda15
root (hd0,14)
chainloader +1

title Yoper 2.0.0 @ hda16
root (hd0,15)
chainloader +1

title Knoppix 3.6 @ hda17
root (hd0,16)
chainloader +1

title Buffalo 1.5 @ hda18
root (hd0,17)
chainloader +1

title Kanotix 9.2004 @ hda19
root (hd0,18)
chainloader +1

title Kalango 3.2 @ hda20
root (hd0,19)
chainloader +1

title Blag 30001 @ hda21
root (hd0,20)
chainloader +1

title Fedora Core 4 @ hda22
root (hd0,21)
chainloader +1

title Debian Sarge @ hda23
root (hd0,22)
chainloader +1

title Red Flag 4.1 @ hda24
root (hd0,23)
chainloader +1

title Linare Ed 2 @ hda25
root (hd0,24)
chainloader +1

title Tiny Sofa 2.0 @ hda26
root (hd0,25)
chainloader +1

title Slackware 10 @ hda27
root (hd0,26)
chainloader +1

title Xandros 201 @ hda28
root (hd0,27)
chainloader +1

title Vine 3.2 @ hda29
root (hd0,28)
chainloader +1

title Specifix 0.15 @ hda30
root (hd0,29)
chainloader +1

title Ubunto 5.04 @ hda31
root (hd0,30)
chainloader +1

title PCLinuxos 0.91 @ hda32
root (hd0,31)
chainloader +1

title Asian Linux 2.0 @ hda33
root (hd0,32)
chainloader +1

title Ubuntu 6.04 Dapper @ hda34
root (hd0,33)
chainloader +1

title Wolvix 1.0.4 @ hda35
root (hd0,34)
chainloader +1

title Mepis 3.4.2 RC2 @ hda36
root (hd0,35)
chainloader +1

title DreamLinux 1.0 @ hda37
root (hd0,36)
chainloader +1

title Slampp 1.1 @ hda38
root (hd0,37)
chainloader +1

title Slax 5.0.6 @ hda39
root (hd0,38)
chainloader +1

title PCLinuxos 0.92 @ hda40
root (hd0,39)
chainloader +1

title Netsecl 2.0 @ hda41
root (hd0,40)
chainloader +1

title Vector 5.1 @ hda42
root (hd0,41)
chainloader +1

title Suse 10 @ hda43
root (hd0,42)
chainloader +1

title Kororaa 2005 Beta 2 @ hda44
root (hd0,43)
chainloader +1

title smgl 0.95 @ hda45
root (hd0,44)
chainloader +1

title Lunar 1.6 rc3 @ hda46
root (hd0,45)
chainloader +1

title Foresight 0.93 @ hda47
root (hd0,46)
chainloader +1

title SkoleLinux Sarge @ hda48
root (hd0,47)
chainloader +1

title Nepalinux 1.0 @ hda49
root (hd0,48)
chainloader +1

title Klax 3.5 @ hda50
root (hd0,49)
chainloader +1

title SciLinux 2005 @ hda51
root (hd0,50)
chainloader +1

title Progeny 2.0 @ hda52
root (hd0,51)
chainloader +1

title grml 0.6 @ hda53
root (hd0,52)
chainloader +1

title Karamad 1.4.2 @ hda54
root (hd0,53)
chainloader +1

title Whax 3.0 @ hda55
root (hd0,54)
chainloader +1

title Troppix 1.2 @ hda56
root (hd0,55)
chainloader +1

title TopologLinux 6.0 @ hda57
root (hd0,56)
chainloader +1

title Haansoft 2006 WS @ hda58
root (hd0,57)
chainloader +1

title Fedora Core 3 @ hda59
root (hd0,58)
chainloader +1

title ScientificLinux 4.0 @ hda60
root (hd0,59)
chainloader +1

title Slynux 2.0 @ hda61
root (hd0,60)
chainloader +1

title Slax 5.1.8 @ hda62
root (hd0,61)
chainloader +1

title Elive 2 @ hda63
root (hd0,62)
chainloader +1


#Starting point of another hard disk----------------------------


#hdc4 is the extended partition

title B2D Pure KDE 2005 @ hdc5
root (hd1,4)
chainloader +1

title CollegeLInux @ hdc6
root (hd1,5)
chainloader +1

title Berry 0.76 @ hdc7
root (hd1,6)
chainloader +1

title Morphix 0.4 @ hdc8
root (hd1,7)
chainloader +1

title Feather 0.74 @ hdc9
root (hd1,8)
chainloader +1

title Buffalo 1.7.3.9 @ hdc10
root (hd1,9)
chainloader +1

title Cento 4.1 @ hdc11
root (hd1,10)
chainloader +1

title Vector 4.3 @ hdc12
root (hd1,11)
chainloader +1

title Tao Linux 4 @ hdc13
root (hd1,12)
chainloader +1

title Fedora Core 2 @ hdc14
root (hd1,13)
chainloader +1

title Agnula Demudi 1.2 @ hdc15
root (hd1,14)
chainloader +1

title Damn Small Linux 2.1 @ hdc16
root (hd1,15)
chainloader +1

title Monoppix 1.1.8 @ hdc17
root (hd1,16)
chainloader +1

title Sympony A4 beta @ hdc18
root (hd1,17)
chainloader +1

title Pocket Linux 1.2 @ hdc19
root (hd1,18)
chainloader +1

title UltimaLInux 4.0 @ hdc20
root (hd1,19)
chainloader +1

title Vlos 1.2 @ hdc21
root (hd1,20)
chainloader +1

title Tinny Sofa Ceara @ hdc22
root (hd1,21)
chainloader +1

title 64 Studio 0.6 @ hdc23
root (hd1,22)
chainloader +1

title KateOS 2.2 @ hdc24
root (hd1,23)
chainloader +1

title Rubix 1.0 @ hdc25
root (hd1,24)
chainloader +1

title Sam 2006-1 @ hdc26
root (hd1,25)
chainloader +1

title Parsix 0.85 @ hdc27
root (hd1,26)
chainloader +1

title Foxdesktop 1.0 @ hdc28
root (hd1,27)
chainloader +1

title Kanotix 64 2005-4 @ hdc29
root (hd1,28)
chainloader +1

title Pardus 1.0 @ hdc30
root (hd1,29)
chainloader +1

title rPath 0.99.2 @ hdc31
root (hd1,30)
chainloader +1

title Stx 1.0 rc2 @ hdc32
root (hd1,31)
chainloader +1

title Stux 0.9.2 @ hdc33
root (hd1,32)
chainloader +1

title StartCom 4.0.4 Raam @ hdc34
root (hd1,33)
chainloader +1

title Slackware 10.2 @ hdc35
root (hd1,34)
chainloader +1

title Foresight 0.9 @ hdc36
root (hd1,35)
chainloader +1

title Xandros 3.0 @ hdc37
root (hd1,36)
chainloader +1

title Ubuntu 5.10 @ hdc38
root (hd1,37)
chainloader +1

title Kubuntu Dapper @ hdc39
root (hd1,38)
chainloader +1

title Gentoo 2006.1 @ hdc40
root (hd1,39)
chainloader +1

title LinuxTLE 8.0 @ hdc41
root (hd1,40)
chainloader +1

title Underground 2.2 @ hdc42
root (hd1,41)
chainloader +1

title DreamLinux 2.1 @ hdc43
root (hd1,42)
chainloader +1

title Linux Mint 2.1 @ hdc44
root (hd1,43)
chainloader +1

title Pioneer 1125 @ hdc45
root (hd1,44)
chainloader +1

title Ubuntu 7.04 @ hdc46
root (hd1,45)
chainloader +1

title Bayanihan 4 @ hdc47
root (hd1,46)
chainloader +1

title Mandriva 2007 @ hdc48
root (hd1,47)
chainloader +1

title Freespire 1.1.73 @ hdc49
root (hd1,48)
chainloader +1

title Caixa Majica 11 @ hdc50
root (hd1,49)
chainloader +1

title Ehad 2006 classic @ hdc51
root (hd1,50)
chainloader +1

title Vlos 1.3 @ hdc52
root (hd1,51)
chainloader +1

title Backtrack 2006-2 @ hdc53
root (hd1,52)
chainloader +1

title Ubuntu 6.06 @ hdc54
root (hd1,53)
chainloader +1

title Blag 30002 @ hdc55
root (hd1,54)
chainloader +1

title Fedora Core 5 @ hdc56
root (hd1,55)
chainloader +1

title Suse 9.1 Professional @ hdc57
root (hd1,56)
chainloader +1

title Vine 4.0 @ hdc58
root (hd1,57)
chainloader +1

title Wolvix 1.0.5 @ hdc59
root (hd1,58)
chainloader +1

title Empty @ hdc60
root (hd1,59)
chainloader +1

title Empty @ hdc61
root (hd1,60)
chainloader +1

title Empty @ hdc62
root (hd1,61)
chainloader +1

title Mepis 6.0.4 @ hdc63
root (hd1,62)
chainloader +1

#Starting point of another hard disk----------------------------

title Wolvix 1.0.5 @ hdd5
root (hd2,4)
chainloader +1

title System Rescue CD 2.1.6 @ hdd6
root (hd2,5)
chainloader +1

title Knoppix 5.1.1.1 @ hdd7
root (hd2,6)
chainloader +1

title DSL 3.2 RC3 @ hdd8
root (hd2,7)
chainloader +1

title Grafpup 2000 @ hdd9
root (hd2,8)
chainloader +1

title Empty @ hdd10
root (hd2,9)
chainloader +1

title Empty @ hdd11
root (hd2,10)
chainloader +1

title Empty @ hdd12
root (hd2,11)
chainloader +1

title Empty @ hdd13
root (hd2,12)
chainloader +1

title Empty @ hdd14
root (hd2,13)
chainloader +1

title Empty @ hdd15
root (hd2,14)
chainloader +1

title Empty @ hdd16
root (hd2,15)
chainloader +1

title Empty @ hdd17
root (hd2,16)
chainloader +1

title Empty @ hdd18
root (hd2,17)
chainloader +1

title Empty @ hdd19
root (hd2,18)
chainloader +1

title Empty @ hdd20
root (hd2,19)
chainloader +1

title Empty @ hdd21
root (hd2,20)
chainloader +1

title Empty @ hdd22
root (hd2,21)
chainloader +1

title Empty @ hdd23
root (hd2,22)
chainloader +1

title Empty @ hdd24
root (hd2,23)
chainloader +1

title Empty @ hdd25
root (hd2,24)
chainloader +1

title Empty @ hdd26
root (hd2,25)
chainloader +1

title Empty @ hdd27
root (hd2,26)
chainloader +1

title Empty @ hdd28
root (hd2,27)
chainloader +1

title Empty @ hdd29
root (hd2,28)
chainloader +1

title Empty @ hdd30
root (hd2,29)
chainloader +1

title Empty @ hdd31
root (hd2,30)
chainloader +1

title Empty @ hdd32
root (hd2,31)
chainloader +1

title Empty @ hdd33
root (hd2,32)
chainloader +1

title Empty @ hdd34
root (hd2,33)
chainloader +1

title Empty @ hdd35
root (hd2,34)
chainloader +1

title Empty @ hdd36
root (hd2,35)
chainloader +1

title Empty @ hdd37
root (hd2,36)
chainloader +1

title Empty @ hdd38
root (hd2,37)
chainloader +1

title Empty @ hdd39
root (hd2,38)
chainloader +1

title Empty @ hdd40
root (hd2,39)
chainloader +1

title Empty @ hdd41
root (hd2,40)
chainloader +1

title Empty @ hdd42
root (hd2,41)
chainloader +1

title Empty @ hdd43
root (hd2,42)
chainloader +1

title Empty @ hdd44
root (hd2,43)
chainloader +1

title Empty @ hdd45
root (hd2,44)
chainloader +1

title Empty @ hdd46
root (hd2,45)
chainloader +1

title Empty @ hdd47
root (hd2,46)
chainloader +1

title Empty @ hdd48
root (hd2,47)
chainloader +1

title Mutagenix 2.6.18.6.2 @ hdd49
root (hd2,48)
chainloader +1

title Sidux 6.0 Live CD @ hdd50
root (hd2,49)
chainloader +1

title PCLinuxOS 2007 Test 2 @ hdd51
root (hd2,50)
chainloader +1

title Suse 10.3 Alpha 1 @ hdd52
root (hd2,51)
chainloader +1

title Mandriva 2007 @ hdd53
root (hd2,52)
chainloader +1

title Symphony 2006-12 @ hdd54
root (hd2,53)
chainloader +1

title SLax 6.0.0 @ hdd55 (as a Live CD)
root (hd2,54)
chainloader +1

title Parted Magic 1.3 @ hdd56 (Live CD need choose hdd to boot)
root (hd2,55)
chainloader +1

title lg3d 3.0 @ hdd57
root (hd2,56)
chainloader +1

title SaxenOS 1.1 @ hdd58
root (hd2,57)
chainloader +1

title Sidux 2007-01 @ hdd59
root (hd2,58)
chainloader +1

title Mepies 6.0.4 @ hdd60
root (hd2,59)
chainloader +1

title Backtrack 2.0 @ hdd61
root (hd2,60)
chainloader +1

title Sam 2007 -T1 @ hdd62
root (hd2,61)
chainloader +1

# hdd63 is a data only partition


# Start of 4th disk (hd3)

title Xenoppix 3.0.3 @ sda2
root (hd3,1)
chainloader +1

title Musix 0.39 @ sda3
root (hd3,2)
chainloader +1

#sda4 is the extended partition

title GeoLivre 5 @ sda5
root (hd3,4)
chainloader +1

title Ututu x2 2005.1 @ sda6
root (hd3,5)
chainloader +1

title Helix 1.7 @ sda7
root (hd3,6)
chainloader +1

title MagicLinux 2 rc2 @ sda8
root (hd3,7)
chainloader +1

title Zenwalk 1.2 @ sda9
root (hd3,8)
chainloader +1

title MedianLinux 4.0 @ sda10
root (hd3,9)
chainloader +1

title NetBSD i386 3.0 @ sda11
root (hd3,10)
chainloader +1

title Arabian 0.6 rc1 @ sda12
root (hd3,11)
chainloader +1

title Mepis 3.3.2 @ sda13
root (hd3,12)
chainloader +1

#sda14 is Fat32 partition holding personal data

title Slamd64 11 @ sda15
root (hd3,14)
chainloader +1


title System Rescue CD 2.1.6 @ sdb3
root (hd4,2)
chainloader +1

#sdb4 is the extended partition

title Xfld 2.0 @ sdb5
root (hd4,4)
chainloader +1

title Kanotix 2006-1 @ sdb6
root (hd4,5)
chainloader +1

title Paipix 5.00 2006-3 @ sdb7
root (hd4,6)
chainloader +1

title Frugalware 0.4 @ sdb8
root (hd4,7)
chainloader +1

title Sabayon x86_64 3.0 @ sdb9
root (hd4,8)
chainloader +1

title Quantian 0.7.9.1 @ sdb10
root (hd4,9)
chainloader +1

title Suse 10.1 x86 64 @ sdb11
root (hd4,10)
chainloader +1

title Slackware 11 @ sdb12
root (hd4,11)
chainloader +1

title Knoppix 4.0.2 @ sdb13
root (hd4,12)
chainloader +1

title Mandriva 2006 0.4 @ sdb14
root (hd4,13)
chainloader +1

title Fedora Core 6 @ sdb15
root (hd4,14)
chainloader +1


The above menus show that partitions hdd10 to hdd48 have been arranged to be booted even though they are currently empty. As soon an operating system is installed in any one of them and has a boot loader installed in the root partition then the occupied partition will be bootable immediately.

(4) Solaris/BSD only menuBSD.lst
color purple/green purpose/light-gray
title This is the menu controlling 1 Solaris and 2 BSD systems
boot

title Return to Master menu
root (hd0,2) #(hd0,2)
configfile /boot/grub/menu.lst

title Solaris 10 @ hdd1
hide (hd2,0) # unhide Solaris = hiding it
hide (hd2,1)
hide (hd2,2)
hide (hd2,3)
root (hd2,0)
chainloader +1

title PCBSD 1.3 @ hdd2 (Need sdb disk removed to work)
unhide (hd2,0) # unhide Solaris = hiding it
unhide (hd2,1)
hide (hd2,2)
hide (hd2,3)
root (hd2,1)
chainloader +1

title FreeBSD 6.2 @ hdd3
unhide (hd2,0) # unhide Solaris = hiding it
hide (hd2,1)
unhide (hd2,2)
hide (hd2,3)
root (hd2,2)
chainloader +1


There are only 10 different Grub commands, listed below, in the above 5-menu system.

color - for altering the color of screen and text
title - to display a line describe the system
hide - to hide a partition
unhide - to unhide a partition
root - to tell the root partition of the system to be booted
configfile - tell tell Grub which menu to be loaded
chainloader - to ask Grub to boot the system "indirectly"
halt - to switch off the PC
map - To change the boot disk order on-the-fly
makeactive - to switch on the bootable flag (needed by MS systems)

Every PC user learns these 10 commands can boot the above 145 systems. That is why I call it a simple scheme.

To be continued with the next post

saikee
09-19-2007, 06:55 PM
Continue from the previous post

The partition scheme of the 3 Pata and 2 Sata disks are as follow
linux:/home/saikee # /sbin/fdisk -l
Warning: omitting partitions after #60.
They will be deleted if you save this partition table.

Disk /dev/hda: 300.0 GB, 300090728448 bytes
255 heads, 63 sectors/track, 36483 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hda1 * 1 122 979933+ 6 FAT16
/dev/hda2 123 244 979965 6 FAT16
/dev/hda3 245 366 979965 6 FAT16
/dev/hda4 367 36483 290109802+ 5 Extended
/dev/hda5 367 609 1951866 82 Linux swap / Solaris
/dev/hda6 610 1217 4883728+ 83 Linux
/dev/hda7 1218 1825 4883728+ 83 Linux
/dev/hda8 1826 2433 4883728+ 83 Linux
/dev/hda9 2434 3041 4883728+ 83 Linux
/dev/hda10 3042 3649 4883728+ 83 Linux
/dev/hda11 3650 4257 4883728+ 83 Linux
/dev/hda12 4258 4865 4883728+ 83 Linux
/dev/hda13 4866 5473 4883728+ 83 Linux
/dev/hda14 5474 6081 4883728+ 83 Linux
/dev/hda15 6082 6689 4883728+ 83 Linux
/dev/hda16 6690 7297 4883728+ 83 Linux
/dev/hda17 7298 7905 4883728+ 83 Linux
/dev/hda18 7906 8513 4883728+ 83 Linux
/dev/hda19 8514 9121 4883728+ 83 Linux
/dev/hda20 9122 9729 4883728+ 83 Linux
/dev/hda21 9730 10337 4883728+ 83 Linux
/dev/hda22 10338 10945 4883728+ 83 Linux
/dev/hda23 10946 11553 4883728+ 83 Linux
/dev/hda24 11554 12161 4883728+ 83 Linux
/dev/hda25 12162 12769 4883728+ 83 Linux
/dev/hda26 12770 13377 4883728+ 83 Linux
/dev/hda27 13378 13985 4883728+ 83 Linux
/dev/hda28 13986 14593 4883728+ 83 Linux
/dev/hda29 14594 15201 4883728+ 83 Linux
/dev/hda30 15202 15809 4883728+ 83 Linux
/dev/hda31 15810 16417 4883728+ 83 Linux
/dev/hda32 16418 17025 4883728+ 83 Linux
/dev/hda33 17026 17633 4883728+ 83 Linux
/dev/hda34 17634 18241 4883728+ 83 Linux
/dev/hda35 18242 18849 4883728+ 83 Linux
/dev/hda36 18850 19457 4883728+ 83 Linux
/dev/hda37 19458 20065 4883728+ 83 Linux
/dev/hda38 20066 20673 4883728+ 83 Linux
/dev/hda39 20674 21281 4883728+ 83 Linux
/dev/hda40 21282 21889 4883728+ 83 Linux
/dev/hda41 21890 22497 4883728+ 83 Linux
/dev/hda42 22498 23105 4883728+ 83 Linux
/dev/hda43 23106 23713 4883728+ 83 Linux
/dev/hda44 23714 24321 4883728+ 83 Linux
/dev/hda45 24322 24929 4883728+ 83 Linux
/dev/hda46 24930 25537 4883728+ 83 Linux
/dev/hda47 25538 26145 4883728+ 83 Linux
/dev/hda48 26146 26753 4883728+ 83 Linux
/dev/hda49 26754 27361 4883728+ 83 Linux
/dev/hda50 27362 27969 4883728+ 83 Linux
/dev/hda51 27970 28577 4883728+ 83 Linux
/dev/hda52 28578 29185 4883728+ 83 Linux
/dev/hda53 29186 29793 4883728+ 83 Linux
/dev/hda54 29794 30401 4883728+ 83 Linux
/dev/hda55 30402 31009 4883728+ 83 Linux
/dev/hda56 31010 31617 4883728+ 83 Linux
/dev/hda57 31618 32833 9767488+ 83 Linux
/dev/hda58 32834 34049 9767488+ 83 Linux
/dev/hda59 34050 34657 4883728+ 83 Linux
/dev/hda60 34658 35265 4883728+ 83 Linux
Warning: omitting partitions after #60.
They will be deleted if you save this partition table.

Disk /dev/hdc: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hdc1 * 1 3315 26623123+ 7 HPFS/NTFS
/dev/hdc2 3315 6354 24410767+ 93 Amoeba
/dev/hdc3 6354 9393 24410767+ 93 Amoeba
/dev/hdc4 9393 60801 412939342+ 5 Extended
/dev/hdc5 9393 10001 4883728+ 83 Linux
/dev/hdc6 10001 10609 4883728+ 83 Linux
/dev/hdc7 10609 11217 4883728+ 83 Linux
/dev/hdc8 11217 11825 4883728+ 83 Linux
/dev/hdc9 11825 12433 4883728+ 83 Linux
/dev/hdc10 12433 13041 4883728+ 83 Linux
/dev/hdc11 13041 13649 4883728+ 83 Linux
/dev/hdc12 13649 14257 4883728+ 83 Linux
/dev/hdc13 14257 14865 4883728+ 83 Linux
/dev/hdc14 14865 15473 4883728+ 83 Linux
/dev/hdc15 15473 16081 4883728+ 83 Linux
/dev/hdc16 16081 16689 4883728+ 83 Linux
/dev/hdc17 16689 17297 4883728+ 83 Linux
/dev/hdc18 17297 17905 4883728+ 83 Linux
/dev/hdc19 17905 18513 4883728+ 83 Linux
/dev/hdc20 18513 19121 4883728+ 83 Linux
/dev/hdc21 19121 19729 4883728+ 83 Linux
/dev/hdc22 19729 20337 4883728+ 83 Linux
/dev/hdc23 20337 20945 4883728+ 83 Linux
/dev/hdc24 20945 21553 4883728+ 83 Linux
/dev/hdc25 21553 22161 4883728+ 83 Linux
/dev/hdc26 22161 22769 4883728+ 83 Linux
/dev/hdc27 22769 23377 4883728+ 83 Linux
/dev/hdc28 23377 23985 4883728+ 83 Linux
/dev/hdc29 23985 24593 4883728+ 83 Linux
/dev/hdc30 24593 25201 4883728+ 83 Linux
/dev/hdc31 25201 25809 4883728+ 83 Linux
/dev/hdc32 25809 26417 4883728+ 83 Linux
/dev/hdc33 26417 27025 4883728+ 83 Linux
/dev/hdc34 27025 27633 4883728+ 83 Linux
/dev/hdc35 27633 28241 4883728+ 83 Linux
/dev/hdc36 28241 28849 4883728+ 83 Linux
/dev/hdc37 28849 29457 4883728+ 83 Linux
/dev/hdc38 29457 30065 4883728+ 83 Linux
/dev/hdc39 30065 30673 4883728+ 83 Linux
/dev/hdc40 30673 31281 4883728+ 83 Linux
/dev/hdc41 31281 31889 4883728+ 83 Linux
/dev/hdc42 31889 32497 4883728+ 83 Linux
/dev/hdc43 32497 33105 4883728+ 83 Linux
/dev/hdc44 33105 33713 4883728+ 83 Linux
/dev/hdc45 33713 34321 4883728+ 83 Linux
/dev/hdc46 34321 34929 4883728+ 83 Linux
/dev/hdc47 34929 35537 4883728+ 83 Linux
/dev/hdc48 35537 36145 4883728+ 83 Linux
/dev/hdc49 36145 36753 4883728+ 83 Linux
/dev/hdc50 36753 37361 4883728+ 83 Linux
/dev/hdc51 37361 37969 4883728+ 83 Linux
/dev/hdc52 37969 38577 4883728+ 83 Linux
/dev/hdc53 38577 39185 4883728+ 83 Linux
/dev/hdc54 39185 39793 4883728+ 83 Linux
/dev/hdc55 39793 40401 4883728+ 83 Linux
/dev/hdc56 40401 41009 4883728+ 83 Linux
/dev/hdc57 41009 41617 4883728+ 83 Linux
/dev/hdc58 41617 42225 4883728+ 83 Linux
/dev/hdc59 42225 42833 4883728+ 83 Linux
/dev/hdc60 42833 43441 4883728+ 83 Linux
Warning: omitting partitions after #60.
They will be deleted if you save this partition table.

Disk /dev/hdd: 400.0 GB, 400088457216 bytes
255 heads, 63 sectors/track, 48641 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hdd1 1 3039 24410736 af Unknown
/dev/hdd2 3040 6078 24410704+ b5 Unknown
Partition 2 does not end on cylinder boundary.
/dev/hdd3 6078 9117 24410830+ b5 Unknown
/dev/hdd4 * 9118 48641 317476530 5 Extended
/dev/hdd5 9118 9725 4883728+ 83 Linux
/dev/hdd6 9726 10333 4883728+ 83 Linux
/dev/hdd7 10334 10941 4883728+ 83 Linux
/dev/hdd8 10942 11549 4883728+ 83 Linux
/dev/hdd9 11550 12157 4883728+ 83 Linux
/dev/hdd10 12158 12765 4883728+ 83 Linux
/dev/hdd11 12766 13373 4883728+ 83 Linux
/dev/hdd12 13374 13981 4883728+ 83 Linux
/dev/hdd13 13982 14589 4883728+ 83 Linux
/dev/hdd14 14590 15197 4883728+ 93 Amoeba
/dev/hdd15 15198 15805 4883728+ 83 Linux
/dev/hdd16 15806 16413 4883728+ 83 Linux
/dev/hdd17 16414 17021 4883728+ 83 Linux
/dev/hdd18 17022 17629 4883728+ 83 Linux
/dev/hdd19 17630 18237 4883728+ 83 Linux
/dev/hdd20 18238 18845 4883728+ 83 Linux
/dev/hdd21 18846 19453 4883728+ 83 Linux
/dev/hdd22 19454 20061 4883728+ 83 Linux
/dev/hdd23 20062 20669 4883728+ 83 Linux
/dev/hdd24 20670 21277 4883728+ 83 Linux
/dev/hdd25 21278 21885 4883728+ 83 Linux
/dev/hdd26 21886 22493 4883728+ 83 Linux
/dev/hdd27 22494 23101 4883728+ 83 Linux
/dev/hdd28 23102 23709 4883728+ 83 Linux
/dev/hdd29 23710 24317 4883728+ 83 Linux
/dev/hdd30 24318 24925 4883728+ 83 Linux
/dev/hdd31 24926 25533 4883728+ 83 Linux
/dev/hdd32 25534 26141 4883728+ 83 Linux
/dev/hdd33 26142 26749 4883728+ 83 Linux
/dev/hdd34 26750 27357 4883728+ 83 Linux
/dev/hdd35 27358 27965 4883728+ 83 Linux
/dev/hdd36 27966 28573 4883728+ 83 Linux
/dev/hdd37 28574 29181 4883728+ 83 Linux
/dev/hdd38 29182 29789 4883728+ 83 Linux
/dev/hdd39 29790 30397 4883728+ 83 Linux
/dev/hdd40 30398 31005 4883728+ 83 Linux
/dev/hdd41 31006 31613 4883728+ 83 Linux
/dev/hdd42 31614 32221 4883728+ 83 Linux
/dev/hdd43 32222 32829 4883728+ 83 Linux
/dev/hdd44 32830 33437 4883728+ 83 Linux
/dev/hdd45 33438 34045 4883728+ 83 Linux
/dev/hdd46 34046 34653 4883728+ 83 Linux
/dev/hdd47 34654 35261 4883728+ 83 Linux
/dev/hdd48 35262 35869 4883728+ 83 Linux
/dev/hdd49 35870 36477 4883728+ 83 Linux
/dev/hdd50 36478 37085 4883728+ 83 Linux
/dev/hdd51 37086 37693 4883728+ 83 Linux
/dev/hdd52 37694 38301 4883728+ 83 Linux
/dev/hdd53 38302 38909 4883728+ 83 Linux
/dev/hdd54 38910 39517 4883728+ 83 Linux
/dev/hdd55 39518 40125 4883728+ 83 Linux
/dev/hdd56 40126 40733 4883728+ 83 Linux
/dev/hdd57 40734 41341 4883728+ 83 Linux
/dev/hdd58 41342 41949 4883728+ 83 Linux
/dev/hdd59 41950 42557 4883728+ 83 Linux
/dev/hdd60 42558 43165 4883728+ 83 Linux

Disk /dev/sda: 203.9 GB, 203928109056 bytes
255 heads, 63 sectors/track, 24792 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 5099 40957686 7 HPFS/NTFS
/dev/sda2 5100 6315 9767520 93 Amoeba
/dev/sda3 6316 6923 4883760 83 Linux
/dev/sda4 6924 24792 143532742+ 5 Extended
/dev/sda5 6924 7531 4883728+ 83 Linux
/dev/sda6 7532 8139 4883728+ 83 Linux
/dev/sda7 8140 8747 4883728+ 83 Linux
/dev/sda8 8748 9355 4883728+ 83 Linux
/dev/sda9 9356 9963 4883728+ 83 Linux
/dev/sda10 9964 10571 4883728+ 83 Linux
/dev/sda11 10572 11179 4883728+ a9 NetBSD
/dev/sda12 11180 11787 4883728+ 83 Linux
/dev/sda13 * 11788 12395 4883728+ 83 Linux
/dev/sda14 12396 23916 92542401 1c Hidden W95 FAT32 (LBA)
/dev/sda15 23917 24792 7036438+ 83 Linux

Disk /dev/sdb: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sdb1 * 1 1216 9767488+ 7 HPFS/NTFS
/dev/sdb2 1217 1338 979965 1b Hidden W95 FAT32
/dev/sdb3 1339 1460 979965 83 Linux
/dev/sdb4 1461 24792 187414290 f W95 Ext'd (LBA)
/dev/sdb5 1461 2676 9767488+ 83 Linux
/dev/sdb6 2677 3892 9767488+ 83 Linux
/dev/sdb7 3893 6324 19535008+ 83 Linux
/dev/sdb8 6325 8756 19535008+ 83 Linux
/dev/sdb9 8757 11188 19535008+ 83 Linux
/dev/sdb10 11189 13620 19535008+ 83 Linux
/dev/sdb11 13621 16052 19535008+ 83 Linux
/dev/sdb12 16053 18484 19535008+ 83 Linux
/dev/sdb13 18485 20916 19535008+ 83 Linux
/dev/sdb14 20917 23348 19535008+ 83 Linux
/dev/sdb15 23349 24792 11598898+ 83 Linux


For those who are new to the "unknown" partition ID or hiden partitions in the above partition table this thread. (http://www.justlinux.com/forum/showthread.php?t=149828&highlight=hidden) has some explanation.

Due to the new Linux cannot be installed into an environment where a hard disk has 63 partitions the work on this thread has come to a halt. I post the menu system showing it can be a viable method to control the booting process.

In actual booting I have a spreadsheet of the operating systems stored in each hard disk and also an overall index system in alphabetic order. Thus to select a system doesn't take much time at all.

irlandes
09-21-2007, 08:02 PM
I saw you on Digg a while back. Some smart-aleck asked why on earth anyone would want to put that many OS on one machine. In a world where people see how many pies or wieners they can eat in an hour, or how fast a $100,000 car can go a quarter-mile, or climb to the top of Mt. Everest, I really think no one need apologize for something relatively logical like a zillion distros on one machine.

Good job!

clw54
09-23-2007, 05:10 PM
Installing operating systems is a hobby. Kinda cool, I think. :)

I am surprised that newer disks hold fewer partitions, especially since they have so much more capacity. That seems like a step backwards.

lostinbravenet
10-03-2007, 03:24 PM
Is this possible to do with lilo.

I just thought i would ask since I have a lot of older distros and lilo was more common during their time and I would like to have classic system

saikee
10-03-2007, 06:05 PM
lostinbravenet,

Welcome to Justlinux!

Lilo uses a static boot screen so the label length is restricted and the maximum number of entries on can fill up one screen is 27 imgaes. Lilo actually warns you if you submit more than that.

The killer in Lilo is that it checks every system validity before accepting a change in the lilo.conf, otherwise it just uses the old copy. Thus if you alter any other system's boot loader Lilo may object to it because its complied lilo.conf differs slightly. Therefore the maintenance work using lilo to boot a large number of systems can become burdensome.

As we can do relays in booting so potentially one can pick 12 distros loaded with Lilo for booting the above 145 systems. I estimate using Lilo requires 3 to 5 times more work.

As an example to show the advantage of Grub over Lilo, in Post #33 I list out menulin.lst showing all the Linux being booted but the choices for partitions hdd10 to hdd48 are currently empty. However the booting instructions are already there.

As soon as I install an OS in say hdd10 by instructing the installer to place its boot loader in the root partition, which is in the boot sector of hhd10, then the booting choice for partition hdd10 will fire up the Linux, without amendment needed.

Every Linux that is booted by Lilo can also be booted by Grub and vice versa.

Another very important feature of Grub is it can boot any system "manually". This implies a user can test every Grub command individually before putting it into the script file menu.lst.

For Linux Grub can boot any distro even without a boot loader installed!

I use both boot loaders but I have to say Lilo needs a lot more work to do the same thing.

Dell Anderson
10-26-2007, 09:26 PM
I just joined to say thanks for your excellent and detailed description of how to install multiple OS's on a single drive.

Been on Ubuntu about 6 months (first Linux distro) and I agree completely with your observation of how Linux seems to logically and transparently reveal its inner workings rather than obscure them (as the proprietary OS's do) and I am completely in awe of the many programmers from around the world who have made this project work.

I needed to be able to install a few other distro's just to use their special features and options (like UbuntuStudio with it's low latency kernel, PCLinuxOS, Fedora, etc...Virtual Box has it's limits, hence my research on installing GRUB independently which brought me to this thread.

Thank you.

Dell

saikee
10-27-2007, 05:07 AM
Dell Anderson,

Welcome to Justlinux !

I am glad you you find the thread useful.

Linux amazes me because many things I tried were achieved just by "reasoning" them out if I think they are technically feasible.

This thread is one of the those examples. It would be impossible to convince me before I entered Linux that three lines of Grub commands can boot up any PC system.

If you need advice, opinion, suggestion, solution etc just make use of the forum. I learn my Linux here. This thread is the one of the many tips passed on by members and super mods..

thesnork
11-11-2007, 10:47 AM
Hi Saikee!

Great reading!!! But there is something that is driving me crazy!


Here is my situation. I installed Ubuntu and installed its GRUB in the MBR, and it auto detected my windows XP loader, and from there i can load my multiple XP installations. So everything works so far.

But i want to move GRUB to a data only partition like you suggest. So i created a new partition (FAT) (primary) , installed GRUB in /boot/grub and then to the MBR. That works, i get a grub prompt only. But this is where i have a problem, i cant get it to work to load my old linux installs, i have 2. Basically i took the config file from my original install and copied it over to my new GRUB menu.lst file. I dont understand why it wont work, should be exactly the same no???

What happens when i select windows, i get an error unrecognised file system!

And when i select linux, i get a similar error i believe.

I must be missing something........... Any ideas?

Thanx,

saikee
11-11-2007, 11:21 AM
thesnork ,

Welcome to JustLinux !

It should work just fine if you copy the /boot/grub/menu.lst off the Ubuntu partition and put it in the data-only partition.


The instructions in the menu.lst are the same one if you boot up each system manually, except in the manual booting you omit the "title" statement and finish everything with a "boot" statement.

Lets us know if you have further problem and post the Ubuntu's menu.lst plus the terminal output of "sudo fdisk -l".

thesnork
11-11-2007, 11:24 AM
also.... When installing Linux Mint 3.1, to put the boot loader in the root partition, what is the syntax?

if i put / it doesnt work
if i put /boot it changes it to /dev//boot which doesnt work


grrrrrrrrrrrrrrrrrrr

thesnork
11-11-2007, 06:43 PM
OK... si i did some more reading... WOW booting LINUX is FUN!!!!!!!!!!!!!!!!! :P



Ok....need explanation.... and then an install question...

i installed mint again, boot loader in MBR. I created a GRUB boot CD. Then i used the commands root (hd0,5)...... setup (hd0,5) to install the boot loader in the root partition. Now i can boot it easily...

Question - i thought that the boot loader was ALREADY in the root partition. I know that the folder /boot/grub already existed and has a menu.lst. Is that not the ROOT partition????????????????

2nd question. When i make a new linux install, how do i tell it to set up the boot loader in the root partition? The default is the MBR (hd0,0), how do i tell it to "PUT IT IN THE ROOT PARTITION" ?????? just use "/" or "root" ?????



Thanx..... SOOOO CONFUSED..... but enjoying it!!!!!!!!! Once i get booting down cold i can try and learn more about LINUX!!

saikee
11-11-2007, 07:29 PM
thesnork,

If you want to enjoy Linux and its boot loaders there is few places better than Justlinux.

To answer your question you have to think like a Linux. Somebody installs you may want you to boot from the MBR. However if the MBR has already another boot loader then you must be able to reside inside the root partition. Afterall each Ext2/3 or Reiserfs partition reserves the first track as the "boot sector" just for the boot loader to use. So as a Linux you give the user at least two choices; (1) in the MBR or (2) in the root partition of the Linux.

There is nothing to stop a user after installation to make a bomb-proof scheme

(1) Has the boot loader in the MBR
(2) Duplicate the boot loader in the root partition (inside the boot sector)
(3) Duplicate the boot loader on a floppy.

May be the installer is lazy it always just allows only one choice from the above three.

The method to tell the installer to put the boot loader into the root partition and not in the MBR varies between distros. Red Hat family use Anaconda installer and it has a box for "Advance boot loader option" or something similar to click. If the box isn't check you get the default destination or MBR. Ubuntu family is similar and you need to look out for it but Mandrica, OpenSuse, Knoppix and most other Linux show you the choices in advance. Lilo-based distros like Slackware and Slax families have changed and seem to go directly into the MBR.

Since you have made a Grub CD you can always re-arrange the boot loader any way you want, without even waking up the Linux. For example if you want a Linux (with Grub) in the 7th partition of the 3rd disk to take over the MBR, just boot up the Grub CD and type
root (hd2,6)
setup (hd0)
If you have Grub in the Linux from 5th to 10th partitions you can put their Grub in to their root partitions in one single shot
root (hd0,4)
setup (hd0,4)
root (hd0,5)
setup (hd0,5)
root (hd0,6)
setup (hd0,6)
root (hd0,7)
setup (hd0,7)
root (hd0,8)
setup (hd0,8)
root (hd0,9)
setup (hd0,9)

To do it by Linux you have to boot one Linux up, chroot to the one you want to put boot loader into the root partition and issue "lilo -b /dev/sda?" for Lilo and "grub-install /dev/sda?" for Grub. Check out Section B of Just booting tips (http://www.justlinux.com/forum/showthread.php?t=144294) for details.

Open s deposit box in a bank and lock up the Grub bootable CD. It can boot any operating system that has ever been invented on a PC and possibly some new operating systems that have not yet been invented. Guard it with a shot gun if you have to but don't lose it. :D

brianL
11-13-2007, 09:54 AM
Great stuff. Fascinating. Makes me want to run out and buy a few big hard-drives.
Slackware gives you a choice of where to put the bootloader. Not sure (can't remember), but I don't think Ubuntu does.

saikee
11-13-2007, 10:48 AM
I would say out of 100 distros there may be 3 to 5 of them only permit the boot loader to be installed in the MBR and nowhere else. The big majority always allow its boot loader to be installed into its root partition and that include Ubuntu too but you have to look out for it because it is hidden under "advance" or "Advance boot loader option".

When a Linux has the boot loader inside its root partition it cannot be booted by itself but must be booted by the boot loader controlling the MBR.

I recommend chainloading before you don't have to worried about what boot loader is inside. Grub, Lilo, NTLDR (xp), bootmgr (Vista), etc, etc are all booted identically by command in grub

title OS in (hd0,6)
root (hd0,6)
chaonloader +1

If you use Lilo in the MBR the same (assuming (hd0,6) is sda7) applies
other=/dev/sda7
label=System_in_sda7

That is all one needs from booting the 2nd to 200th operating systems by changing just the booting partition reference. Lilo's has a static screen and objects to more than 27 images after the screen is completely filled. For MS systems (Solaris and most BSD too) you have to be aware of their characteristics and ask Grub or Lilo to do extra work to keep them happy.

People in Justlinux has taught me that I can keep every operating system I install and I can have as many as I want. Currently sky is the limit.

thesnork
11-13-2007, 12:33 PM
How do you tell ubuntu to put the boot loader in the root partition?
I know its under advanced.... But then what do you type in the box???

ROOT?
/?

saikee
11-13-2007, 01:05 PM
I typed (hd0,6) for the 7th partition of the 1st disk. Grub counts from 0.

In any case you can choose to do it before rebooting after the installation by

say you have made a msitake to let Ubuntu overwrite the MBR and your original Linux that controls the MBR is in (hd0,2) you can restore the original Grub (while you are still inside the Ubuntu boot up Live CD and is about to reboot to try the newly installed Ubuntu) at the terminal by command
sudo su
grub
root (hd0,2)
setup (hd0)

At this point if you want the newly installed Ubuntu, say in (hd0,6) which accidentally put Grub into the MBR, to have Grub inside its root partition you continue to type
root (hd0,6)
setup (hd0,6)

Piece of cake, isn't it?

If Ubuntu has nuked away a Lilo (and not Grub in the above example) in the MBR and you want your Lilo back, easy piece, just follow Task B3 of the "Just Booting tips (http://www.justlinux.com/forum/showthread.php?t=144294)".

thesnork
11-13-2007, 02:30 PM
Ok..... Can you explain exactly what these 2 lines do

root (hd0,6)
What does this do exactly


setup (hd0,6)

What does this do exactly.



I dont understand how it is putting the boot loader in the root.

saikee
11-13-2007, 02:52 PM
The "root (hd0,6)" is to tell Grub the root filing system is in the 7th partition of the 1st disk. Grub counts from 0 so 1st disk is (hd0), 2nd disk (hd1) etc. For a partition we add a second digit. So 1st partition of 1st disk is (hd0,0). The 15th partition of the 2nd disk is (hd1,14).

The "root" command tells Grub which partition of which disk holds the operating system you wish to boot.

The "setup (hd0,6)" tells Grub to set up itself in (hd0,6). Since (hd0,6) is a partition therefore Grub will set up itself in the boot sector of the partition "formally", or in other word you install Grub in the root partition of (hd0,6).

When the partition number is missing Grub will say "Ah you want me to set up myself in the whole of disk (hd0) the only logical position is the MBR".

Grub can execute the above instructions as long as there is a /boot/grub directory in the root partition and inside it there is a set of Grub system files. The fact that you can invoke a Grub shell means all the necessary Grub systems will be there.

An example in a Grub shell
grub> root (hd0,13)
Filesystem type is ext2fs, partition type 0x83

grub> setup (hd0,13)
Checking if "/boot/grub/stage1" exists... yes
Checking if "/boot/grub/stage2" exists... yes
Checking if "/boot/grub/e2fs_stage1_5" exists... yes
Running "embed /boot/grub/e2fs_stage1_5 (hd0,13)"... failed (this is not fatal
)
Running "embed /boot/grub/e2fs_stage1_5 (hd0,13)"... failed (this is not fatal
)
Running "install /boot/grub/stage1 (hd0,13) /boot/grub/stage2 p /boot/grub/men
u.lst "... succeeded
Done.

grub>
Outside the Grub shell my /boot/grub has these files inside
ls /boot/grub
default fat_stage1_5 menu.lst stage1
device.map iso9660_stage1_5 minix_stage1_5 stage2
e2fs_stage1_5 jfs_stage1_5 reiserfs_stage1_5 xfs_stage1_5
root@saikee-Mint:/home/saikee# The files used by Grub to setup itself are coloured in red, pink and orange. The blue bits are the commands you have to enter.

For Red Hat distros, like Fedora, Grub's "root" command should be pointing to the /boot directory because a normal installation of this Linux is in multiple partitions involving possible a LVM too.

thesnork
11-14-2007, 01:19 AM
Maybe u could explain this one to me...

I installed a new linux on a new HD, installed boot loader to MBR (hd0). Then i put back my original boot loader from hd0,0 to hd0. So grub loads up and i have the option i created to boot the new linux (chainload). But it fails, i was getting grub 18 error, but now it just says GRUB with a flashing cursor, and u cant do anything.....

So i then configured grub to boot it directly, and it works! But i dont understand why i cant chainload it. Any idea to fix this?

Thanx

saikee
11-14-2007, 03:46 AM
Grub can report Error 18 if an old version is asked to chainload a newer version.

The error should disappear if you use the newer one.

The current version is 0.97 and you should have no problem with it as the one in the MBR.

thesnork
11-14-2007, 11:43 AM
Hmmmm.... I am almost 100 percent sure that i had .97 in the MBR to begin with. And i assume that the grub on the UBUNTU live CD is .97 also.

Actually, i do remember a difference. One of them tells you the partition type, but the other one does not.... HMMM, i guess i will have to check again.

Thanx

00700
11-17-2007, 04:00 PM
Hi, i'm just registered, so 'Hello World!'

Thanks for the great post, i learn a lot of things!

Now i start to explain my grub problem:

I have a notebook(hp 6710s) with vista, and i would install Gentoo Linux from the minimal cd. The problem is hd that is pre-partitioned from hp: the first primary partition is for Vista, i resized it to make space for linux; the second primary partition is for restore; the third partition is for hp's tools.
So, I create a logical partition that is partitioned for swap, /boot, /
Most important thing is that i can't install grub into MBR because is modded from hp and if i erase it i can't restore Vista anymore (and this is a great problem because i don't have rescues cd and the restore partition is locked, so i can't make a install cd with vLite).
During Gentoo's installation when i install grub with the commands:
(chroot) Livecd #grub
grub> root (hd0,5)
Filesystem type is ext2fs, partition type 0x83

grub> setup (hd0,5)
Checking if "/boot/grub/stage1" exists... yes
Checking if "/boot/grub/stage2" exists... yes
Checking if "/boot/grub/e2fs_stage1_5" exists... yes
Running "embed /boot/grub/e2fs_stage1_5 (hd0,5)"... failed (this is not fatal
)
Running "embed /boot/grub/e2fs_stage1_5 (hd0,5)"... failed (this is not fatal
)
Running "install /boot/grub/stage1 (hd0,5) /boot/grub/stage2 p /boot/grub/menu.lst "... succeeded
Done.

grub>quit

In my fstab file:
/dev/sda6 is the /boot partition (ext2)
/dev/sda5 is swap partition
/dev/sda7 is / partition (reiserfs)

This is my grub.conf:
# Quale opzione viene avviata in modo predefinito. 0 è la prima, 1 la seconda, ecc.
default 0
# Quanti secondi attendere prima di avviare l'opzione predefinita.
timeout 30
# Un'immagine gradevole
# Da commentare se non si dispone di scheda grafica
splashimage=(hd0,5)/boot/grub/splash.xpm.gz

title=Gentoo Linux 2.6.22-r9
# La partizione dove si trova l'immagine del kernel (o il sistema operativo)
root (hd0,5)
kernel /boot/kernel-2.6.22-gentoo-r9 root=/dev/sda7

title=Gentoo Linux 2.6.22-r9 (rescue)
# Partizione dove si trova l'immagine del kernel o il sistema operativo
root (hd0,0)
kernel /boot/kernel-2.6.22-gentoo-r9 root=/dev/sda7 init=/bin/bb

# Le prossime tre righe vanno messe solo se si ha un dualboot con Windows.
# In questo caso, Windows è in /dev/hda6.
title=Windows Vista Home Premium
rootnoverify (hd0,0)
makeactive
chainloader +1

After grub installation i reboot, but automatically start Vista without grub's prompt! :mad:

P.S. Sorry for my bad english but i'm italian :rolleyes:

saikee
11-18-2007, 01:57 PM
00700,

Welcome to JustLinux !


Your command
grub> root (hd0,5)
grub> setup (hd0,5)
put Grub in the root partition of (hd0,5) or sda6. This only works if you have another Grub in the MBR or (hd0).

It appears to me you have only Gentoo Linux so you need to put it in the MBR. So try this
grub> root (hd0,5)
grub> setup (hd0) Take not on the red bits I omitted.

It may not boot successfully if your menu.lst is faulty but at least you get a Grub screen now.

00700
11-19-2007, 01:07 PM
I opted for another solution:

I copied the boot sector of /dev/sd6 on a usb flash mounted before on /mnt/floppy with the command:
dd if=/dev/hda5 of=/mnt/floppy/GentooBoot.bin bs=512 count=1
Then i have copied GentooBoot.bin in C:\
Now i'm trying to use vista bootloader to add a menu item and load the boot sector; the syntax is something like this:
bcdedit /create <Linux> /d "Gentoo-Linux" /application BOOTSECTOR path C:\GentooBoot.bin

but this gives me an error:
Impossible to find the specified file

Do you have any idea?

00700
11-19-2007, 01:37 PM
Foot by foot i'm goin through!
bcdedit /create /d "Gentoo-Linux" /application BOOTSECTOR

The voice {d2634840-96c2-11dc-bf3c-0017a4e2e6c4} is correctly created
Then
bcdedit /set {d2634840-96c2-11dc-bf3c-0017a4e2e6c4} device partition=C:
Operation complete.
bcdedit /set {d2634840-96c2-11dc-bf3c-0017a4e2e6c4} path \GentooBoot.bin
Operation complete.

Now i try to reboot i hope that grub starts!

saikee
11-19-2007, 01:38 PM
The Vista's bcdedit is a pig to work with.

I got a feeling your current error may disappear if you drop the "c:" in front of "C:\GentooBoot.bin", leaving "\GentooBoot.bin".

You may like to take a look at this thread (http://www.justlinux.com/forum/showthread.php?threadid=150601) or Task E5 of "Just Booting tips (http://www.justlinux.com/forum/showthread.php?t=144294)" if you Vista still not booting the Linux.

00700
11-19-2007, 02:10 PM
I restarted but doesn't work...

DOH! I have spent a lot of time on reading Microsoft' documentation when the perfect solution was under my eyes!
Doesn't matter, i have learned how vista bootmanager work! :-D

Thanks for your guides, they are very usefull!

The only difference from the guide is that as device i put C: instead boot, but now i have corretted the command and i try to reboot another time! :cool:

EDIT: YEAH! It works! Thanks Thanks Thanks!!! ;)

saikee
11-19-2007, 10:39 PM
Glad you have got it sorted.

Do try different boot loaders and find it out yourself which one is the best or the easiest.

DaNmarner
12-08-2007, 12:28 AM
Grub is now installed in MBR by ubuntu(which is installed on sda3).
I want to install a independent grub on a prepared partition(sda1) and chainload the original ubuntu grub.
Here is what I've tried:
I mounted sda1 to /media/sda1,made /media/sda1/boot/grub,copied /boot/grub/* to there,made /media/sda1/boot/grub/menu.lst like this:
default 0
timeout 10

title Ubuntu
root (hd0,2)
chainloader +1

and reboot.

I press c when grub showed up and
root (hd0,0)
setup (hd0)
reboot

the newly edited menu appeared.

Everything seems fine to me untill I choose to load Ubuntu.
Nothing but the word GRUB stayed there.

I had to change the menu back then.


I guess something is wrong,isnt it?

saikee
12-08-2007, 12:40 PM
Yes.

An operating system is only chainloadable if it has a boot loader occupying its partition's boot sector.

Your Ubuntu was booted directly and so it would have no boot loader inside the boot sector of sda3. There was no need to chainload it before so the installer would not implement it. This is the default situation even the boot sector is empty.

You can now make sda3 chainloadable at the Grub prompt ( by pressing "c" key at the Grub screen instead of selecting s system to boot) with command
root (hd0,2)
setup (hd0,2)
Your Ubuntu will answer your Grub call from (hd0,0). In fact you can fire it up immediately without a reboot by

(1) Fire up sda3 immediately by command (as your current root is (hd0,2))
chainloader +1
bootor

(2) Tell Grub to start from the beginning by command
chainloader (hd0)+1
boot

DaNmarner
12-08-2007, 08:40 PM
I learned a lot from your enlightening essay.
I've rearranged the spaces of my hardisk without losing my original OS,and I'm able to install & chainload as many new OSs as I want!
Thank you.

saikee
12-08-2007, 09:21 PM
Glad you like it. I was hoping it could be useful to some.

I always say to others that if there something difficult in Linux it would not be in the booting.

Xaiver Merlyn
12-13-2007, 02:49 PM
saikee,

You are a godsend. Using a standalone GRUB install as you have described is absolutely amazing. You have allowed me to demo WinXP, PC-BSD, CentOS, Ubuntu, Debian, and Mandrake to my customers all from my laptop without having to use bulky VM's on the old antique.

I applaud your dedication, and letting this old schlub stand on your shoulders to do amazing things!

saikee
12-13-2007, 07:31 PM
Xaiver Merlyn,

Welcome to Justlinux.

I am glad the few things I picked up and summarized from the super mods and knowledgeable members here are found useful by others in addition to myself.

It looks like you have managed a good collection of distros.

VMware has its place but it does not give us the full functionaliies of each distro. A user can boot as many systems as he/she like and still can have a couple of the systems to host VMware. Nothing needs to be compromised.

xplusaks
12-22-2007, 01:32 PM
saikee,

Thanks, (in one word only, for it means all).

I have two options.
One, keep searching to find the answer. Two, ask saikee.

Question is
"How difficult is howto boot straight into LVM2. I mean no standalone /boot partition."

First option I like because It is in the search mode I came to know about your FANTASTIC article. Second option I like because I prefer an authority (yes) like you to put the quest to rest ASAP.

Why I ask this question? Because I believe it SHOULD be possible!!!
What is the need? Because in future systems, 'we may not have partitions'.

Thanks,

xpluaks

saikee
12-22-2007, 09:33 PM
xplusaks,

Welcome to Justlinux.

Thank you for the kind word but I am just a student here. The super mods and experienced members here are the real masters.

Regarding to booting LVM2 I am afraid I have a bad news. Both Grub and Lilo cannot read a LVM and that is why a /boot partition, usually in Ext2/3 filing format, is always needed whever a Linux is held inside a LVM.

I believe one of our Villgae elders, super mod bwkaz, may have done some work on this area but it doesn't sound like an easy job to incorporate a driver into Grub to boot a LVM.

xplusaks
12-23-2007, 06:51 AM
Saikee,

I expected it and you have proven it - your prompt reply. So this time thanks for keeping the faith alive.

I have been experimenting with multiple boot and multiple distros and have the handicap of starting late, I mean I already have partition scheme that is not suited for the purpose. Next round of clean up can only take care of that.

But what I am doing is already discussed in here. Multiple distros on single partition. One principle is to use the technique similar to rescue disks, and chroot may hold some helpful keys. But ultimately this business of multiple distros in one box must start addressing virtualization, at some appropriate stage.

Advantages would be
1. Coupled with LVM, there will be no concern about space required for individual distros.
2. On the fly intake and chuck-out of individual distros, adding to adv 1 above.
3. Ultimately leading to next level of virtualization where you hitch-hop-hike from one to next. Great asset for shifting mission critical boxes with minimal disruption.

Let's keep sharing.

xplusaks

saikee
12-23-2007, 08:14 AM
Personally I agree that

(1) virtual machines and

(2) LVM

could be the key to access multiple distros either simultaneously or one at a time in future. However I don't think they are ready yet.

I am using both and the experience so far are

On Virtual machines which I used XP as the host I found this to be a disappointment. For a start one is limited by the number of systems that can be run online as each one takes away a portion of the ram. One can run about 4 guests with a host (recommended by VMware) before the slow speed becomes unacceptable as every online system is reduced to 1/4 of the ram available. For offline systems virtual machine has the advantage of mounting them without reboot the host.

The major disadvantage, which could be restricted only to the free versions I can download (but I think technically it is an uncharted area too), is that the guest is effectively in solitory confinement as in a prison isolation cell. The guest can communicate to the outside world only with the host and cannot see or communicate with fellow guests in the same PC. The very fabric of using a Unix-like system to mount a partition of a hard disk is denied because the operating system resides in a file of the host and not actually in a partition.

On using a LVM to host disfferent distros my disappointment is that many distro installers are not equipped to be installed into an existing LVM while others simply omit the LVM driver all together resulting the distro can't even recognise a LVM. Thus there is an uphill struggle to install a big population of the distros into a LVM making booting a large number of Linux out of the question at this stage. LVM is also foreign to M$ systems, Solaris and BSDs and appears to be suitable for Linux only.

To boot 100+ or 150+ systems and have the flexibility of using each system to the full the only easy and practical way is to install each system normally in a partition of a hard disk and boot all of them by a boot loader. I do feel all other alternatives should be judged and compared with this basic approach, of having a normal installation in a harddisk partition booted by a boot loader, because that is what every operating system is supposed to offer to a user.

Many users can regard virtual machines and LVM are superior if they have no need to use many functions, available if installed normaly, of the operating system.

bwkaz
12-23-2007, 02:50 PM
If you want to do LVM, you'll have to use grub2 -- but the problem is, no distro that I know of has actually adopted grub2 as the default yet. Plus the directions on how to use it are pretty sparse -- you have to do a lot of guessing and testing and blindly trying things (unless someone has written a manual recently? nope, the "documentation" page still says "under development"; rats).

I was thinking about trying to put together an LVM stage1.4 (similar to the FS-specific stage1.5 files) for grub-legacy a while back -- but I figured that since it would never actually get added into the "real" grub (since nobody upstream is interested in adding features anymore), I never started. Plus grub2 does have support for it, so it's kinda pointless anyway (if development would ever hurry up and get done on grub2 :p).

What you can do is make a 500-meg /boot partition, and share it between all your distros. They'd all put their kernels and initramfs files there, and so each of the kernels would boot. (They'd have to support root-on-LVM natively, but I think most new-ish distros do, so hopefully that's not an issue.) Plus you don't take up a partition for each distro. It's not the greatest solution, but it should work.

saikee
12-23-2007, 04:36 PM
bwkaz,

Greetings!

I did remember you once told me that you did hacked Grub to install your own driver.

I was close to doing a thread on putting multiple distros into LVM. My strategy was to offload the distros into a LVM; first by expanding the iso on a loop back device, secondly transfer it into a logical volume, thirdly amend the isolinux and substitute it with Grub. All these I believe can be done by a script. I abandoned the project after finding

(1) Ubuntu installer does not mount the LVM and regards it as unknown partition.
(2) Small distros like DSL, Puppy and Slax family do not entertain LVM
(3) I couldn't get Slackware or Slamp64 installed into the logical volume I want.
(4) Debian recognise the LVM but the installer want to take over the lot.

I managed to squeeze Foresight, Fedora 7, Mandriva, PCLinuxOS and Mepis into the LVM but there are too many obstacles to overcome.

I decided to let the Linux mature a bit more before looking at the LVM scheme again.

I am rather disappointed by Grub2. In the last 3 years it has not managed even with a simple documentation. Its ability to support LVM at boot time has yet to be proven. I could be wrong but there seems to be some indication of some effort may have gone to make it compatible with M$ system trust computing or the new hard disk partition table.

bwkaz
12-25-2007, 11:52 PM
I did remember you once told me that you did hacked Grub to install your own driver. I remember talking about doing it, but I never actually did it -- if I implied that I had, sorry, but that was wrong. :(

(1) Ubuntu installer does not mount the LVM and regards it as unknown partition. Ouch; that's a fairly large problem, considering the usage of Ubuntu...

(4) Debian recognise the LVM but the installer want to take over the lot. That's probably the second large problem... :(

I decided to let the Linux mature a bit more before looking at the LVM scheme again. From your info above, that's probably a good idea. Hopefully by the time distros start cooperating with LVM2, grub2 might (possibly) even be used, which will help too. :)

I could be wrong but there seems to be some indication of some effort may have gone to make it compatible with M$ system trust computing or the new hard disk partition table. Is that EFI, or something else? I remember a bit of talk a while back about getting it to support EFI-capable BIOSes, rather than the ancient IBM PC BIOS interface. I believe EFI systems use a different partition table too. I am fairly sure Vista has some basic EFI support, though I have no idea how complete (or well-tested!) it is.

The trusted computing stuff is junk, though... if they're getting into that boat, I have even less hope for having it ever actually work.

(Of course it would probably help if they had more developers...)

saikee
12-26-2007, 09:55 AM
bwkaz,

yes I was referring to EFI. I read some articles relating to EFI or similar schemes as basic building blocks for bringing about the trusted computing.

The EFI is only being sold by Itel and there seem to be a couple of M$ systems implementing it either partially or as an alternative.

I have also read that Vista user can select it as an alternative to the legacy partition table currently used in PC Bios.

Personally I see M$ systems have a far bigger need to switch to a new partition table system because the limitations of their existing Oses trying to be backward compatible.

Linux is not in a hurry to change because a Linux can migrate freely from partition to partition, from hard disk to hard disk and has no preference of the partition type or the location in the hard disk. It is only the proprietary software requiring protection of their interest that needs to improve on the restriction against migration of the operating systems.

You introduced me about the major and minor numbers of partitions used in Linux. The EFI is not going to be of any real use unless the major/minor numbering system got overhauled in Linux or Unix-like systems.

Thus I still think the current partition table scheme will remain operational for a long time until a new replacement can prove significantly better.

bwkaz
12-26-2007, 12:09 PM
yes I was referring to EFI. I read some articles relating to EFI or similar schemes as basic building blocks for bringing about the trusted computing. Possibly. I haven't read those articles (and I don't have a great understanding of what all is included with EFI), so I don't know if that's true or not -- but it is possible.

The EFI is only being sold by Itel and there seem to be a couple of M$ systems implementing it either partially or as an alternative. And Apple: most of the new Macs already use it. ;)

I have also read that Vista user can select it as an alternative to the legacy partition table currently used in PC Bios. Well, it's more than just the partition table. It's the whole interface to the BIOS (EFI itself is "extensible firmware interface", i.e. an interface to the machine's firmware, i.e. what the BIOS used to do). That's why it requires bootloader support before it'll actually do any good. :)

You introduced me about the major and minor numbers of partitions used in Linux. The EFI is not going to be of any real use unless the major/minor numbering system got overhauled in Linux or Unix-like systems. Which had actually started when I started talking about it - the dev_t type in the kernel has been 32 bits wide for a long time. It used to be only 16 bits wide (8 for the major, 8 for the minor), and splitting various major numbers up between disk drives is what gave the partition count limits. But when it moved to 32 bits wide, lots more majors and minors became available.

(Of course I'm not sure how many glibc's are compiled to have a 32-bit dev_t in their headers, so I don't know how many userspace programs will work with that yet...)

Between that, udev, and dynamic device number allocation in the kernel -- which I believe all block-devices have support for now -- a new partition table would at least be possible. Although depending on how compatible the developers make it, it may keep the SCSI-15-partition limit, I'm not sure. (There are lots of partition table schemes already supported in the kernel: take a look at all the CONFIG_*_PARTITION options. I believe most of those use the same partition split as the normal PC BIOS tables use. And actually, there is a CONFIG_EFI_PARTITION, so I bet the EFI-format partition table will already work. :))

rolaustral
02-26-2008, 10:24 PM
saikee,

first of all, great work and many thx for posting such a detailed how-to guide!

Just out of interest, I am curious why you chose hda3 for the grub installation. Why not hda1 or hda2? What's in hda1 and hda2? Are they required for something else (Maybe the MS Windows OS???)?

I am interested in setting up a triple boot system with XP, Vista and Ubuntu on my laptop which only has one hard disk, so hence I am trying to gather as much information as possible before plunging into it (although I am sure I will invariably make some mistake and have to do it all again :) which is fine as one learns from one's mistakes...).

Thx!

rolaustral
02-28-2008, 12:02 AM
Ah, I guess I should have looked a little bit more closely at the menu.lst example you give on the first page of this thread to see that hda1 is for DOS 6.22 and hda2 is for Win 3.11.

Silly ol' me!

saikee
02-28-2008, 06:05 PM
rolaustral,

There are many ways to triple a Linux, Xp, and Vista because each system can boot the other two.

In the Newbies secrion I have added the Grub's method for booting two Windows. Can you do a search on triple boot there? I am currently working in Prague and had to use a key board to access Internet via a TV in a hotel room and so not easy for me to post the link.

The method of using XP's NTLDR to multi boot is given in the last link of my signature. In there I have also added the steps of using Vista to multi boot. There is a seprate thread on showing how to use Vista to boot 150 Linux too.

You will find sky is the limit as far as booting is concerned in Justlinux!

As expected you will find Grub is the easiest, most powerful and flexible to work with.

rolaustral
02-28-2008, 06:55 PM
Hi saikee,

thanks for that. I have used Grub in the past before several times and have successfully used it now again. Definitely the boot loader of choice for me! Easy to set up and works like a charm.

Thanks again.

saikee
02-28-2008, 07:35 PM
In case you do not know why I put Grub in hda3 it was to pull off a stunt!

hda3 is a data-only partition without an operating system inside.

By using a data-only partition I could demonstrate every one of the 145 operating systems could be booted by chainloading.

Had I used Grub from a Linux that Linux must be booted directly with a "kernel" and possibly with an "initrd" statement too. Therefore I cannot used the indirect method of chainloader +1 on it.

The way I did it was using "chainloader +1" for every syetem without exception. It is unconventional but it shows once Grub is understood then we can play tunes with it.

It is also a good way to bring a festure of Grub that not many Linux users are aware of.

Tomislav
04-08-2008, 07:43 PM
I cant boot m$ after installing ubuntu 64bit, problem=no such partition



Device Boot Start End Blocks Id System
/dev/sda2 * 1 16708 134206978+ f W95 Ext'd (LBA)
/dev/sda5 1020 16708 126021861 7 HPFS/NTFS
/dev/sda6 1 1019 8185023 83 Linux


title Microsoft Windows XP Professional
root (hd0,0)
savedefault
makeactive
chainloader +1

saikee
04-09-2008, 03:18 AM
Tomislav,

Welcome to Justlinux!

You should find your MS system will boot if you change the root partition reference from (hd0,0) to (hd0,1) as your sda2 is marked active and would have a boot loader inside to fire up the XP in sda5.

title Microsoft Windows XP Professional
root (hd0,1)
savedefault
makeactive
chainloader +1

Sregrepsa
05-09-2008, 12:43 AM
I was "Googling" for clues on how to setup LILO for a triple boot system when I came across your thread.

I've never understood the difference between LILO and GRUB and wondered why the World needed more than one boot loader.

After reading <a href="http://home.att.net/~lilo-boot/lilohome.htm">this site</a> thoroughly, I believe I'm starting to "get it". It seems that LILO needs to read a file or two from the Linux partition from which it was written in order to boot even Windows.

IOWs: If the Linux partition where the LILO "map" and/or "boot.b" files exist gets corrupted, you'll be shut out of your other OS installations as well. Unacceptable! (I can't find "boot.b" on my Slack-like installation, though... not in the "locate" database and not under /boot either.)

So I'm trying to convert to GRUB.

I've attempted to make my "Slack" chainloadable... but I must be missing a concept or two here.

I've left LILO on the MBR for the moment and pointed it at my "chainloadable" Slack. All I get is the GRUB prompt. I can then enter the kernel file by hand and "boot"... but the boot then fails... something about how "this should never happen."

I'll keep trying and I'll re-read your instructions as well.

Thank you for such a comprehensive treatment of the GRUB here. I registered on this forum because of your thread.

Cheers! :)
-Ed

saikee
05-09-2008, 07:23 AM
Sregrepsa,

Welcome to Justlinux!

Since Slackware is not shipped with Grub my prediction is if you have built Grub into it then its configuration file /boot/grub will not be available.

The menu.lst is normally arranged by the installer, same function as the liloconf program inside Slackware that builds the /etc/lilo.conf for you. As Slackware has not anticipated Grub you will have to write your own menu.lst.

Luckily this is the simplest for Slackware because it has no initrd (shipped distro version) and the kernel is symbolic-linked to vmlinuz. Therefore if you get a Grub prompt you can manaully boot up Slackware, say it is in hda4 or (hd0,3) to Grub, by commands
root (hd0,3)
kernel /boot/vmlinuz ro root=/dev/hda4
boot
Your /boot/grub/menu.lst can be simply
title Slackware in partition hda4 known to Grub as (hd0,3)
root (hd0,3)
kernel /boot/vmlinuz ro root=/dev/hda4
The "boot" statement is mandatory in manual booting but optional in menu.lst. It acts as the green light to tell Grub to fire up the system. The title line is a display message that can be omitted in manual booting.

If the above menu.lst works and you have another Grub in the MBR then your Slackware in , say in (hd0,3), can be made chainloadable by commands in either a Grub prompt or a Grub shell
root (hd0,3)
setup (hd0,3)
Thereafter you can fire up Slackware manually by command
root (hd0,3)
chainloader +1
boot
or inside a menu.lst with lines
title Slackware in (hd0,3) booted indirectly
root (hd0,3)
chainloader +1

Lastly in chainloading you boot one boot loader with another. It only works if you have two Linux at least. The one in the MBR is always booted directly by using the kernel statement. You will understand it if you think about it. If not I can explain it if you want.

Also Lilo can multi-boot same as Grub and 3 systems are no problem at all by chainloading. Its equivalent command is "other=" . Thus if you are using Lilo to boot the Slackware above the commands are just
other=/dev/hda4
label=Slackware
It will fire up after you has done the "root" and "setup" statements. I am assuming Slackware is boot by Grub and you have another Linux with Lilo sitting at the MBR here.

Happy booting.

Sregrepsa
05-09-2008, 05:40 PM
I feel silly. I left the 'root' statement out when I tried to manually boot from the Grub prompt.:o

I'll give it another go. But I really like the approach of having Grub in it's own partition. Can't wait to try that!

Again; this is a very inspiring thread. Thank you so much for taking the time to patiently address my question.
-Ed

EDIT 10 May '08: WOOT! Successfuly installed GRUB on the Slackware partition and got it to boot from LILO in the MBR. So it starts with the LILO screen... I choose Slackware... I get the GRUB screen (from the Slackware partition)... then choose Slackware. Now to eliminate LILO completely! Note: It's kind of funny right now; with the LILO map file sitting in the same folder with the GRUB menu.lst file.

lejepra
05-18-2008, 11:31 AM
Hi Saikee!

First of all congratulations for the achievement of installing/booting more then 100 OSs in one PC and for sharing this with us.

I am trying to configure a multi-boot system following your instructions from <http://www.justlinux.com/forum/showthread.php?threadid=147959> but I am getting an error message when running:
root (hd0,0)

See the error message below:
grub> root (hd0,0)

Error 21: Selected disk does not exist

grub> root (sd0,0)

Error 23: Error while parsing number

grub> root (sda0,0)

Error 23: Error while parsing number

I thought it could be just the nomenclature of my disk, but no option I tried resulted in anything good.

My system should boot Ubuntu 7.10 in sda6, Ubuntu 8.04 in sda7 and XP in sda2
All the systems are already installed in their respective partitions, but I just cannot make the first partition root in order to select the system to boot.
I have installed Ubuntu 8.04 last and this is the system that boots by default. As Ubuntu 7.10 was already installed the grub from 8.04 presents 7.10 as the second option in the boot menu

My disk:
Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00000001

Device Boot Start End Blocks Id System
/dev/sda1 * 1 130 1044193+ 16 Hidden FAT16
/dev/sda2 131 3705 28716187+ 7 HPFS/NTFS
/dev/sda4 3706 60801 458623620 5 Extended
/dev/sda5 3706 3835 1044193+ 82 Linux swap / Solaris
/dev/sda6 3836 6515 21527068+ 83 Linux
/dev/sda7 6516 9195 21527068+ 83 Linux
/dev/sda8 9196 22456 106518951 7 HPFS/NTFS
/dev/sda9 22457 35717 106518951 c W95 FAT32 (LBA)
/dev/sda10 35718 60801 201487198+ 7 HPFS/NTFS

What should I do in order to make my first partition root?

Thank you,

Lejepra

saikee
05-18-2008, 01:55 PM
When you in a Grub shell, from either booting from a Live CD or any boot-up Linux, restore Grub again.

Say the partition that you host Grub in the MBR is /dev/sda6 known to Grub as (hd0,5) these two line will restore Grub
root (hd0,5)
setup (hd0)
I did notice Grub may need to be restored if the installer hasn't done the job properly.

I put down on the installation of Grub wasn't cleanly done. It does happen.

It is also possibly that the installation was perfect but a small corruption of the partition data occured. Boot loaders are sensitive to such small corruptions.

lejepra
05-18-2008, 08:27 PM
Thank you for the reply!

My problem is exactly getting the command root (hd0,0) to work.
My first partition (sda1) is the one where I am trying to install Grub.

Every time I run this command I get the error message:
grub> root (hd0,0)

Error 21: Selected disk does not exist

I am using a SATA HD and I thought maybe it should not be hd0,0 but sd0,0 then I tried the following, but just got more error messages:
grub> root (sd0,0)

Error 23: Error while parsing number

grub> root (sda0,0)

Error 23: Error while parsing number

Any more tips?

Thank you,

Lejepra

saikee
05-19-2008, 03:33 AM
Actually it is quite easy to sort out your situation. You do this by asking what Grub sees. Grub always names the hard disks as (hd0), (hd1), (hd2)....etc. (sd0) is never used!

In a text boot screen before you select a system to boot you can always press the "c" key to get a Grub prompt. In a Grub prompt you can ask Grub what are the partition layouts, of say the first two disks, by command
geometry (hd0)
geometry (hd1)

Grub must has a disk in order to load itself.

I notice you start off with sda1 or (hd0,0) as a hidden Fat16 partition. This might prevent Grub from reading its content and gain access to its menu.lst. If you have installed Grub in (hd0,0) you will need Grub to unhide it first so that you have Grub in a working order first. You only need to hide (hd0,0) if you boot a MS Windows installed alone at a later partition so that the "c" drive is not given to (hd0,0).

Can you add this line at the beginning of you menu.lst
unhide (hd0,0) and confirm if the same error persist?

bwkaz
05-19-2008, 06:54 PM
What should I do in order to make my first partition root? Don't!

That looks like a Dell/HP recovery partition. (Given the fact that there are tons of NTFS partitions, I'd suspect HP. They seem to steal lots of your disk for recovery junk.) There is no data from grub on that partition (unless you put it there yourself). The grub "root" argument tells it where to find its files (that is, menu.lst, stage1, *_stage1_5, stage2, etc.); if those files aren't on the partition you give it, it still won't install properly.

What you have to do is choose one of your Linux filesystems to hold the grub files (both of them probably already do, in /boot/grub); I'd choose the Ubuntu 8.04 partition myself. (That's sda7, or (hd0,6) to grub.) Then use that for the root command, not your hidden recovery partition that has no grub info on it. ;)

Swarup
05-21-2008, 01:55 AM
Saikee, I want to thank you so much for your lucid HowTo and your help in making the whole partitioning and grub work much clearer. Like others whose posts I've read here on this thread, I have joined this forum just because of the interest which your story and your HowTo has generated for me.

I have an older laptop (1999 Gateway 9300, celeron 433 mhz, 256 Ram) and am interested to slim down to something smaller and faster than the Ubuntu I've been running for the past year. I have an extra 10GB hard drive, and would like to put four small distros on it to test: Tinyflux, AntiX, Puppy Linux, and Fluxbuntu. I was thinking to keep the root and home folders of each distro in separate partitions, requiring a total of 8 for those plus one swap, giving a total of 9 partitions.

I was thinking to separate the root and home into separate partitions because many people have commented on the forums that it is more convenient as well as safer to have one's personal data separate from the OS. But I noticed that you seemed to put the home and root directories of each OS in one partition. Does that mean you do not subscribe to the idea of separating them? Or perhaps rather, that it was just too many OS's to separate the home and root for?

Do you recommend that I separate the home and root into different partitions, or keep them together? And do you think there is benefit in my putting grub into a separate partition the way you did? Or given the smaller nature of my project, is it just as good to just use the grub menu of one of the four distros to run the whole thing? Thanks!

saikee
05-21-2008, 07:22 AM
Swarup ,

Welcome to Just Linux.

For maintenance purpose I prefer to keep each distro complete with its own set of /boot and /home. A common /home is doable but involves a lot of work because it keeps the desktop settings which can be different for different distros. So in theory it is a bad idea especially when you have to come up with the same user and group settings which each distro has a mind of its own.

I find it much better to have a data-only partition to store my personal information so that my photos, Word documents/spreadsheets, MP3 etc which can be used in any operating systems. Whatever I want to keep in /home I move it to my data-only partition. This way I can afford to lost any complete operating system without pain.

A common /boot does not work because every distro will dump its kernel and initrd files there and you will never know which kernel belongs to which distro even If none of them is overwritten. If you provide one partition per distro it will have /boot inside and so you can always identify the kernel and the boot loader just by the partition you’ve assigned to it. Thus if you install 4 distros you will have 4 boot loaders installed and any one can be “sourced” to take over the MBR to do the multi-booting.

My 145-system is a demonstration that every OS can be chainloaded. The only way I could show it is to put Grub in a data only partition because Grub has no master of its own.

Without an exception Grub must boot the Linux, that hosts Grub, directly by using “kernel” and “initrd” commands. It cannot chainload the Linux that hosts it because Grub will boot back itself in an endless loop. Think about it and you will understand. I described it as a dog chasing its own tail.

Putting Grub in a data-only partition does have the following advantages

(1) Grub is permanently available even if all Linux and other operating systems are removed.
(2) A Grub prompt is always available. One can learn far more about booting in a Grub prompt than working inside a Linux. Also there is no installed PC operating system in existence that cannot be booted up in a Grub prompt.
(3) One can use a MS Windows to boot up Grub if the data-only partition is a primary type. All it needs is to ask the MS Windows to make the primary data-only partition active. On the next boot the MS system’s MBR will fire up Grub instead of the Windows partition. That is something worth to have a go. The data-only partition needs to be one MS Windows supports like Fat16 or Fat32.
(4) Grub in a data-only is the easiest thing to set up. Just (1) format the data only partition, (2) Make a /boot/grub directory in the data-only partition, (3) copy stage1 and stage2 from a Linux into /boot/grub directory and (4) fire up a Grub shell and install Grub by command “root (hdx,y)” and setup “(hdx)” where x is the disk number and y is the partition number of the data-only partition. Thereafter a Grub prompt will appear in every boot. To control Grub one just write or copy a menu.lst into /boot/grub directory of (hdx,y).

I believe every Linux user will enjoy booting once he/she realise how simple the whole process has been arranged by Linux. Everything about booting I know was taught by the members and moderators here. So if you enjoy this thread you will enjoy Justlinux and the knowledge the members/moderators here are able to offer to you freely.

Swarup
05-21-2008, 10:19 AM
Thank you so much for your detailed and helpful reply. :) I think that on the point of /home and root architecture, I may not have been able to clearly express what I was planning: I was not thinking to create a single /home partition for common use by the four distros. Rather, I was thinking that there would be four separate root partitions (one for each distro), and four separate /home partitions (one for each distro). That gives a total of eight partitions i.e. "/" #1, /home #1, "/" #2, /home #2, "/" #3, /home #3, "/" #4, /home #4. Plus one swap for a total of 9 partitions. And I could add a 10th partition which would be a data partition housing personal data to be commonly accessed by all the distros.

In contrast, you are suggesting that I collapse the "/" and "/home" into one partition rather than having them in two separate partitions. In either case, each distro will have its own unique "/" and unique "/home". Just in the scenario I am suggesting, each distro will have its configuration settings in /home maintained separate from the root partition. Which gives the convenience I suppose, of being able to do a clean install or upgrade to a newer version of the distro in future, without having to save all the browser bookmarks and other settings from home, separately during the upgrade.

1. Do you feel it is worth creating separate unique home and root partitions for each distro as I have described above? Or is it simpler and better to just put each distro's root and home together in the same partition?

2. With regard to the single data partition where one will keep all word files, photos etc: What about one's mail folders for the email program? This is amongst my most important and critical data. Do you keep the mail data in the data partition as well, so it is accessed by all the distros using a same email program? And that way one could check and respond to email from within any distro, and the new email data thereby created would be accessible from within any of the four distros?

Or is that email data going to have to be kept in one distro's home folder. Let's say for argument's sake that Thunderbird is installed on all four distros. Can my TB profile folder be kept in the data partition and accessed by all? If so, then this would mean ALL my personal data is truly located in the data partition. And the only thing in the home folder would be the config files.

In reality the four distros do not come default with the same email client. But I suppose if I want to pursue a true separately maintained data partition in which all the personal data including mail and address book data would be accessible to all four distros, then the way to do it would be to install a single common email application such as TB, into each. Is that what you did, or what you would have in mind for the setup I describe?

saikee
05-21-2008, 12:02 PM
(1) As I favour one partition per distro I would not be in favour just to create an extra /home for each one. The root partition of each distro is its /. In operation /boot and /home are always subdirectories of /. Since kernel 2.6.20 Linux no longer support 64 device names for a hard disk and we can only get 16 device names instead. Leaving the name of the hard disk and the extended partition one can have a maximum of 14 usable partition regardless the size of the hard disk.

In my own working when I mount a distro partition I can access every file it has. Believe me after a while you may have a job to tell which partition is holding what. In my case I keep a sheet of paper tabulating each distro's partition name. I could also look up Grub's menu.lst as I put the name of the distro and the partition reference there too.

If you want a lot of partitions you may have to go with LVM but the installers of the 4 distros need to recognise it first.

(2) I have not stored email extensively in Linux as most free email sites would do this for me, like hotmail, Yahoo and gmail. For work-related emails, which are in Windows, I have them stored offline in the hard disk and do backups regularly. I am probably not in a position to advise you how to pull different emails from different distros into a central location. May be the volume of my emails isn't large I find either hotmail or gmail is big enough to store all my emails permanently online.

My ISP is AOL and it also keeps all my emails permanently online.

Swarup
05-21-2008, 12:56 PM
Thank you-- that is very clear. I'll go ahead and keep the "/" and "/home" in the same partition. And as for email, I think I understand what to do. TB allows one to put its profile folder wherever you want, so all the distros could access it from the separate data partition. And other email programs probably do similarly.

There is only one issue that remains unclear for me, and that is that of setting up the boot menu in grub. Whether I use one of the four distros' grub installation wizard at the time of install, or whether I put in the lines manually into the menu.1st file later on, there is certain information one needs in order to have the three lines in the menu.1st file about each distro be accurate and work properly. THIS is what I need to know. --How to list the information correctly about each distro in the menu.1st file, so it will boot to each distro. (Last time I tried to do this, the Tinyflux grub installer did not get the AntiX listing correct and I could not boot into AntiX until I had the AntiX livecd redo grub from its own partition. Then both AntiX and Tinyflux would boot. But I'd rather use the Tinyflux installer so that that distro becomes the default distro to load.) I want to know though what information I need, and how to list it. It seems like one needs to know the kernel each distro uses, right? How do you find that out before installing it? Is there a place where one can go to copy the three lines for each specific distro, and then just paste it?

Add: I think I understand now. Someone told me on another forum that once all the distros are installed, I can use the working distro's grub to boot to that one and from there browse into each of the other distros' own grub's menu.1st file and copy the three boot lines from there into the grub install which I'm going to use. Is that the idea?

= = = = = = = = = = = = =

Also, if I should opt to do the grub in a separate partition as you detail below, there are a few steps there which are not clear yet for me:

(4) Grub in a data-only is the easiest thing to set up. Just (1) format the data only partition, (2) Make a /boot/grub directory in the data-only partition, (3) copy stage1 and stage2 from a Linux into /boot/grub directory and (4) fire up a Grub shell and install Grub by command “root (hdx,y)” and setup “(hdx)” where x is the disk number and y is the partition number of the data-only partition. Thereafter a Grub prompt will appear in every boot. To control Grub one just write or copy a menu.lst into /boot/grub directory of (hdx,y).

"Make a /boot/grub directory in the data-only partition": So I guess in order to do this, I need to boot up into a different HD. Then I connect this HD I am creating as an external HD, browse to the data-only partition, and creat a "boot" folder and then within that a "grub" folder. Is that the point?

"copy stage1 and stage2 from a Linux into /boot/grub directory": I don't know what this refers to. What is "stage1" and "stage2" and where do I get it?

The 4th step would need more step by step instructions for me in lay language. "Fire up a Grub shell" -- what does it mean? Where do I do that, and how?

"command “root (hdx,y)” and setup “(hdx)” where x is the disk number": So I would be executing all this from a terminal window in another HD, right? And the disk number I would get by seeing the disk # assigned to the external HD by gparted? But that disk number would change as soon as I install the new HD into the laptop.

saikee
05-21-2008, 07:39 PM
You can write your own menu.lst or just edit any one from a selected distro.

Say if you have Linux A with Grub controlling the MBR then that Linux will be booted directly. The remaining Linux B, C and D can then be booted indirectly by chainloading each with 3 lines like
title Linux B in partition (hd0,5)
root (hd0,5)
chainloader +1
You can add the above line even before you install Linux B.

During installation you just make sure Linux B is installed into the 6th partition of the 1st hard disk or (hd0,5) and instruct its installer to put Grub (work equally well for Lilo) inside the root partition or (hd0,5).

After installation Linux B will become bootable. Just repeat the same for Linux C and D by specifying the correct partition number.

Regarding how to prepare Grub in a separate partition the current thread Post #3 has a full set of Bash commands listed. I copied and pasted them here
mkdir /mnt/hda3
mount /dev/hda3 /mnt/hda3
mkdir /mnt/hda3/boot
mkdir /mnt/hda3/boot/grub
cp /lib/grub/i386-pc/* /mnt/hda3/boot/grub
grub
root (hd0,2)
setup (hd0)
quit
Commands in blue are issued in Bash root terminal. Those in red are inside a Grub shell.

Grub is just one of the many program you can run in a Linux terminal. To activate it you just type
grub
Once Grub is activated you will be working inside a shell. All the commands are to Grub's convention until you leave the shell by command
quit
and drop back to a Linux terminal.

stage1 and stage2 are all the Grub's system files needed to run Grub. For how I find it in directory /lib/grub/i386-pc/ I suggest you read Post #3 again. It is more rewarding if you try to think/understand the intention of every command.

At anytime you can ask Grub to tell you the partition layout by commands in a Grub shell
grub
geometry (hd0)
geometry (hd1)
quit

I think you are quite near to it. All you need is get yourself into a root terminal and try out a Grub shell.

Swarup
05-21-2008, 10:39 PM
You can write your own menu.lst or just edit any one from a selected distro.

Say if you have Linux A with Grub controlling the MBR then that Linux will be booted directly. The remaining Linux B, C and D can then be booted indirectly by chainloading each with 3 lines like
title Linux B in partition (hd0,5)
root (hd0,5)
chainloader +1
You can add the above line even before you install Linux B.

During installation you just make sure Linux B is installed into the 6th partition of the 1st hard disk or (hd0,5) and instruct its installer to put Grub (work equally well for Lilo) inside the root partition or (hd0,5).

After installation Linux B will become bootable. Just repeat the same for Linux C and D by specifying the correct partition number.

I see. So Linux A with Grub controlling the MBR, its entry in menu.1st is slightly more complex with an extra two lines (for kernel and initrd). While the remaining three distros-- Linux B,C, and D, will have only three lines: Title, root, and chainloader. Now the title-- can you make that whatever you want? Or is there a fixed convention by which the title is made? For example, you made as the title "Linux B in partition (hd0,5)". But here below in the entry for the hard drive I'm using now, it reads as below. There, there is no mention of the location of the distro in the title line the way you gave it. And the kernel is described in the title line, whereas in your example that is not done. So for the title then, can one put whatever one wants there?


title Ubuntu 8.04, kernel 2.6.24-16-generic
root (hd0,4)
kernel /boot/vmlinuz-2.6.24-16-generic root=UUID=372f0ec5-49da-4f2d-970d-550651cf9364 ro quiet splash
initrd /boot/initrd.img-2.6.24-16-generic
quiet

title Microsoft Windows XP Professional
root (hd0,0)
savedefault
makeactive
chainloader +1

And for the "root" line, just the location of the root directory is needed. And there (0,5) means the 1st hard disk, 6th partition. How does this convention work: why does "0" mean the 1st hard disk, and why does "5" mean the 6th partition?

Then the term "chainloader +1" will always appear just like this for every distro Linux B,C,D, after Linux A?

(I am studying what you gave about how to put grub in its own data partition. The info is very helpful and I understand it better now, thank you.)

saikee
05-22-2008, 05:56 AM
The "title" line is for Grub to display on the screen whatever you wish to tell yourself. As far as Grub is concern it is just a line of text it has to display.

Grub always counts from zero. So (hd0) is the 1st disk and (hd0,0) is the 1st partition of the 1st disk and so.

"Chainloader +1" means the current Grub will cut and discard itself from the 2nd sector onward and paste the remainder with another bootloader specified by the "root" statement at its "+1" (or the 2nd sector) position. In otherword Grub boots another boot loader and passes the control to the 2nd boot loader. It is a child play once you know it.

The beauty of chainloader is the 2nd boot loader does has to be Grub and can be any boot loader used on the PC. That is the magic and power of Grub. Chainloading is also used by every boot loader but not as well defined as in Grub.

Chainloading is used if Grub cannot read the filing system of the system it has been asked to boot. Therefore if you issue the "kernel" and "initrd" commands for a ntfs partition Grub can't execute them because Grub can't read its files. Also if the operating system has no defined kernel, like the MS systems, then the only way to boot a foreign system is by chainloading.

It is just not a widely known knowledge that Linux can chainload another Linux as most users and distro developers are used to do direct booting.

You don't have to use chainloading at all for Linux. Just copy the appropriate menu.lst section of the installed Linux B, C and D into the menu.lst of Linux A. Grub can boot every Linux directly this way.

In chainloading one boot loader boots another boot loader. It is simpler. The amazing thing of it is you can set up the menu.lst even before you install any of the systems as you don;t need to know their kernel and initrd names.

Thus basically you need one Grub to boot its master Linux A directly as indicated by the "kernel" and "initrd" of your Ubuntu.

Thereafter Ubuntu's Grub can chainload the next 200 operating systems if you install them.

The picture is a lot simpler than you think.

Swarup
05-22-2008, 10:34 AM
Wow. NOW it is all starting to make sense. What you wrote in your last post really put it all together for me. Thanks!

Now, in a previous post you had written, "During installation you just make sure Linux B is installed into the 6th partition of the 1st hard disk or (hd0,5) and instruct its installer to put Grub (work equally well for Lilo) inside the root partition or (hd0,5)."

My question is this: I was bad and did not follow the above guidance about "instructing its installer to put Grub...inside the root partition". Last night I installed the four distros onto my hard drive, each with its "/" and "/home" in the same partition as you instructed. Each of the four is a separate logical partition in my Extended partition (sda2). Sda1 is swap, and sda3 is my ext3 data partition. But I believe that the default for the boot loader in each distro's install was to set up grub in the MBR rather than in its own root partition. And I accepted that. Is this going to be a problem for me? Will I still be able to follow the shortcut way of adding Linux B,C, and D to Linux A's boot menu by the simple three-line (Title, root, chainloader +1) entry? Or will I have to instead "copy the appropriate menu.lst section of the installed Linux B, C and D into the menu.lst of Linux A". Or will neither of these two methods work, because of the fact that I let each distro's install default the grub setup to the MBR?

saikee
05-22-2008, 12:13 PM
I would say out of a 100 Linux distros I could only name about 1 distro that has no otption to install the boot loader other than the MBR. So keep an eye on the installer like a hawk and you should find the facility!

In any case in a Grub shell you can put Grub back into its root partition, say it is (hd0,5) thereby making the partition "chainloadable" by commands
root (hd0,5)
setup (hd0,5)
In fact you can let each of the Linux A, B, C and D to enjoy the warmth of the MBR. Let say you have installed them in partition (hd0,5), (hd0,6), (hd0,7) and (hd0,8).

Assuming you want Linux A in (hd0,5) to control the MBR so have the menu.lst edited along the line I have suggested. You can then put Linux A in the MBR and Linux B, C and D chainloadable in one sweep commands of Grub as follow
root (hd0,5)
setup (hd0)
root (hd0,6)
setup (hd0,6)
root (hd0,7)
setup (hd0,7)
root (hd0,8)
setup (hd0,8)

I hope you now believe booting in Linux is child play!

Learn to use a Grub shell or Grub prompt and you can kiss all your booting problems good bye. The difference between the two is the latter is what you get before a Linux or any system is booted . Once Linux is booted you get only a Grub shell which is controlled by the kernel.

Swarup
05-22-2008, 12:51 PM
(Add: This post was written and posted before I saw the one from you just above. So all the work below was done while each distro's grub was still set to MBR and not root. But since the work was done using copy and paste of the original boot menu entry from each distro, then for the purposes of the work that was done below, I don't think it should matter.)

I went ahead and tried to set it up myself in the mean time, using the method of copying and pasting the entry from the menu.lst of each distro B,C,D into that of A. I got mixed results. Linux A is Tinyflux (a distro based on PCLOS), and that of course boots up fine. The other three distros are AntiX, Fluxbuntu, and Puppy 4.0 (their "frugal" install). Puppy also boots up just fine. Fluxbuntu tried to boot up for what I thought was an extraordinarily long time, and in the end gave an error message that the file system check failed. It then gave a command prompt, and said to type cntrl-D to reboot. I typed cntrl-D, and to my astonishment instead of rebooting, it completed its boot and immediately booted successfully! But even then, something funny is going on with it. I know, because when I first installed it and used its own grub to boot with, it booted fine. And finally, AntiX would not boot at all-- gave an error immediately "Bad file or directory type".

Here below is the menu.lst which I made (by adding lines to the Linux A (Tinyflux) boot menu):

timeout 15
color black/cyan yellow/cyan
gfxmenu (hd0,5)/usr/share/gfxboot/themes/pcfluxboxos/boot/message
default 0

title Tinyflux
kernel (hd0,5)/boot/vmlinuz BOOT_IMAGE=linux root=/dev/hda6 acpi=on resume=/dev/hda1
initrd (hd0,5)/boot/initrd.img

title failsafe
kernel (hd0,5)/boot/vmlinuz BOOT_IMAGE=failsafe root=/dev/hda6 failsafe acpi=on resume=/dev/hda1
initrd (hd0,5)/boot/initrd.img

title AntiX (MEPIS at sda5, newest kernel)
root (hd0,4)
kernel /boot/vmlinuz root=/dev/sda5 nomce quiet splash vga=791 resume=/dev/sda1
boot

title Fluxbuntu (Ubuntu 7.10, kernel 2.6.22-14-generic)
root (hd0,6)
kernel /boot/vmlinuz-2.6.22-14-generic root=UUID=304dc21f-1de9-49bb-8807-6fe85da66403 ro quiet splash
initrd /boot/initrd.img-2.6.22-14-generic
quiet

title = Puppy (4.0)
rootnoverify (hd0,7)
kernel /boot/vmlinuz root=/dev/ram0 loglevel=3 PMEDIA=idehd
initrd /boot/initrd.gz

So as I say, Tinyflux and Puppy both boot up fine. Fluxbuntu booted but with great delay and difficulty, and AntiX would not boot at all. (I know that all these distros boot fine to their own grub, because I tested them.)

Here is the error message given when I select AntiX from the boot menu I made:

root (hd0,4)
File system type is ext2fs, partition type is 0x83
kernel /boot/vmlinuz root=/dev/sda5 nomce quiet splash vga=791 resume=/dev/sda1

Error 2: Bad file or directory type

It is odd, because the root location is correct, but the file system type is in fact ext3, NOT ext2. Don't know why grub is thinking it is of type ext2.

Here is the error I get with Fluxbuntu. After around 7-8 minutes of going through the motions of booting (Fluxbuntu doesn't show the actual lines of code--there is an image on the screen during the time), I get the following error message:

fsck.ext3: unable to resolve 'UUID=9938fd2e-3823-4de1-8d38-9eef0263625d'
fsck.ext3: unable to resolve 'UUID=7970934e-390d-4842-9460-b4a1ba63cecc'
1 dev/sda8: clean, 16/47232 files, 28016/188755 blocks
fsck died with exit status 8 [fail]
file system check failed
A log is being saved in /var/log/fsck/checkfs if that location is writable
Please repair the file system manually
A maintenance shell will now be started
[==> command prompt appeared]
Control-D to reboot system
[I did Control-D]
[Then the system proceeded immediately to the login screen after a fast show of several lines of code, and from the login screen went successfully to a functional desktop.]

So what is wrong with the AntiX and Fluxbuntu grub menu listings? The listing is the exact replica of what I found in their respective root's grub menus. What do I need to do to fix this, so that all four distros will boot up properly?

saikee
05-22-2008, 01:42 PM
From my experience with the Ubuntu family distros they like to fsck every partition you have got and so the delay isn't to do with the booting but let the distro to stick its nose into other partitions.

I usually have to go to the /etc/fstab to disable the partition-to-partition checking. I don't have the patience of seeing it to scan the 150+ partitions in my PC ( for the 145 systems). Many distros try to be clever and this is not always to their own good.

Your AntiX menu looks OK to me. What I would do in your case is to drop all the trimming and boot the system up manually by pressing "e" for edit on the AntiX choice. I would edit the entry as
title AntiX (MEPIS at sda5, newest kernel)
root (hd0,4)
kernel /boot/vmlinuz root=/dev/sda5 ro
boot
or try "rw" intead of "ro" just to see if the distro boots.

You might have missed out the initrd statement there too.

In any case you can put Grub inside root partition of (hd0,4) and boot it up by chainloading. To do this at the boot up screen do not select a system to boot but just press the "c" key to drop into a Grub prompt. Then type these lines at the terminal
root (hd0,4)
setup (hd0,4)
chainloader +1
boot
The above is for you to boot AntiX with its own menu.lst in its original state as prepared by the installer.

If your AntiX has booted successfully when you installed its Grub into the MBR then the chainloading will fire it up.

Swarup
05-22-2008, 03:27 PM
The experience and expertise you have in this area is incredible. Whatever problem comes, you have the answer. Again, this last post you have given is marvelous. Such insight! I am making my way through your post, one by one dealing with the issues your raised. Here is the first one:

From my experience with the Ubuntu family distros they like to fsck every partition you have got and so the delay isn't to do with the booting but let the distro to stick its nose into other partitions.

I usually have to go to the /etc/fstab to disable the partition-to-partition checking. I don't have the patience of seeing it to scan the 150+ partitions in my PC ( for the 145 systems). Many distros try to be clever and this is not always to their own good.

After looking at the concerned fstab file, I am sure you are correct about this. Here I am pasting for you the file. Can you look at it and tell me how to disable the partition-to-partition checking.

# /etc/fstab: static file system information.
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
# /dev/sda7
UUID=304dc21f-1de9-49bb-8807-6fe85da66403 / ext3 defaults,errors=remount-ro 0 1
# /dev/sda3
UUID=772e77f7-1e6f-4474-bc33-7b5fe8843eb5 /media/sda3 ext3 defaults 0 2
# /dev/sda5
UUID=9938fd2e-3823-4de1-8d38-9eef0263625d /media/sda5 ext3 defaults 0 2
# /dev/sda6
UUID=7970934e-390d-4842-94b0-b4a1ba631ecc /media/sda6 ext3 defaults 0 2
# /dev/sda8
UUID=9b33370d-b246-487d-a470-f05121874f49 /media/sda8 ext3 defaults 0 2
# /dev/sda1
UUID=193e5b03-3cc4-44bd-9e20-158467acae8b none swap sw 0 0
/dev/scd0 /media/cdrom0 udf,iso9660 user,noauto,exec 0 0
/dev/fd0 /media/floppy0 auto rw,user,noauto,exec 0 0

Do I have to turn something "off" in this file, or do I have to delete those lines related with other partitions? Or comment them out with "#"? If so, exactly which ones? What should be done?

Your AntiX menu looks OK to me. What I would do in your case is to drop all the trimming and boot the system up manually by pressing "e" for edit on the AntiX choice. I would edit the entry as
title AntiX (MEPIS at sda5, newest kernel)
root (hd0,4)
kernel /boot/vmlinuz root=/dev/sda5 ro
boot
or try "rw" intead of "ro" just to see if the distro boots.

Ok. I'll try it and see how it goes.

You might have missed out the initrd statement there too.

Actually, I went back to confirm again and in fact there is no initrd statement in the AntiX entry. Don't know why.

Add: Actually, I'm just going to do the setup for chainloading AntiX as you suggested. That seems the easiest and the surest shot.

Swarup
05-22-2008, 04:25 PM
In any case you can put Grub inside root partition of (hd0,4) and boot it up by chainloading. To do this at the boot up screen do not select a system to boot but just press the "c" key to drop into a Grub prompt. Then type these lines at the terminal
root (hd0,4)
setup (hd0,4)
chainloader +1
boot
The above is for you to boot AntiX with its own menu.lst in its original state as prepared by the installer.

If your AntiX has booted successfully when you installed its Grub into the MBR then the chainloading will fire it up.

I tried to do this just now. I started the computer, and at the grub menu I typed "c". The letter "c" appeared in the lower right of the screen, but nothing happened. No Grub prompt appeared. So I thought, maybe I need to hit "enter" in order for the "c" to process. I hit "enter", but when I did that, grub just booted to the default OS-- Tinyflux. And that's where I am now. I thought, while I'm here I'll see if I can get the work done in terminal. So I opened a superuser terminal window and opened grub. (I can't figure out how to copy and paste from the terminal/grub window into this post, so I'll have to type out what happened. [How do you paste from this terminal window?])

In the grub shell I typed

root (hd0,4)
result came: filesystem type is ext2fs, partition type 0x83
setup (hd0,4)
result came: checking if "boot/grub/stage1" exists .... no
checking if "grub/stage1" exists ... no
Error 2: Bad file or directory type

What happened? Why couldn't I do the work at the grub boot menu screen? And why couldn't I do it once booted into Tinyflux, in the grub shell?

saikee
05-22-2008, 05:45 PM
If you want a Grub prompt put a # in front of the gfxmen statement like this
#gfxmenu (hd0,5)/usr/share/gfxboot/themes/pcfluxboxos/boot/message
What you have done was to trade the Grub prompt in for a bit of graphic look at the boot screen by using a gfxmenu statement inside menu.lst. The # tells Grub to ignore that line.

You should get a Grub prompt now so try to boot up AintX manually.

In a terminal mode you can use the mouse to highlight the text, right click the mouse button to select copy.

Don't know your AntiX setup but if it has a menu.lst as you have claimed to be able to copy the booting commands from then it must have stage1 and stage2 in /boot/grub directory of (hd0,4).

Swarup
05-23-2008, 12:36 AM
Thanks very much for the info on the grub prompt. I just tried it, and for some reason I failed to get it to work as a grub prompt. What I am understanding is that at the screen where all the distros appear in menu form and you choose which one you want to boot to-- at that screen there is a window at the bottom of the screen in which the address of the chosen boot path appears, and in which one can also write. In that window, I moved the cursor as far to the left as it could go, and typed "# c". But upon hitting "enter", the computer just booted to whatever distro the cursor had last been on. Don't know if I tried to put this in the proper place?

Also, please see post #104, about partition-to-partition checking. Because I posted twice in a row (#104 and #105), I think #104 may have sneaked in without being noticed.

saikee
05-23-2008, 04:15 AM
This line with edition in red is to be implemented in menu.lst
#gfxmenu (hd0,5)/usr/share/gfxboot/themes/pcfluxboxos/boot/message
Similarly to ask the kernel not to fsck partition /dev/sda3 you change the line from
# /dev/sda3
UUID=772e77f7-1e6f-4474-bc33-7b5fe8843eb5 /media/sda3 ext3 defaults 0 2
to
# /dev/sda3
UUID=772e77f7-1e6f-4474-bc33-7b5fe8843eb5 /media/sda3 ext3 defaults 0 0
The partition sda3 will still be mounted but not checked. or
# /dev/sda3
#UUID=772e77f7-1e6f-4474-bc33-7b5fe8843eb5 /media/sda3 ext3 defaults 0 2
In this case the partition is not mounted because any command line prefixed with a # is not executed.

Take your pick.

Swarup
05-23-2008, 10:14 AM
Wow, that worked out great and it wasn't even hard. I took care of the cross-partition checking, commenting out the lines for all the other partitions as you indicated. And it worked beautifully. (Fluxbuntu does still seem to take a bit longer than the other distros to boot, but it does so errorlessly and without any hitch. :) )

Now, as for AntiX-- I changed the entry for it in my current grub's menu.lst file to read:

title AntiX (MEPIS at sda5, newest kernel)
root (hd0,4)
setup (hd0,4)
chainloader +1
boot

Should that work?

When I select Antix in the boot menu, I still get the same error as I was getting before i.e. (1) that there is no stage 1 or stage 2, and (2) Bad file or directory type.

But in AntiX's own grub (hda5/boot/grub) folder, there are 15 items including the menu.lst file, two others called "stage1" and "stage2", and then there several others as well which you know about I'm sure. So why would it be saying there is no stage1 or stage2?

Anyhow, if this is going to be a difficult one to solve, then I could just boot up to the AntiX livecd and have AntiX rebuild the entire grub boot menu according to its own standard. I did that once before during a previous install on this hard drive, and AntiX was able to make everything including itself boot up just fine. I just wasn't necessarily wanting AntiX to be the default distro for boot up, but that isn't a big deal.

saikee
05-23-2008, 11:43 AM
Think I need to take you by the hand on this one again.

The commands of
root (hd0,4)
setup (hd0,4)
chainloader +1
boot
were meant for you to issue them at a Grub prompt.

Basically the first two lines setup up Grub in the boot sector inside (hd0,4) thereby making the partition chainloadable.

Thereafter your entry in the menu.lst (of the one in the MBR) can be arranged as
title AntiX (MEPIS at sda5, newest kernel)
root (hd0,4)
chainloader +1
In other word you only need to setup up Grub once.

The reason I combined the two was because when you are in the Grub prompt you can do "setup" first and then booting Antix second or to execute one immediately after the other. My intention was to demonstrate to you the "root" statement in this case only needs to be issued once.

My recommendation for you to use the chainloading is for you to boot up the original menu.lst compiled by the ANtiX installer. Your current failure may be due to a mistake you have made in copying the booting instructions from one menu.lst to another.

In any case once you get rid of the fgxmenu you can get yourself into a Grub prompt and try the commands listed at the very beginning of this post.

If it still fails you can tell ask Grub to report to you in which partition it has stage1 by command
find /boot/grub/stage1
If the stage1 is indeed inside (hd0,4) then your AntiX should boot, otherwise you may have to copy the two files stage1 and stage2 from another Linux.

Swarup
05-23-2008, 02:07 PM
Yes, I had understood that you wanted me to put those commands in at a grub prompt. But when yesterday I had tried them in a grub shell and they didn't work--giving the error message I had told you--then I figured a grub shell and a grub prompt are probably the same thing just one inside the OS and one outside it. So if that's the case, I figured, then it is just going to give me the same error at a grub prompt as it did at the grub shell. And that's why I (foolishly) tried to just put it into the menu.lst.

But I will try to do it now as you have instructed, at the grub prompt, and let us see what happens.

Would you kindly just let me know how I would issue the order to boot to, say Puppy (sda8), from the grub prompt in case the AntiX order doesn't work out? (Without changing the Puppy boot to chainload type. Just a one-time manual boot. Would it be "root (hd0,8)", and then "boot"?). That way at least I'll be able to boot into an OS so as to change the grub boot menu back to the GUI.

I do not really think the problem I am having with the AntiX boot is because of not copying and pasting correctly from the AntiX menu.lst file-- I've checked it multiple times, and it looks exactly proper.

So I am wondering whether perhaps the grub utility in AntiX is different somehow, that AntiX requires it for a proper boot? Just a guess. :)

saikee
05-23-2008, 04:15 PM
I have more faith in Grub than others and believe if the files are there Grub will work out.

There is a huge difference between a Grub prompt and a Grub shell!

A Grub shell is one you get after you have booted into a Linux. There is no chance you can boot another Linux inside a kernel! although there is a program for you to wind down the Linux to do just that it is not commonly used.

You can only boot up a system in a Grub prompt and that is what Grub would be before it hands over the control to a kernel. Remember in a Grub shell Grub can see every USB drive because the kernel privides the drivers to read them. Whereas in a Grub prompt Grub has no USB driver and so it can only read one USB drive if that has been nominated by the Bios as the first bootable device. There are other bits and pieces that you can't do in one but can in another but the main difference is you cannot boot another Linux inside a Grub shell. Just think of it a Grub shell is managed by the kernel. Would the kernel be happy to let Grub kill itself and load another kernel in? It is equivalent to the MS Windows protected mode.

Regarding booting up Puppy in sda8 assuming you only have one disk then sda8 will be known to Grub as (hd0,7).

If Grub is inside the root partition of sda8 then it will boot in a Grub prompt by commands
root (hd0,7)
chainloader +1
boot
If you have not put Grub inside its root partition you can still boot it up with commands
root (hd0,7)
configfile /boot/grub/menu.lst

You should know by now that Grub only boots a system by its partition reference. You need the "title" statment in a menu.lst but not in a Grub prompt. The "boot" statement is mandatory in a Grub prompt but optional in a menu.lst. Otherwise you can use all the commands in a menu.lst in manual booting with a Grub prompt.

Grub is also the best booting teacher in the world and you can pick up one hell of knowledge by booting systems manually in a Grub prompt. If there is a line Grub cannot execute it always tells you with the explanation. No response means your command has been exceuted without error.

Swarup
05-23-2008, 05:41 PM
Regarding booting up Puppy in sda8 assuming you only have one disk then sda8 will be known to Grub as (hd0,7)...You should know by now that Grub only boots a system by its partition reference.

Yes, thanks-- I was in a rush to go out, and in my haste referred to sda8 as (hd0,8). But you've taught me this point earlier, and I understand.

I'm out at work right now and won't be able to test the grub prompt boot until I get home--I'll let you know how it goes.

On the subject of partition numbering though, one question: If Swap is sda1, the extended partition is sda2 with four logical drives inside sda5-8, and the data partition is sda3, then what happened to sda4? Why isn't the number "4" being used?

And thank you for all the education about grub prompts and shells just above. As well as how to word the boot commands at the grub prompt. I hope and know that many others who read through this will benefit tremendously as well!

saikee
05-23-2008, 06:01 PM
Within the 512 byte in the MBR the first 446 bytes are computer code.

Between the 447th to 510th position there are 64 bytes divided into 16 bytes each for recording sda1 to sda4 generally known as the 4 primary partitions.

If you use logical partition then one of them must be converted into an extended partition. In you case you did so after creating sda1 as swap so sda2 was used up automatically for the extended partition.

Currently the last 16 bytes of the partition table are empty but you may also run out of disk space.

In an extended partition its 16 bytes has the information of the beginning sector of the first logical partition and the last sector of the last logical partition. Each logical partition has to carry the hard disk address of the next logical partition. Thus an operating system requires a scan outside the 64-byte partition table in order to establish the full set of the logical partitions which always start at the 5th position.

The first time you create a logical partition the next unused/vacant primary partition name will be used up as the extended partition. Therefore if you start from a raw disk with a logical partition the first partition you create is sda5. sda1 disappears as the extended partition and the first primary you can create become sda2.

If you use cfdisk to partition the hard disks you will see how the system works in front of your eye.

I refer to the above as the PC standard and it is the same in which ever operating system you work with. MS is trying to change it but so far without success.

Swarup
05-25-2008, 01:50 AM
The commands of
root (hd0,4)
setup (hd0,4)
chainloader +1
boot
were meant for you to issue them at a Grub prompt.

I did it at the Grub prompt tonite, and still got the same error there as when I had done it in the grub shell. When I did the root (hd4,0) command it was fine with that, and stated the filesystem type. When I then did setup (hd0,4) it gave the error that it could not find stage1 inside boot/grub. And then said "Bad file or directory type".

If the stage1 is indeed inside (hd0,4) then your AntiX should boot, otherwise you may have to copy the two files stage1 and stage2 from another Linux.

So I booted up into Puppy, and deleted the stage1 and stage2 which were there inside the sda5 boot/grub folder. And then copied and pasted the stage1 and stage2 from sda6 (which I am booting with everyday), into sda5. And tried it again. ....Still the same error.

If it still fails you can tell ask Grub to report to you in which partition it has stage1 by command
find /boot/grub/stage1

I did that, and got the reply:

sda5
sda6

So it sees that the AntiX (sda5) boot/grub folder has stage1 in it when I do the find command. But when I go to execute it and get AntiX to boot up, then it gives the reply that there is no stage1 in hd(0,4).

Also of curiosity is that the "find" command did not find the stage1 in sda7 (Fluxbuntu). And that OS boots up just fine.

saikee
05-25-2008, 04:43 AM
OK in your case it may be better to cut the loss by re-installing AntiX in sda5. This time make sure the partition is formatted and mounted as /.

I couldn't explain why no stage1 in sda7 or (hd0,6). It is possible that stage1 could be in /boot instead of in /boot/grub. What you can investigate is boot up any Linux and as Linux to find all the stage1 in every mounted partition inside / for you by command
find / -name stage1
needless to say you need to mount sda7 in the boot up Linux or just use Fluxbuntu itself.

Swarup
05-25-2008, 09:35 AM
OK in your case it may be better to cut the loss by re-installing AntiX in sda5. This time make sure the partition is formatted and mounted as /.

Ok. Before I do so, I'll just mention that earlier, prior to formatting my HD to establish the current setup, I had installed just two distros: Tinyflux (which is the now sda6 and whose grub is managing the current MBR boot menu), and AntiX. And at that time also, I had installed Tinyflux second so that it would manage the boot. And then also, it was unable to boot up AntiX. And I had been in touch with the AntiX developers with it via their support forum. They had given several different suggestions for how to word the AntiX lines in Tinyflux's boot menu. Ultimately, even they could not get it to work, and had suggested:

You could install antiX's grub to the MBR and overwrite the Tinyflux one and add the lines you have for Tinyflux to the antiX-mepis grub menu.

To do that, boot antiX livecd, and open a terminal, sux to root password and type msystem.
There is an option to re-install grub.
Put it in the MBR from the antiX partition.

So I did that, and then both AntiX and Tinyflux booted fine. I didn't even have to "add the lines you have for Tinyflux to the antiX-mepis grub menu". It all just worked.

1. It's odd that when AntiX manages the boot, then it is able to boot itself up just fine. But if Tinyflux (or perhaps any other) OS is managing the boot, then AntiX doesn't seem to be able to be booted.

2. I could do what the AntiX developers suggested last time, again this time. (If I were to do so, do you think AntiX would be able to select out of Tinyflux's current menu.lst, the appropriate lines since it has lines for all the four OS's there? Even if not, I could just paste them in later.)

3. If I do the reinstall of AntiX in Sda5, and put its grub in /, then you think it would be a pretty sure shot to work even though we couldn't move it to / using the grub prompt?

I couldn't explain why no stage1 in sda7 or (hd0,6). It is possible that stage1 could be in /boot instead of in /boot/grub.

I am in Puppy now-- I just browsed to sda7 and found that Fluxbuntu's stage1 is indeed located right in /boot/grub. Odd.

What you can investigate is boot up any Linux and as Linux to find all the stage1 in every mounted partition inside / for you by command
find / -name stage1
needless to say you need to mount sda7 in the boot up Linux or just use Fluxbuntu itself.

Just now tried it in Puppy, with sda7 mounted. It gives the result:

Error 15: File not found

saikee
05-25-2008, 11:01 AM
I know some distros modify Grub to get to do to extra things but I would rather stick a standard Grub in the MBR and forget all those fancy bits, especially to do with gfxmenu etc. It is possible that your AntiX has bugs making the standard working of Grub erratic.

Regarding your Puppy it will not have Grub if it is a Live CD installation which is called a Frugal install. Some small distros do not keep a permanent root filing system but start every boot up from new as running a Live CD from the original iso. Your Puppy booting instructions certain point to that direction. You can install Puppy properly as a normal installation which it also supports.

Swarup
05-25-2008, 11:27 AM
I know some distros modify Grub to get to do to extra things but I would rather stick a standard Grub in the MBR and forget all those fancy bits, especially to do with gfxmenu etc. It is possible that your AntiX has bugs making the standard working of Grub erratic.

I see. Makes sense.

Regarding your Puppy...

Yes, that's true mine is a frugal install, and so my Puppy has no grub. But in the above post I was just mentioning that I was booted to Puppy; my point was that I browsed to the Fluxbuntu (sda7) partition and found that the stage1 file is indeed in /boot/grub. And that despite having mounted sda7 (Fluxbuntu), the "find" command you gave for locating all the "stage1" files in mounted partitions, did not find the stage1 in Fluxbuntu. Just a funny quirk I guess, nothing critical.

Swarup
06-05-2008, 10:28 PM
Saikee, I want to thank you for all the help and generous education you gave to me. I really learned alot. Now I am able to manage my partitions on my own for the most part. All due to what you taught me. :)

Another question has cropped up on the way, and I am wondering if I may ask it to you? Here is the question: Can one shrink a partition from its LEFT side using gparted (Parted Magic)?

I have a triple boot WinXP/Ubuntu Hardy/Puppy Linux 3.01 (frugal). Looking at the partitions in gparted, they are going from left to right: WinXP/Hardy/Puppy/Swap. WinXP is a primary partition sda1, then there is an extended partition sda2 inside of which are three logical parititions: Hardy (sda5), Puppy (sda7), swap (sda6).

My question is this: I need to expand the WinXP partition by around 2 GB. The only way to create the space is to shorten the Hardy partition from Hardy's LEFT side, so that space is created on WinXP's right side for WinXP to expand into. But of course, all of Hardy's material is on the left half of the partition, and the free space is on the right half of the Hardy partition. If I select to RESIZE (shrink) the Hardy partition from the LEFT side, will Hardy move all its folders etc safely toward the right half of the partition so as to shrink the left side? Or is shrinking from the left side problematic and one can only shrink from the right side (in which case, I am in problem).

add: I have also asked this question on the following Ubuntu thread: http://ubuntuforums.org/showthread.php?p=5125229#post5125229
I don't think anyone knows quite as much as you do about these things, but I give you the link in case you may find it interesting to see what others have said about it.

saikee
06-06-2008, 11:00 AM
Swarup,

Keep coming with the good words and I might just be able to persudae the Justlinux Admin to upgrade my company bicycle to a company Ferrari, even I haven't seen my company bicycle yet!

I am just a pupil here starting as an absolute beginner a few years back. Wait until you see my teachers and the village olders here. The big guns are among the members and the super moderators here. I am helping others in exactly the way I was helped. I just pray they are not disappointed me as a byproduct of the Justlinux forum.

The answer to your question should be yes but I have not done a full example recently.

You can shrink a partition on either to the left or to the right or even on both ends but you need to know the following

(1) It is best to do one shrink at a time.

(2) It is essential that you never shrink the partition that is providing the operating in use. Think about it and you will understand. No one will be please to return home to find it half the size. There is something to do with the integrity of the OS too. No decent OS would permit itself to be shrunk "while" operating. In other word use Linux A to shrink Linux B.

(3) Linux boot loaders, both Grub and Lilo, work by refering to the hard disk address of the partition, the form of which cylinder, head and sector. Once a partition has been shrunk the original hard disk address is void and so either Grub or Lilo will need to be restored. The Just Booting Tips (http://www.justlinux.com/forum/showthread.php?t=144294) Section B has all the details to do such restores.

(4) If you shrink a logical partition sda5 you only shrink its boundary inside the extended partition envelope sda2. The original extended partition envelope sda2 is not changed at all and so the vacant space will not be availbe to primary partition sda1 outside. To allow the outside primary partition sda1 to access the free space you need to shrink the extended partition as the second step.

Once the extended partition sda2 is shunk to remove the empty space the vacant area will be availble outside to permit the primary partition sda1 to expand its right hand side.

(5) Although it is slower I would recommend to do one step at a time and only resize Xp in sda1 after satisfying all your sda5 and sda6 are working normally.

Linux is nice to work with because you can know everything you are doing. In the majority of the cases you can even reason it out.

Swarup
06-06-2008, 11:43 AM
Keep coming with the good words and I might just be able to persudae the Justlinux Admin to upgrade my company bicycle to a company Ferrari, even I haven't seen my company bicycle yet!

I hope they give you the Ferrari soon. You're worth every bit of it! :)

A couple of follow-up questions:

1. (3) Linux boot loaders, both Grub and Lilo, work by refering to the hard disk address of the partition, the form of which cylinder, head and sector. Once a partition has been shrunk the original hard disk address is void and so either Grub or Lilo will need to be restored. The Just Booting Tips (http://www.justlinux.com/forum/showthread.php?t=144294) Section B has all the details to do such restores.

I have done numerous shrinks from the RIGHT side of a partition in the past, and this never required me to restore Grub or Lilo in the past. Is it different somehow for the LEFT side?

2. Does it take longer to shrink from the LEFT side of a partition than from the RIGHT side, since (as I understand) there are some important sections of the partition and a lot of data on the "left" side that needs to be moved at the time of a shrink? Also, as a result of this increased need for moving data from the LEFT side compared with the RIGHT side, is it also more risky vis-a-vis possible partition damage or data loss, to do a shrink from the LEFT side as c/w the RIGHT side? Or is this all just misunderstanding of the issue from my side. Bottom line: is there ANY difference in doing a shrink from the LEFT versus the RIGHT-- and if so, then what is the difference?

saikee
06-06-2008, 12:09 PM
Answers

(1) The 1st complete track of a Ext2/3, NTFS, Fat16 and Fat32 is the reserved boot sector where Grub or Lilo resides. Neither gives a toss to what happen to the end of the partition. If you do not restore the hard disk address Grub or Lilo simply goes back to the unshrunk partition location to find its system files and you will get a complaint from the boot loader.

(2) Don't really know the answer myself. Your explanation is as good as any. Don't think there is any risk in the software but if the reszing takes a long time to complete then your hardware has more chance to overheat and misbehaves. Thus I suppose shrinking the right boundary of a partition is less risky than the left boundary. However when you need space you simply shrink once and choose the convenient side to do it. Choose the right boundary to shrink first and then move the shrunk partition bodily to the right just to obtain space on the left boundary gains nothing in practice because the bodily movement probably takes longer.

Swarup
06-06-2008, 05:09 PM
Answers

(1) The 1st complete track of a Ext2/3, NTFS, Fat16 and Fat32 is the reserved boot sector where Grub or Lilo resides. Neither gives a toss to what happen to the end of the partition. If you do not restore the hard disk address Grub or Lilo simply goes back to the unshrunk partition location to find its system files and you will get a complaint from the boot loader.

Unless it is only a shrink from the LEFT and not from the RIGHT which requires restoration of the HD address, this does not seem to be required in my system. Perhaps Parted Magic uses such a technique which does the restoration of the HD address automatically. Because I have done quite a number of RIGHT side shrinks, and I have never restored the HD address, and nor have I ever gotten a complaint from the boot loader.

saikee
06-06-2008, 07:10 PM
The righ hand side of a partition is its end! A boot loader always boots the beginning of the partition and so only the left boundary matters.

Xthink
08-25-2008, 10:24 AM
Good day!

Im a newbie to Linux. Is there a way to use this tutorial in installing multiboot Linux to USB HDD. Thnx in advance.

saikee
08-25-2008, 12:18 PM
Xthink,

Welcome to Justlinux.

I believe this 18-month old thread (http://www.justlinux.com/forum/showthread.php?t=148499) may be the answer you are after.

veeco
08-25-2008, 10:08 PM
Well done. This thread helps me understand more about multiboot and grub. Thx. :)

Xthink
08-25-2008, 11:01 PM
Xthink,

Welcome to Justlinux.

I believe this 18-month old thread (http://www.justlinux.com/forum/showthread.php?t=148499) may be the answer you are after.

Thank you very much for the link. Sorry if I don't see it before asking. This is a very informative forum. More power!

irlandes
10-24-2008, 10:37 PM
CNET had a weekly question on how to dual boot XP and Vista. I did not read all the nonsense, but I did skip through all 5 pages, and did an EDIT --> Find --> for "Grub" (no quotes) on each page with no results found. Gross!

saikee
10-25-2008, 08:07 AM
I honestly think the booting problem is a M$ self made thing. In Linux this problem doesn't exist. The root of the problem of the M$ boot loaders is they have a huge difficulty to "chainload" their own systems.

Vista is one of the 5 M$ Windows I booted in this thread and one of the 145 systems I recorded here. It is in the partition hdc3 as indicated in the presented menu.lst.

What could be regarded as strange to some may be as far as Linux is concerned Vista can be booted exactly like any one of the 145 systems here when the thread was written nearly two years ago.

We can installed and boot 2 Vista without even install a Linux (http://www.justlinux.com/forum/showthread.php?t=147250). Just 2 files from Grub are enough.

The booting of Xp and Vista can be made easy by any Linux and I wrote this thread (http://www.justlinux.com/forum/showthread.php?t=150551) just for the Newbies corner.

It is possible that M$ users are not conditioned to multi-boot. When they get a Vista boot loader BCDedit they may find it hard to put it into use. To a Linux guy I just put 2 and 2 to make 4 by using Vista's boot loader to boot 150 Linux. It was just a simple job of dabbling a Pyhton script.

Dagreat1
11-19-2008, 07:44 PM
Holy **** :-)

clayg
05-26-2009, 09:20 PM
I am interested in using your technique to load multiple Live CDs onto individual partitions on a USB memory stick and use the simple GRUB chainloader to decide which to start. This would mostly be for demonstrating various Linux distros, and for troubleshooting and recovering borked computers. The keychain Swiss Army Knife for computers.

The challenge for me is in how to get the Live CDs installed into a partition so that it includes its own bootloader. The CDs normally uses isolinux. I need to change to extlinux when I copy the files to the USB stick partitions, then change the various file and directory names from isolinux to extlinux. It should work, but I am still having trouble getting the extlinux installation correct.

I am trying to install the Ubuntu Live CD into the fifth partition of my USB stick. I copied all the files, changed the names to extlinux, installed extlinux, set the boot flag on the partition in order to test it, but it doesn't boot. I just get "boot error".

Once I get it to boot correctly from its partition, I will change the boot flag back to the first partition where I have GRUB and boot it using the chainloader command.

On my 8Gb USB stick, I plan to use the first 2Gb for a data only (FAT) partition. I have Puppy Linux installed in the next partition, and it is working fine with the GRUB chainloader. The next partition is the System Rescue CD, and I can't get chainloader working yet. The next partition is the Ubuntu Live CD, and chainloader isn't working yet there either.

Since Puppy is an actual full install, it installed its own extlinux bootloader, so it worked fine. Since I am copying files from bootable CDs into the respective partitions for the next two, I have to manually get extlinux working on them. I seem to be missing something, probably related to the partition's boot sectors, but I'm still working on it.

Thanks for the great thread! I'm a Linux Newbie and learning a lot!

>>>> Clay >>>>

saikee
05-27-2009, 03:27 AM
clayg,


Welcome to Justlinux.

Been two years since I wrote this thread. (http://www.justlinux.com/forum/showthread.php?t=150078). I think it explains some of your problem. Haven't tried much on USB pen drive since because an external hard disk is much faster and easier for the same thing.

If you want the Linux to work as a Live CD just copy the files, after expanding them from the iso file by a loopback device, onto the USB and change the isolinux to Grub. The above thread gives several conversion examples. They are pretty straight forward.

clayg
05-27-2009, 10:01 AM
Of course, grub would work fine, if I could figure out all the right parameters for each individual Live CD that I want to load. But I like your way of having a simple and consistent GRUB chainloader entry for every partition on the USB stick.

Last night I was successful in getting it to work. The tricky part is changing isolinux (which the Live CDs use to boot) into extlinux (which works on the USB stick) and also adding the mbr.bin to the boot block of each partition. That makes each Live CD bootable inside its own partition. Then the chainloader command works.

I have five partitions loaded and working so far and have only used about half of my 8Gb USB stick. You are right, an external hard drive is much bigger, better and faster for doing full disro installations. But they are not very convenient for carrying around on a keychain! By using the compressed read-only files from the Live CD, I can install several bootable environments and utility disks onto the USB stick and carry it around to do Linux demos (or installations!) or to use the various recovery tools (Ultimate Boot CD, System Recovery CD, etc.).

Thanks for the inspiration!

>>>> Clay >>>>

clayg
06-03-2009, 11:49 AM
I've hit a snag in my project. I have an 8Gb USB memory stick and I have one FAT partition of 2GB for shared data and GRUB. Then I have multiple ext2 partitions for loading various Linux distro "Live CDs", utility disks, and some full installs of small distros. I want a fully bootable install of each in its own partition, so that I can use your chainloader scheme to start any of them from one GRUB menu.

The plan is working fine with Puppy Linux in Partition #2 and System Rescue CD in Partition #3. I converted the ISOLINUX from the Live CD to EXTLINUX on the USB partition. These two both work fine with the GRUB chainloader. It is after that where I run into trouble.

Partition #4 is the Extended partition that houses the Logical partitions, #5, #6, #7, #8, etc. When I use the same EXTLINUX method to load a Live CD (Ubuntu, for example) into one of these Logical partitions, it refuses to boot from the GRUB chainloader. I can put a full stanza into GRUB (title, root, kernel, initrd) and they will then boot up just fine. But when I try to use the chainloader, I just get a "Boot error" with no error code or other information.

The reason that I wanted to use the chainloader command is partly for consistency, and partly because on some Live CDs, I have not been able to figure out what to put into the full GRUB stanza to get it to boot correctly. Take Ultimate Boot CD for example, I can't find a description anywhere of what would go into a GRUB menu to start that CD.

It seems like the EXTLINUX should boot from the GRUB chainloader, but it is only working for me in the two Primary Partitions (#2 and #3), not in any of the Logical Partitions. Since you are clearly using the chainloader command to boot from many Logical Partitions on your hard disks, I was hoping that you might be able to give me a clue as to where to look for a solution on my USB stick drive.

Thanks,

saikee
06-03-2009, 07:10 PM
I did not use Extlinux because with Grub I can boot everything manually and find out exactly which step doesn't work.

The author of Extlinux states this boot loader is "light weight". My feeling is if it is similar to syslinux, which boots mainly from a fat partition then it may have some limitations. Extlinux is different to syslinux by able to read an ext2/3 partition. In general a boot loader is a very small program not designed to read every filing system. Grub for example cannot read a NTFS partition. What Grub excels is it can chainload any installed system but that ability is not universal in every boot loader.

Many boot loaders are designed to boot only the primary partitions (the first 4 in a disk) because the code can be a lot simpler as the partition table is inisde the MBR which is only 512 bytes long. To boot a logical partition the hard disk has to be read several times because each logical partition carried the hard disk address of the next logical partition. When I recently putting Xp into 126 logical partition Grub suffered a big delay penalty because it had to spend a significant amount of time just to locate the correct partition.

The success of booting Linux off a USB drive also depends very much on how the distro has been put together. The access time in a USB device is a a lot slower and the kernel may not be able to find the correct system files in time during a boot up, as many files are loaded simultaneously. My point is success is not guaranteed as the case with an internal hard disk based on which the distros have been assembled.

adempewolff
08-09-2009, 01:50 PM
Hello sir,
I use Ubuntu as my main OS and upon my recent upgrade to a larger hard drive have been multibooting Ubuntu 9.04 amd64 with Windows XP and Windows Vista 64-bit. Just today GRUB has started acting up (either not loading, hanging at a white flashing cursor, or waiting up to 3 minutes to load http://ubuntuforums.org/showthread.php?p=7758331 if you are interested). I am afraid I will have to reinstall GRUB.

Your post gives me some much needed confidence. I recognize that GRUB is both powerful and laughably simple but while there are many how-tos for common problems there are not any comprehensive but readable sets of documentation for non-developers who simply seek to better understand their system and the process of debugging it.

I write here to ask about your experience working with loading Vista from GRUB as I am somewhat nervous about reinstalling GRUB without making XP or Vista un-bootable. Currently my set up is

hd1,0 Dell Utility Partition
hd1,1 Windows XP Pro
hd1,2 Windows Vista Business 64 Bit
(I don't know if GRUB counts extended partitions if so add one number to subsequent partitions)
hd1,3 Empty partition for testing OSes
hd1,4 Linux swap
hd1,5 Ubuntu 9.04 amd64
hd1,6 Storage partition

Ubuntu works great and I am pretty comfortable with modifying how GRUB interacts with it. On the other hand for the Windows OSes GRUB points to hd1,1 (Windows XP), where it appears to store the Windows Boot Manager which can then boot into Vista or the XP. Although I suppose I could just leave it there and have the new installation of GRUB continue pointing to that I would kind of like to have GRUB load each OS individually.

Do you have any ideas on how I could remove the Windows Boot Manager but leave both XP and Vista bootable so GRUB could chainload them?

Thanks!

saikee
08-10-2009, 06:51 PM
adempewolff,

I just came back from an overseas trip to post a late reply.

Grub counts from zero. Disk (hd1) is the second hard disk. If you have only one hard disk then it should be (hd0).

The first 4 partitions, from (hd0,0) to (hd0,3), are primaries. If you use logical partitions then one of them must be given up to form an extended partition. A hard disk can have only one extended partition which has no storage of its own. It simply acts as a boundary for a set of logical partitions inside. Any partition starting from (hd0,4) or the 5th position is a logical partition. I suggest you post the terminal output of
sudo fdisk -l for us to see if you are not sure. The "sudo fdisk -l" is a Linux command with partitions listed in sda1, sda2 etc. You can get the equivalent in Grub by command
sudo grub
geometry (hd0)
quit

You cannot remove the boot manager of a MS Windows because it will not boot. The idea is Grub boots up a Windows boot loader, hands over the control to it and it is the Windows boot loader that actually boots up the MS system.

If you have two MS Windows of Xp and Vista then it is the Vista's bootmgr that controls both Windows because Xp must be booted by its boot loader NTLDR.

The actual working is Grub boots up bootmgr first when you select MS Windows. Inside it bootmgr gives you 2 choices of booting either Vista or Xp. If you choose Vista then bootmgr will fire it up. If you choose Xp then bootmgr will hand over the control to NTLDR which boots up the Xp. Since XP's NTLDR is older it can't boot Vista so the control must be by bootmgr of Vista only. In your case you will find bootmgr and NTLDR residing in the Xp partition. That is the normal way for the MS Windows systems. Both Vista and Xp store their boot loader inside the boot sector of their own partitions. There is no need to interfere with them.

Your information suggests Xp is at the front end so Vista during installation will have deposited its bootmgr in Xp's partition. All you need to do is to tell Grub to chainload that partition. The "sudo fdisk -l" should show up sda2 the Xp partition, by having type 7 for NTFS filing system and the partition being bootable (with a *).

Both Xp and Vista will have their boot loaders residing in the boot sector of their partitions. All you need is to chainload the partition that has bootmgr inside. My guess is these lines should fire up the bootmgr in the Xp partition
title Xp partition assumed in (hd0,1)
root (hd0,1)
chainloader +1

You can restore Grub by any Linux Live CD and the Ubuntu CD can be used for that purpose. Post the "sudo fdisk -l" and we can show you the steps.

adempewolff
08-10-2009, 07:11 PM
Thanks for your reply. GRUB ceased acting up after several more reboots. It might have even been the BIOS, who knows. So I do not have an urgent need to reinstall GRUB anymore but I would still like to reconfigure how my computer boots. I also found your thread "Just Booting Tips" which was very informative and answered most of my questions about GRUB.

As soon as I submitted that post I realized it should be hd0 not hd1... oops.

What I was wondering if you had any idea how to do would be to configure xp and vista so they boot independently of eachother. Aka XP boots via NTLDR on its partition (hd0,1 or sda2) and Vista boots via the Windows Boot Manager on its partition (hd0,2 or sda3). The reason I would like to do it this way is because I may want to uninstall one of them in the future and I'd rather not have them dependent on eachother (or eachother's partitions) for booting.

I think I know how I would point to these in GRUB:
title Windows XP
root (hd0,1)
chainloader +1

title Windows Vista 64
root )hd0,2)
chainloader +1

But I don't know how to configure the windows OSes so that they will boot off their own partitions. So I do not want to remove the windows boot manager but rather move the Vista Boot manager to the Vista partition and then use the native NTLDR to load XP. I think that I might be able to do this by using the windows recovery console and using the commands "fixmbr" and "fixboot" and then reinstalling GRUB and reconfiguring it. I'm not confident that this would work though so I was wondering if anyone had any expirence. Hopefully I am more clear now about what I am curious about.

I don't think you need this anymore but just in case it better helps you visualize my setup:
Disk /dev/sda: 250.0 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00014c2c

Device Boot Start End Blocks Id System
/dev/sda1 1 3 24066 de Dell Utility
/dev/sda2 * 4 5225 41945715 7 HPFS/NTFS
/dev/sda3 5226 9141 31455270 7 HPFS/NTFS
/dev/sda4 9142 30401 170770950 5 Extended
/dev/sda5 9142 10446 10482381 83 Linux
/dev/sda6 10447 10968 4192933+ 82 Linux swap / Solaris
/dev/sda7 10969 13579 20972826 83 Linux
/dev/sda8 13580 30401 135122683+ 7 HPFS/NTFS


Thanks!

saikee
08-11-2009, 09:15 AM
What you have asked is totally reasonable but incompatible with M$ arrangement.

I have successfully broken off the combined booting process of Xp/Win2k and Vista/Win7 but haven't written about it.

The Xp can be easily fixed. The fixmbr will restore the Xp's own version of MBR in the first sector of the first boot disk. That MBR boots the booting code inside the Xp partition's boot sector. Unfortunately M$ saw fit to use a different boot code for the Vista/Win7 and so your sda2 or (hd0,1) has the boot code from the bootmgr and not from the NTLDR.

By running the recovery console of a XP installation disc the command "fixboot" will restore the Xp boot code inside the Xp partition, by overwriting the Vista/Win7 version currently there. This will make the Vista unbootable.

Moving the bootmgr and the associated files from Xp partition sda2 to Vista partition sda3 does not help because bootmgr configuration file is now in binary and a relocation must be followed by an update. The best way is to hide the Xp partition and run the Vista installation DVD. In place of the Recovery Console Vista's equivalent is Command Prompt. You can run the program BCDedit.exe to restore the Vista's boot code and MBR this way. I believe between bootrec.exe or bootsect.exe you can achieve the same thing. Also the third party software like EasyBCD can also be used if you have another bootable Vista or Win7 partition to run it. Just type "bcdedit.exe /?" to get help and find out the parameters you can use.

Your current Vista cannot be booted by Grub as per your instruction in Post #140. Your Vista must be booted via the Xp partition in sda2. bootmgr will dual boot Xp and Vista there. That is how the M$ systems have arranged themselves. Unless you hide Xp otherwise Vista will mount it regardless. Therefore for multiple MS Windows you need only one boot loader, usually the latest, to control all the M$ systems. The only deviation is to hide every MS system and unhide the one you wish to boot.

If your Ubuntu is in sda7 then boot up a Ubuntu CD and use the terminal to restore Grub by these lines
sudo grub
root (hd0,6)
setup (hd0)
quit
reboot
The above commands Grub to "source" the Grub from 7th partition of the 1st disk and set up Grub in the MBR of the 1st disk.

adempewolff
08-11-2009, 12:13 PM
Ah thank you for your informative and quick reply, it has answered all my questions--even if they weren't the answers I was hoping for.

I was hoping that I would just have to hide xp during the vista installation to keep them seperate but if I would need to keep it hidden except for when I booted into it, that solution is probably too complex (Unless GRUB had the capability to edit the partition type in the partition table as part of the chainloading process).

For now I guess I will just keep the boot manager and if I ever decided to remove Vista I will repair the XP partition by using fixmbr, followed by fixboot, followed by reinstalling GRUB from a live cd.

Thank you again for sharing your wisdom!

saikee
08-11-2009, 03:57 PM
Actually Grub is tailor-made to hide and unhide partitions. Such capability is inside Linux's other boot loader Lilo too.

I have written this thread (http://www.justlinux.com/forum/showthread.php?t=147250) to show how to use Grub to boot two Vista. The procedure is identical to your case of booting Xp and Vista.

The typical Grub commands are listed here
title 1st Vista in hda1
root (hd0,0)
makeactive
unhide (hd0,0)
chainloader +1

title 2st Vista in hda2
root (hd0,1)
makeactive
unhide (hd0,1)
hide (hd0,0)
chainloader +1
The above method does preserve each MS boot loader in each MS Windows partition but the disadvantage is that you can access only one MS partition at any one time. By going with MS own method, which places all the required boot loaders in the first MS-recognised partition and mounts all partitions recognised by Windows, you can access all of them at the same time. The downside is if the booting partition goes down you have a big job to make the rest of the MS systems bootable again.

MS boot loaders are clumsy relative to Grub because MS does not want to support other systems except their own. Thus extra levels of complication are introduced to protect its commercial interest.

I have dabbled Vista/Win7's BCDedit.exe, bootsect.exe and bootrec.exe to find my way round. However to write something useful, to highlight the differece from NTLDR and to guide others to use them sensibly is a big investment of one's time.

When working with MS boot loaders I find that I need to spend three times more effort to get one-third of the work achieved with Grub.

Reg777
09-06-2009, 02:31 PM
Great tutorial, cant wait to test it out. By the way, can i boot MAC OS X with grub using this guide?

saikee
09-06-2009, 05:25 PM
Reg777,

Welcome to Justlinux!

Never have a Mac myself so couldn't tell. However if it is a Linux implementation then it should work the same.

crazy4nix
09-12-2009, 04:36 AM
First of all, I am so glad that i stumbled upon your posts Saikee. I have become an instant fan of your posts and you are a celebrity in my world. Your instructions are clear and precise. I am pretty new to linux but am so deeply in love with it that I am posting this at 4:30am in the morning... lol... I go crazy about linux...

Anyhow, the problem:

I wish to create a bootable USB flash drive with dual/triple boot with various small distros such as DSL, Knoppix, INSERT.

So I took a 512MB Kingston SD Card, shoved it in a USB card reader and deleted whatever partition was there by default.

Using fdisk, i created two primary partitions for now. The first partition (sdb1), 10MB in size is FAT16, the second partition (sdb2), 60MB in size (for DSL) is ext3. The remaining space is empty for now.

I love your scheme of installing grub into it's own partition, hence I made the Fat16 partition.
I created /boot/grub dir structure in /dev/sdb1 and copied all the files from /usr/share/grub/i386-redhat/ into /boot/grub/

Then on my Centos system, I typed:
grub
root (hd1,0)
setup (hd1)
quit

Now, when I plug this USB into my thinkpad and boot from USB, I get the grub prompt. So far it's all good.

Next, I copy the 'boot' dir and 'KNOPPIX' dir that reside inside the dsl-4.4.10.iso image into /dev/sdb2 (the 60MB ext3 partition).

On /dev/sdb1, i create a menu.lst under /boot/grub/ and type this inside this file:
title Damn Small Linux
root (hd1,1)
chainloader +1

Save, exit, plug this USB into thinkpad and boot from USB, i still get the grub prompt. Shouldn't it show me the menu, or since there is only one item in menu.lst, boot directly into DSL. What am I doing wrong?

Thanks a lot in advance.

P.S. My Linux System is a Centos 5.2 running as a Virtual Machine on XP Host (VMware Workstation). Intel Core 2 Duo E8400, 4GB RAM.

crazy4nix
09-12-2009, 05:04 AM
clayg,


Welcome to Justlinux.

Been two years since I wrote this thread. (http://www.justlinux.com/forum/showthread.php?t=150078). I think it explains some of your problem. Haven't tried much on USB pen drive since because an external hard disk is much faster and easier for the same thing.

If you want the Linux to work as a Live CD just copy the files, after expanding them from the iso file by a loopback device, onto the USB and change the isolinux to Grub. The above thread gives several conversion examples. They are pretty straight forward.

Hi, I just read posts by clayg and your response to it. You said to convert isolinux bootloader to grub. Why so? Can't grub just chainload isolinux and then isolinux can take charge of booting the distro? After all, chainloading means giving another bootloader charge for booting the OS.

The DSL that I copied to my partition also has isolinux as its bootloader.

saikee
09-12-2009, 05:33 AM
crazy4nix,

Welcome to JustLinux!

isolinux is a boot loader for CD/DVD based on the iso9660 filing specification.

Grub is a boot loader based on block devices (like hard disk, USB pen drives) although it is also suitable for floppies.

Grub uses a different form of boot loader on a CD or DVD. Nornal Grub, now called Grub1 or Legacy Grub as Grub2 has been out, comprises of stage1 and stage2. A single stage2 called stage2_eltorito is used specifically for the CD/DVD structures.

stage2_eltorito (http://www.gnu.org/software/grub/manual/html_node/Making-a-GRUB-bootable-CD-ROM.html) does not boot a hdd or a floppy. A CD/DVD does not have a MBR and hence no stage1 application.

The author of isolinux wrote a separate boot loader for bock devices and floppies. It is called syslinux and is offered as a "lightweight" boot loader. It is quite popular with pen drives because I believe it is a Dos based program naturally fits in with the Fat16 and Fat32 filing format of the USB devices.

Hope the above is clear.

For the other post I am not sure exactly what you have done. Hence I can only offer a few pointers

(1) If you intend to boot the USB pen drive as the first booting device then it will be (hd0) to Grub but may be looked upon as sdb by CentOS.

(2) If your men.lst in sdb1 has been included to boot DSL then the Grub menu should show it even if it isn't bootable. Thus you may not have booted up the Grub in sdb1 of the USB drive. That is my currnet prediction according to the information supplied.

(3) You will not be able to boot DSL the way you had described. The "chainloader +1" can only be applied to the partition with a boot loader installed in its boot sector. It is known as an indirect method with which the Grub in MBR boots the boot loader in the partition specified by the "root" command. You have just copied part of the iso file and so no boot loader has been installed in sdb2. The way you described you are better off booting the DSL "directly" . This thread (http://www.justlinux.com/forum/showthread.php?t=150078) may be of interest to you. The thread was written for putting several Linux iso on a DVD but has been extended for USB devices.

If you like multi-boot then you have come to the right place. I am just a pupil from the masters here!

crazy4nix
09-12-2009, 06:45 PM
Thanks for your input.

(1) If you intend to boot the USB pen drive as the first booting device then it will be (hd0) to Grub but may be looked upon as sdb by CentOS.

Yes, when I plug my pen drive into my laptop and boot from it, it is hd0. (hd0,0) is a fat16 partition where i have /boot/grub/ and all the grub files in it.
(hd0,1) is a ext3 partition where i have copied the contents of dsl iso image, namely the directories 'boot' and 'KNOPPIX'


Now, in (hd0,0) I have /boot/grub/menu.lst with the following entry:

title Damn Small Linux
root (hd0, 1)
kernel /boot/isolinux/linux24 ramdisk_size=100000 init=/etc/init lang=us apm=power-off vga=791 nomce noapic quiet BOOT_IMAGE=knoppix
initrd /boot/isolinux/minirt24.gz

Note: In (hd0,1) I do have the following:
/boot/isolinux/linux24
/boot/isolinux/minirt24.gz



(2) If your men.lst in sdb1 has been included to boot DSL then the Grub menu should show it even if it isn't bootable. Thus you may not have booted up the Grub in sdb1 of the USB drive.

When I boot from my pendrive, i do get the grub prompt. That means that stage 1 grub in the mbr of (hd0) is calling the stage 2 grub in (hd0,0) and hence the grub prompt. Am i right? In other words, my stage 1 grub in the MBR is hard-coded to the grub in (hd0,0).



(3) You will not be able to boot DSL the way you had described. The "chainloader +1" can only be applied to the partition with a boot loader installed in its boot sector. It is known as an indirect method with which the Grub in MBR boots the boot loader in the partition specified by the "root" command. You have just copied part of the iso file and so no boot loader has been installed in sdb2. The way you described you are better off booting the DSL "directly" .

Yes, I understand now that I do NOT have the grub boot loader installed in (hd0,1), because I merely copied the contents of the dsl iso, and did not install it.
But, this time, if you look at my menu.lst in (hd0,0), I am calling the DSL directly. It should work this time, but it isn't.

I looked at your post titled "How to boot several CD iso files in a DVD" available at http://www.justlinux.com/forum/showthread.php?t=150078 but there, you have grub and all the iso's in the same partition. Here, I am trying to employ you strategy where the grub is on its own separate partition.
Please point my errors. Thanks a lot in advance.

saikee
09-12-2009, 08:48 PM
Grub will default to a Grub prompt if a menu.lst could not be found in either /boot or /boot/grub directories. If the menu.lst is good Grub will execute it.

In your current case with a Grub prompt you can boot the system manually as follow
root (hd0, 1)
kernel /boot/isolinux/linux24 ramdisk_size=100000 init=/etc/init lang=us apm=power-off vga=791 nomce noapic quiet BOOT_IMAGE=knoppix
initrd /boot/isolinux/minirt24.gz
boot
The instructions are identical to what you claimed in the menu.lst except I omit the "title" statement and add the "boot" as a green light for Grub to proceed. That is standard way to boot any Linux manually by using just the instruction in menu.lst.

Booting the Linux manually is to ask Grub to tell you which line it doesn't like. You use Grub as your teacher.

You can also ask Grub to display the content of the menu.lst at a Grub prompt
root (hd0,0)
cat /boot/grub/menu.lst
and ask it to fire up this menu by
root (hd0,0)
configfile /boot/grub/menu.lst

crazy4nix
09-13-2009, 03:26 AM
Thanks for your help. I can now manually boot DSL Live from (hd0,1) and I also setup GParted Live in (hd0,2) and can also boot that from the grub prompt.

I wanted some clarification. The grub prompt is a courtesy of stage1 or stage2? If I don't have Stage2 on any partition, just stage1 in the mbr, will I get the grub prompt?

Secondly, even though I do have a /boot/grub/menu.lst together with all other grub files in (hd0,0) (the grub only data-partition), why am I not being shown the menu? Why only the prompt?

Thanks for all your time and help!

saikee
09-13-2009, 05:32 AM
The stage1 is the part in the MBR. Without stage2 Grub cannot function at all. Since /boot/grub has stage2 therefore stage1 can be hard-coded to boot that file because Grub can read a ext2/3 partition. If Grub is avialable in the root partition of Linux then Grub can boot its boot sector directly by chainloading. The commands
root (hd0,0)
chainloader +1
boot[/code[
liertally instruct Grub that the root of the system is (hd0,0) where the stage2 and menu.lst can be found. Grub is then asked to sever everything except its 1st sector in the memory and paste into the memory with the +1 position of the boot loader inside boot sector of partition (hd0,). The +1 position is the 2nd sector. That is why I always say Grub is laughingly simple and makes use of the key features of the Legacy partition table better than any other boot loader.

I have suggested to you to use "configfile" to boot the menu.lst. Does this work? If it works then it proves your menu.lst is executable by Grub. If you still get a Grub prompt then may be you set it up incorrectly, say by putting Grub from sda2 or (hd0,1). You can restore the Grub from (hd0,0) again in a Grub prompt
[code]root (hd0,0)
setup (hd0)
and then fire it up immediately by
chainloader +1
boot

crazy4nix
09-15-2009, 10:18 PM
hi, sorry for the delayed response...
yes, i can now boot my distros using the following command:

root (hd0,1)
configfile /boot/grub/menu.lst

root (hd0,2)
configfile /boot/grub/menu.lst

Thanks for all your help. Appreciate it :)

LewRockwell
09-17-2009, 10:03 AM
we link to this thread often in emails and on forums!

thanks!

.

maek3rcr129
01-07-2010, 06:01 PM
thank you for this howto, saikee. it has really helped, but still confused over a simple part.

I'm confused about the first two posts, in that grub boots from /dev/hda3, but the boot flag is set to /dev/hda1. How does the computer boot to grub first if boot flag is to /dev/sda1?

Also, is it correct that you did not install grub in /dev/sda1 or /dev/sda2 because of the 2GB limitations of Dos and Win3.1?

saikee
01-07-2010, 07:45 PM
maek3rcr129 ,

Welcome to JustLinux!

The answer to your questions are

(1) Only the MS systems (Dos and Windows), Solaris and BSD systems boot loaders use the booting flag. Linux's Lilo and Grub never use it. Typically a MS systems stage1 boot loader (it doesn't have a name) searches the 4 primaries in the partition table and boot whichever one that has the booting flag switched on. We can place Grub inside a Fat partition, set it bootable and use Xp, Vista or Win7 boot loader to boot up Grub. I have demonstrated it in this thread. (http://www.justlinux.com/forum/showthread.php?t=147250)

(2) My thread was written when Linux still called the IDE disks as hda, hdb, hdc and hdd whereas sda, sdb etc were reserved for Sata disks or USB devices. Later kernels now call all disks sda, sdb, sdc etc. I placed Grub in hda3 as a data only partition. Each of all other partitions has an operating system inside and also its own boot loader.

It is an extreme case to demonstrate that Grub can be anywhere and can exist without an operating system attached.

If I put Grub inside say Dos or Win3.1 then I can't boot that system because the boot sector would be taken over by Grub.

In a normal case one can use a Grub from any of the Linux to do the same job. However I thought Linux users may like to know some powerful features of Grub.

claudecat
01-11-2010, 12:56 AM
Wow! I can't believe I never stumbled upon your amazing guide before now! I also boot dozens of distros, and your info gave me several "why didn't I think of that?" moments.

One question regarding the 16 partitions per drive issue... could you explain this to me? I have sometimes been able to create such partitions, but then whatever distro I was trying to install refused to use it. Btw, I have just 2 drives one internal SATA and one USB external SATA.

Thanks again for all your efforts!

saikee
01-11-2010, 04:47 PM
claudecat,

Welcome to JustLinux!

The 16 partitions should be thought of 16 device names.

It has been long established, when we still started using Sata hard disks, tha total of 256 devices in the hard disk controllers. The kernel has long been written to permit 16 devices names per IDE/Sata/SCSI/USB hard disk. Since sda the whole hard disk is also a device name there effectively we can only have 15 partitions. Also one of the primaries must be converted to an extended partition and cannot store data therefore a hard disk has only 14 bootable partitions.

The partitioning tools between Gparted, fdisk, cfdisk, sfdisk, parted, etc, etc maintained to different vigor and while one allow more than 16 device names other may not.

Theoretically kernel newer than 2.6.28 should have no limitation on the number of partitions! However the various programs have not been revised to catch up with the changes in the kernel. More details in this thread (http://www.justlinux.com/forum/showthread.php?t=152404&highlight=partitions)

Another complication is the kernel can be newer than 2.6.28 and the partitioning tools are ready to exceed 16 device names but the distro's installer may not have been written to go beyond the 15th partition. This is the most common irritation.

The problem can be resolved tempoarary if you are willing to install the distro in one of the first 15 partitions and then move it to a higher partition. This is how I deal with them and most distros with new kernels will have no problem with the relocation.

Personally I believe Linux is ready to be installed into high number partition as Grub has no problem of booting it. The problem is with the partitioning tools because we still need them to be robust for sorting partition table if something goes south.

The partitioning tool that is currently able to create most number of partitions is one of the oldest "sfdisk". The graphic Gparted is pretty good too but one can write a script to create 130 partitions in seconds with sfdisk , as I demonstrate in this thread. (http://www.justlinux.com/forum/showthread.php?t=152578&highlight=partitions)

In general I would recommend sticking with cfdisk as the partitioning tool. It supports 64 device names so 63 partitions is the maximum. I would also limit the number of partition to a lower threshold of 60 because any space/gap between partitions (forced upon by the BSD/Solaris distros and MS Windows) attracts an allocation of device name.

claudecat
01-13-2010, 07:31 AM
Thanks for the welcome and the information. Plenty of ideas for future learning/projects. You are one amazingly grub/partitioning knowledeable human :=}

luemmel
04-25-2010, 10:56 AM
Hello saikee,

i have read the most of the postings in this thread but found no solution for my problem with Linux Mint 8...

My USB disk structure is:

Device Part.Type Format Label Marks
/dev/sdc1 primary fat32 boot boot
/dev/sdc2 extended
/dev/sdc5 logical linux-swap
/dev/sdc6 logical ext2 Dream
/dev/sdc7 logical ext2 Arcade
/dev/sdc8 logical ext2 Mint
/dev/sdc9 logical ext2 Sabyon
/dev/sdc3 primary fat32 HOME
First i installed DreamLinux 3.5 Gnome in /dev/sdc6 with grub in MBR and via terminal in /dev/sdc6 and copied the boot folder from /dev/sdc6 to /dev/sdc1.

Seccond i installed Linux Mint 8 Helena and its grub in /dev/sdc8.

The menu.lst on /dev/sdc1:

color red/black red/light-gray

title This is the frequently use Linux booting menu

boot
title DreamLinux @ sda6
root (hd0,5)
chainloader +1

title Puppeee Arcade @ sda7
root (hd0,6)
chainloader +1

title Linux Mint @ sda8 via chainloader
root (hd0,7)
chainloader +1

title Linux Mint @ sda8 via core.img
root (hd0,7)
kernel /boot/grub/core.img
savedefault
boot

title Sabayon Linux @ sda9
root (hd0,8)
chainloader +1
If i select DreamLinux it boots the DreamLinux menu and from there it boots DL like it should.

If i select "Linux Mint @ sda8 via chainloader" grub tells me:

Error 13: Ivalid or unsupported executable format

Press any key to continue...
If i select "Linux Mint @ sda8 via core.img" grub tells me:

, bss=0x0
Error 15: File not found

Press any key to continue...
Linux Mint 8 Helena uses /boot/grub/grub.cfg as boot meu seems it uses grub2...
Can you help me?



Greetings from Germany
Luemmel

saikee
04-25-2010, 06:48 PM
luemmel,

Welcome to Justlinux!

If you boot a Linux using "chainloader +1" it will work only if its Grub has been installed in the root partition. In the case of Linux Mint in sdc8 that means /dev/sdc8. Legacy Grub or Grub1 can boot Grub2 this way. In fact any Grub can "chainload" any PC operating system as long as it has its boot loader residing inside the root partition.

Grub2 uses grub.cfg and Grub1 uses menu.lst for configuration.

You can make a Grub2 system installed in its own partition using the Task D2 (with the partition name adjusted for your case) of the Just Booting tips in my signature. If you have used Ext4 in sdc8 then you need a Linux Live CD that can read it.

If you still have a problem then post the content of grub.cfg here and let us know what filing system of sdc8.

As regarding your other booting solution of Mint my explanation would be Grub2 is using different commands to Grub1 so the only way to boot a Grub2 system is by chainloading. Alternatively you can make a Grub2 floppy to boot it manually. I believe in such case the commands would be something like
set root=(hd0,8)
linux kernel /boot/grub/core.img
boot
The partition numbering system has been changed in Grub2. Also the command "kernel has been replaced by "linux".

Good luck.

saikee
04-25-2010, 06:54 PM
claudecat,

I see myself just a student in this forum as I was an absolute beginner in Linux when I joined it.

Many members here are very knowledgeable.

They are my teachers and have taught me a lot. I am only passing on the knowledge I picked up from them.

Hope you can benefit from them same as I.

luemmel
04-25-2010, 07:24 PM
Here is the grub.cfg from Linux Mint 8:

#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by /usr/sbin/grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
if [ -s /boot/grub/grubenv ]; then
have_grubenv=true
load_env
fi
set default="0"
if [ ${prev_saved_entry} ]; then
saved_entry=${prev_saved_entry}
save_env saved_entry
prev_saved_entry=
save_env prev_saved_entry
fi
insmod ext2
set root=(hd0,8)
search --no-floppy --fs-uuid --set cebf7cd9-6974-4084-87d8-6024cad3d61a
if loadfont /usr/share/grub/unicode.pf2 ; then
set gfxmode=640x480
insmod gfxterm
insmod vbe
if terminal_output gfxterm ; then true ; else
# For backward compatibility with versions of terminal.mod that don't
# understand terminal_output
terminal gfxterm
fi
fi
if [ ${recordfail} = 1 ]; then
set timeout=-1
else
set timeout=10
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/05_debian_theme ###
set menu_color_normal=white/black
set menu_color_highlight=black/white
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/06_mint_theme ###
insmod ext2
set root=(hd0,8)
search --no-floppy --fs-uuid --set cebf7cd9-6974-4084-87d8-6024cad3d61a
insmod png
if background_image /boot/grub/linuxmint.png ; then
set color_normal=white/black
set color_highlight=white/light-gray
else
set menu_color_normal=white/black
set menu_color_highlight=white/light-gray
fi
### END /etc/grub.d/06_mint_theme ###

### BEGIN /etc/grub.d/10_linux ###
menuentry "Linux Mint 8 Helena, linux 2.6.31-14-generic (/dev/sdc8)" {
recordfail=1
if [ -n ${have_grubenv} ]; then save_env recordfail; fi
set quiet=1
insmod ext2
set root=(hd0,8)
search --no-floppy --fs-uuid --set cebf7cd9-6974-4084-87d8-6024cad3d61a
linux /boot/vmlinuz-2.6.31-14-generic root=UUID=cebf7cd9-6974-4084-87d8-6024cad3d61a ro quiet splash
initrd /boot/initrd.img-2.6.31-14-generic
}
menuentry "Linux Mint 8 Helena, linux 2.6.31-14-generic (recovery mode)" {
recordfail=1
if [ -n ${have_grubenv} ]; then save_env recordfail; fi
insmod ext2
set root=(hd0,8)
search --no-floppy --fs-uuid --set cebf7cd9-6974-4084-87d8-6024cad3d61a
linux /boot/vmlinuz-2.6.31-14-generic root=UUID=cebf7cd9-6974-4084-87d8-6024cad3d61a ro single
initrd /boot/initrd.img-2.6.31-14-generic
}
### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_memtest86+ ###
menuentry "Memory test (memtest86+)" {
linux16 /boot/memtest86+.bin
}
menuentry "Memory test (memtest86+, serial console 115200)" {
linux16 /boot/memtest86+.bin console=ttyS0,115200n8
}
### END /etc/grub.d/20_memtest86+ ###

### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###



My thinking was that i can chainloading Linux Mint 8 even it uses grub2, too...

saikee
04-25-2010, 07:53 PM
I use both Grub1 and Grub2 and can confirm both can chainload each other without any problem.

Grub1 cannot access a Ext4 partition because it hasn't got the driver for it. The support/maintenance of Grub1 was stopped almost at the time I entered Linux and nothing has been added since Ver 0.97. Therefore the only way you can rescue a Grub2 system is to boot up a Linux Live CD that support Ext4 which is not a problem with modern kernel.

If your sdc8 has not been formatted in Ext4 then Grub1 can boot it manually using the following information in your grub.cfg:-
set root=(hd0,8)
linux /boot/vmlinuz-2.6.31-14-generic root=UUID=cebf7cd9-6974-4084-87d8-6024cad3d61a ro quiet splash
initrd /boot/initrd.img-2.6.31-14-generic

The equivalent in Grub1 commands would be
root (hd0,7)
kernel /boot/vmlinuz-2.6.31-14-generic root=dev/sdc8 ro
initrd /boot/initrd.img-2.6.31-14-generic
boot

Please note the difference in calling the partition. You can use the original UUID to identify the partition but /dev/sdc8 will work and is simpler. The bits changed by me have been marked red.

Once you are running Linux Mint, go into a root terminal and issue this command to install Grub2 in sdc8
grub-install /dev/sdc8

Your Linux Mint should be chainloadable from this point onward. One last word it is possible that you may have to do grub-install more than once (if it fails) as there seems to be a bug in Grub2.

luemmel
04-27-2010, 11:34 AM
Today i've read in another forum that grub2 can't install itself in a logical partition like /dev/sdc8.

With your solution

root (hd0,7)
kernel /boot/vmlinuz-2.6.31-14-generic root=/dev/sdc8 ro
initrd /boot/initrd.img-2.6.31-14-generic
boot
i was able to boot Linux Mint 8 but fail on

grub-install /dev/sdc8
here is the result:

Asus901Mint luemmel # grub-install --force /dev/sdc8
grub-setup: warn: Attempting to install GRUB to a partition instead of the MBR. This is a BAD idea.
grub-setup: warn: Embedding is not possible. GRUB can only be installed in this
setup by using blocklists. However, blocklists are UNRELIABLE and its use is
discouraged.
Installation finished. No error reported.
This is the contents of the device map /boot/grub/device.map.
Check if this is correct or not. If any of the lines is incorrect,
fix it and re-run the script `grub-install'.

(hd0) /dev/sda
(hd1) /dev/sdb
(hd2) /dev/sdc
(hd3) /dev/sdd


The chainloading of Linux Mint 8 fails with the same error messages i've posted before...:(

saikee
04-27-2010, 01:17 PM
Your Linux Mint can only be chainloaded after grub-install succeeds.

I wouldn't pay too much attention to the Grub2 warning. It is a user's right to specify where the boot loader should be but putting it on a logical partition does have reliability problem if the partition table is altered. I haven't done a lot with Grub2 but my latest Ubuntu is in sda16 and it is controlling the MBR until I recently formatted its partition by mistake. I do run Grub2 on floppy as well as on CD.

In my #164 post I did mention you might have to grub-install it again if it fails. I could not explained why except I suspect a bug inside Grub2. It happened to me before.

luemmel
04-28-2010, 02:48 AM
This evening i'll try to replace grub2 with grub legacy...

EDIT: I've found the mistake by chainloading Linux Mint 8:

title Linux Mint @ sda8
root (hd0,7)
chainloader (hd0,8)+1

saikee
04-28-2010, 05:08 PM
I have just installed the latest Ubuntu 10.4 first and then Linux Mint 8 with a new hard disk.

Both use Ext4 filing systems (specified by me) and Grub2.

I did asked the Mint installer to put Grub2 in the root partition sda13 but it failed apparently. This is quite common for Linux boot loaders so nothing to write home about.

When I manually boot Linux Mint, using the Grub2 prompt from Ubuntu, it refused to be chainloaded so I fired it up using the command
set root=(hd0,13)
configfile /boot/grub/grub.cfg
After I booted up Linux Mint I do into a "root" terminal and issued the command twice
grub-install /dev/sda13
just to make sure it did what it was told.

I then rebooted Mint, this time by manully chainloading it, and use it to do this reply.

I suppose Grub2 still has some holes in it.

DesignerMind
05-10-2010, 12:19 PM
This is an excellent read. I'm new to this whole JustLinux thing, and am particlulary interested in booting just "4" operating systems. I would like to know if your method described will work for the 4 OS I would like to load on my machine.

They are the following:

Linux (Ubuntu)
Vista
Windows 7
Snow Leopard (PC)

Can I simply follow the steps listed in your guide, or is there a slight difference in the scheme due to having the odd of the MAC Snow Leopard system? I would greatly appreciate it if someone could assist me in this regard. Thanks a million. :)

~DesignerMind

saikee
05-10-2010, 06:04 PM
DesignerMind,

Welcome to Justlinux!

I have answered your other thread.

stella20
07-11-2011, 02:59 AM
Would be great if you can show off some pics
Or better make some videos and YouTube
You'll be a penguin hero in no time

saikee
07-11-2011, 08:01 AM
stella20,

Welcome to Justlinux!

This thread was written in 2006 at the time the detection of hard disk in Linux was not by libATA. In plain English it was during the time when the IDE hard disk is treated differently to Sata hard disk in Linux by allowing it to have 64 device names (one for the hard disk itself and 63 partitions). All Linux distro installers were written to be installable in 63 partitions of a IDE disks.

Nowadays all hard disks are treated the same as Sata hard disk originally permitted with 16 devices names (one for the hard disk and 15 partitions) and so many installers have not been written to access partition higher than 16. Thus it is technically possible to repeat what I have done but a lot more difficult with modern Linux.

As far as I know Linux does not have a limitation on the number of partitions in a hard disk and I have tried it above 150th position. The gpt partition system can have 128 partitions in a hard disk and these are bootable by Grub2.

The major huddle of putting a large number of operating systems into a PC is the majority of the installers are not written to cope with high number partition numbers and do not know what to do.

If you understand each operating system can be safely installed and booted from a hard disk partition then 145 operating systems are just the same procedure repeated 145 times. It will be terribly boring to look through the screen. I did the thread because to prove the process can be easily managed by Grub.

I still keep the box with these 145 systems but have not maintained it because I only allowed a small partition for each operatings system.

The purpose of my thread is to demonstrate that booting is child play in general but especially in Linux. This thread was written with Grub1 as the boot loader and the same can be done with Grub2.

I have also tried to boot 150 Linux with a MS Windows boot loader bootmgr used by Vista and Win7. That was documented in this thread. (http://www.justlinux.com/forum/showthread.php?threadid=150606)