Click to See Complete Forum and Search --> : Howto get 44 logical partitions out of a SCSI/SATA/PATA/USB disk


saikee
07-18-2007, 07:28 PM
Edit 27/2/09, 5/3/09

Our Super Mod bwkaz, whom we call the village elder, has alerted me that the Linux kernel 2.6.28 and later have started to support more than 16 partitions and even beyond 64 partitions in a hard disk.

I can confirm that this is indeed the case as I have succeeded in using up to 130th partition when I tried. However not all the current partitioning programs, like cfdisk and fdisk, have been modified to reflect the new change. I only managed it with sfdisk and one or two other desktop-based partitioning tools to reach beyond the traditional 64 device names in a hard disk.

Conclusion : This thread using hidden partition technique to get 44 partitions will be obsolete in future. However the partition changes have not been implemented fully yet in some parts of the kernel, partitioning tools and the installers of many distros so it will be some time before things are sorted. In the mean time enjoy the freedom of the 44 partitions as suggested by this thread.

If you keep an eye here I shall report more findings with the new changes as I discover them. Latest report on 5/3/09 is here. (http://www.justlinux.com/forum/showthread.php?threadid=152404)



Howto get 44 logical partitions out of a SCSI/SATA/PATA/USB disk

One line summary – Starting with a raw or empty spare hard disk, create the first extended partition and put 11 logical partitions inside, hide the first extended partition making it to become an unknown primary partition, repeat three times and use Grub to control the access of them.

Primary use – multi booting with Linux distros, using a large hard disk more efficiently, as a security option for saving data in area of the hard disk not available to the operating system or users.

Disadvantage – Only 11 partitions can be accessed at any one time after a system is booted. Grub needs to be hosted elsewhere in another disk, floppy, CD or pen drive.

Tools needed – Terminal partitioning tools like fdisk, cfdisk and sfdisk, Grub and any text editor which can be all inside a Linux Live CD that has Grub support (possibly over than 80% of Live CD would qualify)

Technical details explained

A Linux using 2.6.20 kernel or later now calls every SCSI, Sata, Pata and USB hard disk by the same naming convention, using disk names sda, sdb, sdc, sdd, sde etc. A maximum of 16 device names is now standard for each disk. For the first disk sda the 16 devices names are sda, and sda1 to sda15. The sda1, sda2, sda3 and sda4 are permanently reserved for the 4 primary partitions, even if some of them are not used, and the rest sda5 to sda15 are 11 logical partition names.

Instead of using the entire internal area as one storage unit anyone of the four primaries can be turned into an extended partition to hold the 11 logical partitions inside. Linux, as any other PC system, recognises only one extended partition in the partition table. More than one extended partition is illegal not supported by any of the established PC systems.

However if an extended partition is hidden, by changing its partition ID, then an operating system will regard it as “foreign” and ignore its presence, thereby allowing another extended partition to be created. If all four primaries are used this way a maximum of 44 logical partitions can be created and used in a hard disk. There is an observed standard to hide a partition in a hard disk. Hiding an extended partition is not a common activity but it can be done with the existing software and convention. The 44 logical partitions are achieved simply by using the established partition hiding technique

Some tips on hidden partitions and how they work is given here ( http://www.justlinux.com/forum/showthread.php?t=149828&highlight=hidden)

Operating the 44 logical partitions

This is done by the boot loader Grub which has to be hosted outside the 44-partition disk because the partition Grub residing must be available at all time and cannot be hidden, otherwise the control is lost or hidden.

Grub has a “hide” and “unhide” command in its instruction set that can be used on any partition. The resulting hidden non-extended partition ID is compatible with that supported by the Linux’s terminal command “fdisk”, “cfdisk” and “sfdisk”. Therefore there is no hacking and everything described here is the standard facilities in Linux. When an extended partition is formed by cfdiisk the partition ID is given the number "5". When Grub hides this partition its partition ID changes to "15". It will revert to "5" is the instruction is given to Grub to unhide it.

In operation I need 2 hard disks; one for the 44 partitions and another one for hosting the Grub menus. In my case these are sdb and sda. The sdb disk has 44 partitions inside. Both are Sata II disk each has 500Gb.

I need altogether 6 Grub menus.

Menu A for controlling which of the extended partition in sdb to be booted.

Menu B is for booting partitions exclusively inside sda disk (not for hiding).

Menu C for booting 1st 11 logical partitions inside extended partition sdb1

Menu D for booting 2nd 11 logical partitions inside extended partition sdb2

Menu E for booting 3rd 11 logical partitions inside extended partition sdb3

Menu F for booting 4th 11 logical partitions inside extended partition sdb4

Here are the sample of my 6 menus. I managed to find a way to nest them together using the "configfile" statement. I see a future to expand the use of Grub because we can do really complicated arrangements if we can transfer control from menu to menu.

Menu A – master control - the gut that makes the 44 partitions possible
#Master Menu A - menu.lst
title Ubuntu, kernel 2.6.20-15-generic @ sd6
root (hd0,5)
kernel /boot/vmlinuz-2.6.20-15-generic root=UUID=80db91a1-b3f2-42b2-b3a2-9cb6e5f71b8b ro quiet splash
initrd /boot/initrd.img-2.6.20-15-generic

title Booting choice from 500Gb Western Digital sda
configfile (hd0,5)/boot/grub/sda.lst

title Booting choice from 500Gb Samsung sdb1 (1st extended partition)
unhide (hd1,0)
hide (hd1,1)
hide (hd1,2)
hide (hd1,3)
configfile (hd0,5)/boot/grub/sdb1.lst

title Booting choice from 500Gb Samsung sdb2 (2st extended partition)
hide (hd1,0)
unhide (hd1,1)
hide (hd1,2)
hide (hd1,3)
configfile (hd0,5)/boot/grub/sdb2.lst

title Booting choice from 500Gb Samsung sdb3 (3rd extended partition)
hide (hd1,0)
hide (hd1,1)
unhide (hd1,2)
hide (hd1,3)
configfile (hd0,5)/boot/grub/sdb3.lst

title Booting choice from 500Gb Samsung sdb4 (4st extended partition)
hide (hd1,0)
hide (hd1,1)
hide (hd1,2)
unhide (hd1,3)
configfile (hd0,5)/boot/grub/sdb4.lst
Basically if I boot sdb2 I unhide it and hide the sdb1, sdb3 to sdb4. Thus at any one time Linux sees no more than one extended partition. Once the sdb2 is recognised and so I can then call up Menu D to select which distros to boot.


Menu B (sda.lst) for controlling sda disk (with standard 15 partitions)
#Menu B - sda.lst - Grub menu for hard disk sda 500Gb Western Digital
title Return to master menu
configfile (hd0,5)/boot/grub/menu.lst

title xp @ sda1
root (hd0,0)
chainloader +1

title Ubuntu, kernel 2.6.20-16-generic @ sd6
root (hd0,5)
chainloader +1

#title Ubuntu, kernel 2.6.20-16-generic
#root (hd0,5)
#kernel /boot/vmlinuz-2.6.20-16-generic root=UUID=80db91a1-b3f2-42b2-b3a2-9cb6e5f71b8b ro quiet splash
#initrd /boot/initrd.img-2.6.20-16-generic

title Puppy 2.1.4 @ sda7
root (hd0,6)
kernel /boot/vmlinuz

title Mepis 6.0.4 @ sda8
root (hd0,7)
chainloader +1

title Slax 6.0.0 @ sda9
root (hd0,8)
chainloader +1

title FC6.93 @ sda10
root (hd0,9)
chainloader +1

title Debian 4r0 @ sda11
root (hd0,10)
chainloader +1

title Yoper 3.0rc1 @ sda12
root (hd0,11)
chainloader +1

title DSL 3.4 RC1 @ sda13
root (hd0,12)
chainloader +1

title Empty @ sda14
root (hd0,13)
chainloader +1

title Empty @ sda15
root (hd0,14)
chainloader +1
Menu C - sdb1.lst for con the 1st extended partition
#Menu for hard disk sdb1 - 1st extended partition of 500Gb Samsung

title Return to master menu
configfile (hd0,5)/boot/grub/menu.lst

title Suse 10.3 Alpha 5 @ sdb5
root (hd1,4)
chainloader +1

title FC7 @ sdb6
root (hd1,5)
chainloader +1

title Mepis 6.5-32 @ sdb7
root (hd1,6)
chainloader +1

title Parsix 0.90r0 @ sdb8
root (hd1,7)
chainloader +1

title Slax 6rc4 @ sdb9
root (hd1,8)
chainloader +1

title Mandriva Deesktop 4 @ sdb110
root (hd1,9)
chainloader +1

title PCLinuxOS 2007 release @ sdb11
root (hd1,10)
chainloader +1

title LG3D @ sdb12
root (hd1,11)
chainloader +1

title Linux Mint 3.0 @ sdb13
root (hd1,12)
chainloader +1

title Sabayon 3.4 @ sdb14
root (hd1,13)
chainloader +1

title NetBSDamd64 3.1 @ sdb15
root (hd1,14)
chainloader +1
Menu D - sdb2.lst - for controlling the 2nd extended partition
#Menu D - sdb2.lst - for partition sdb2 - 1st extended partition of 500Gb Samsung
color cyan/blue white/blue
foreground ffffff
background 0639a1

title Return to master menu
configfile (hd0,5)/boot/grub/menu.lst

title DreamLinux 2.2 @ sdb5
root (hd1,4)
chainloader +1

title Slackware 12 @ sdb6
root (hd1,5)
chainloader +1

title Victor Linux 5.8 @ sdb7
root (hd1,6)
chainloader +1

title Grafpup 2.0 @ sdb8
root (hd1,7)
chainloader +1

title Absolute 12.0 @ sdb9
root (hd1,8)
chainloader +1

title Empty @ sdb110
root (hd1,9)
chainloader +1

title Empty @ sdb11
root (hd1,10)
chainloader +1

title Empty @ sdb12
root (hd1,11)
chainloader +1

title Empty @ sdb13
root (hd1,12)
chainloader +1

title Empty @ sdb14
root (hd1,13)
chainloader +1

title Parted Magic 1.7 @ sdb15
root (hd1,14)
chainloader +1
Menu E - sdb3.lst - for controlling the 3rd extended partition
#Menu E - sdb3.lst - for partition sdb3 - 3rd extended partition of 500Gb Samsung
color white/green cyan/blue

title Return to master menu
configfile (hd0,5)/boot/grub/menu.lst

title Zenwalk 4.6 run as Live CD @ sdb5
root (hd1,4)
chainloader +1

title Ubuntu 7.04 @ sdb6
root (hd1,5)
chainloader +1

title Sidux 2007-2 @ sdb7
root (hd1,6)
chainloader +1

title Skolelinux Debian-Edu_etch rc3 @ sdb8
root (hd1,7)
chainloader +1

title Empty @ sdb9
root (hd1,8)
chainloader +1

title Empty @ sdb10
root (hd1,9)
chainloader +1

title Empty @ sdb11
root (hd1,10)
chainloader +1

title Empty @ sdb12
root (hd1,11)
chainloader +1

title Empty @ sdb13
root (hd1,12)
chainloader +1

title Empty @ sdb14
root (hd1,13)
chainloader +1

title Pioneer 1.0 @ sdb15
root (hd1,14)
chainloader +1
Menu F - sdb4.lst - for controlling the 4th extended partition (last one)
#Menu F - sdb4.lst for partition sdb4 - 4rd extended partition of 500Gb Samsung
color red/blue yellow/yellow

title Return to master menu
configfile (hd0,5)/boot/grub/menu.lst

title ZenWalk 4.6.1 @ sdb5
root (hd1,4)
chainloader +1

title Blag 69999 @ sdb6
root (hd1,5)
chainloader +1

title NepalInux 2.0 @ sdb7
root (hd1,6)
chainloader +1

title Berry 0.82 @ sdb8
root (hd1,7)
chainloader +1

title BlueWhite64 @ sdb9
root (hd1,8)
chainloader +1

title Empty @ sdb110
root (hd1,9)
chainloader +1

title Empty @ sdb11
root (hd1,10)
chainloader +1

title Knoppix 5.1.1 @ sdb12
root (hd1,11)
chainloader +1

title Empty @ sdb13
root (hd1,12)
chainloader +1

title Scientific Linux 5.0 @ sdb14
root (hd1,13)
chainloader +1

title Unkmown @ sdb15
root (hd1,14)
chainloader +1
In the above menu you can see that I could jump from one menu to another to free to select any distro inside the 44 logical partitions of the disk sdb.

The sda disk is intentionally for hosting Grub. I selected sda6 which has a Ubuntu 7.04 inside. The above 6 menus are held in the /boot/grub directory of Ubuntu inside partition sda6.

For application I use the 44 partitions for installing a Linux in each. One common swap for all of then and it is sda5. Again the swap being in sda will be available at all time.

As I can boot up any Linux inside any of the 4 extended partitions, even though not all the logical partitions have been filled yet, the proposed usage of the 44-partition is proved.

My sdb device is a 500Gb Sata II disk. I just partitioned every logical partition to 10Gb using the cfdisk program theoretically amounting to 440Gb. The excess between the 500Gb and 440Gb is dissipated into a few partitions. I wrote down a list of partitions and what systems I had installed.

It go without saying that the partition names of sdb5 and sdb15 have to be repeatedly in each of the four extended partitions. There is no possibility to mount a partition from a hidden extended partition because it is recognised by Linux as an unknown primary partition. When an extended partition is hidden the entire set of logical partitions will disappear.



To be continued in Post #2

saikee
07-18-2007, 07:29 PM
To host Grub in a partition to carrying the access control of the 44 partitions

Warning : It is a repeat of what I said above but it is vital that Grub and the swap partition are “outside” these 44 logical partitions. The reason is simple. If you hide Grub then you to lose the control too.

The access control can be done on the back of any installed Linux that uses Grub as its boot loader. It is just a matter of amending its menu.lst and adding 5 more optional Grub menus as indicated in the above. In my case I just use the Ubuntu installed in sda6

The menus are always text files inside the /boot/grub directory. For a Linux installed with a separate /boot partition the menus are stored in /grub directory and Red Hat family distros may use grub.conf in lieu of menu.lst although the two are usually symbolically linked (i.e. editing either one will do).

It is noteworthy to point out that I wrote the 6 menu.lst ahead of the Linux installation. The menu.lst is directed to the partitions and marked as “Empty @ sdb7” for example. When a Linux has been installed inside sdb7 it can be instantly bootable by highlight the choice of “Empty @ sdb7”.

I have used chainloading throughtout the menu. The only partition that I did not chainload is sda6 because it would go round in circles if I did. Therefore only Ubuntu in sda6 is booted directly as indicated in Menu A.

To make a Linux chainloadable just tell the installer of every distro that you want its boot loader in the root partition. There is nothing else to do and the Linux will boot immediately after installation regardless of what boot loader it has got.

Lastly I post the partition tables of the sda, sdb1, sdb2, sdb3 and sdb4 here for completeness.

Disk sda partition tableDisk /dev/sda: 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/sda1 * 1 12158 97659103+ 7 HPFS/NTFS
/dev/sda2 12159 36473 195310237+ 7 HPFS/NTFS
/dev/sda3 36474 48755 98655165 5 Extended
/dev/sda4 48756 60801 96759495 83 Linux
/dev/sda5 36474 36595 979933+ 82 Linux swap / Solaris
/dev/sda6 36596 37811 9767488+ 83 Linux
/dev/sda7 37812 39027 9767488+ 83 Linux
/dev/sda8 39028 40243 9767488+ 83 Linux
/dev/sda9 40244 41459 9767488+ 83 Linux
/dev/sda10 41460 42675 9767488+ 83 Linux
/dev/sda11 42676 43891 9767488+ 83 Linux
/dev/sda12 43892 45107 9767488+ 83 Linux
/dev/sda13 45108 46323 9767488+ 83 Linux
/dev/sda14 46324 47539 9767488+ 83 Linux
/dev/sda15 47540 48755 9767488+ 83 Linux
Disk sdb1 partition table (only sdb1 is recognised as Extended)
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 15808 126977728+ 5 Extended
/dev/sdb2 15809 29184 107442720 15 Unknown
/dev/sdb3 29185 42560 107442720 15 Unknown
/dev/sdb4 42561 60801 146520832+ 15 Unknown
/dev/sdb5 1 1216 9767457 83 Linux
/dev/sdb6 * 1217 2432 9767488+ 83 Linux
/dev/sdb7 2433 3648 9767488+ 83 Linux
/dev/sdb8 3649 4864 9767488+ 83 Linux
/dev/sdb9 4865 6080 9767488+ 83 Linux
/dev/sdb10 6081 7296 9767488+ 83 Linux
/dev/sdb11 7297 8512 9767488+ 83 Linux
/dev/sdb12 8513 9728 9767488+ 83 Linux
/dev/sdb13 9729 10944 9767488+ 83 Linux
/dev/sdb14 10945 13376 19535008+ 83 Linux
/dev/sdb15 13377 15808 19535008+ a9 NetBSD
Disk sdb2 – because sdb2 is shown as extended partition Type 5 where sdb1, sdb3 & sdb4 are hidden.
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 15808 126977728+ 15 Unknown
/dev/sdb2 15809 29184 107442720 5 Extended
/dev/sdb3 29185 42560 107442720 15 Unknown
/dev/sdb4 42561 60801 146520832+ 15 Unknown
/dev/sdb5 15809 17024 9767488+ 83 Linux
/dev/sdb6 17025 18240 9767488+ 83 Linux
/dev/sdb7 18241 19456 9767488+ 83 Linux
/dev/sdb8 19457 20672 9767488+ 83 Linux
/dev/sdb9 20673 21888 9767488+ 83 Linux
/dev/sdb10 21889 23104 9767488+ 83 Linux
/dev/sdb11 23105 24320 9767488+ 83 Linux
/dev/sdb12 24321 25536 9767488+ 83 Linux
/dev/sdb13 25537 26752 9767488+ 83 Linux
/dev/sdb14 26753 27968 9767488+ 83 Linux
/dev/sdb15 27969 29184 9767488+ 83 Linux
Partition table of sdb3 (only sdb3 recognised as Extended)
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 15808 126977728+ 15 Unknown
/dev/sdb2 15809 29184 107442720 15 Unknown
/dev/sdb3 29185 42560 107442720 5 Extended
/dev/sdb4 42561 60801 146520832+ 15 Unknown
/dev/sdb5 29185 30400 9767488+ 83 Linux
/dev/sdb6 30401 31616 9767488+ 83 Linux
/dev/sdb7 31617 32832 9767488+ 83 Linux
/dev/sdb8 32833 34048 9767488+ 83 Linux
/dev/sdb9 34049 35264 9767488+ 83 Linux
/dev/sdb10 35265 36480 9767488+ 83 Linux
/dev/sdb11 36481 37696 9767488+ 83 Linux
/dev/sdb12 37697 38912 9767488+ 83 Linux
/dev/sdb13 38913 40128 9767488+ 83 Linux
/dev/sdb14 40129 41344 9767488+ 83 Linux
/dev/sdb15 41345 42560 9767488+ 83 Linux

Partition table of sdb4 (only sdb4 recognised as Extended)
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 15808 126977728+ 15 Unknown
/dev/sdb2 15809 29184 107442720 15 Unknown
/dev/sdb3 29185 42560 107442720 15 Unknown
/dev/sdb4 42561 60801 146520832+ 5 Extended
/dev/sdb5 42561 43776 9767488+ 83 Linux
/dev/sdb6 43777 44992 9767488+ 83 Linux
/dev/sdb7 44993 46208 9767488+ 83 Linux
/dev/sdb8 46209 47424 9767488+ 83 Linux
/dev/sdb9 47425 48640 9767488+ 83 Linux
/dev/sdb10 48641 49856 9767488+ 83 Linux
/dev/sdb11 49857 51072 9767488+ 83 Linux
/dev/sdb12 51073 53504 19535008+ 83 Linux
/dev/sdb13 53505 55936 19535008+ 83 Linux
/dev/sdb14 * 55937 58368 19535008+ 83 Linux
/dev/sdb15 58369 60801 19543041 83 Linux

Experience on hidden extended partitions

I have been experiemnting with the hidden extended partitions for some time and can confirm that it work satisfactorily. To be frank I haven't run into any difficulty at all.

The principle is sound because the extended partition "is" basically a primary partition with an identical partition table except the Type No is different. Every operating system ignores foreign partitions it doesn't support. This is same for every MS system, Linux and Unix-like system. There is nothing sinister or illegal to the operating systems. We just make use of their known behaviour to do things to suit ourselves.

I had in the past moved the extended partitions successfully by hiding it so that the border can be moved around as one unit.

In the box where I have installed Solaris, BSD and Linux I hide the extended partition (with Linux inside) whenever I run Solaris and BSD. I do the opposite when I run Linux inside the extended partition by hiding Solaris and BSD partitions. So far this arrangement prevents any corruption to the partition table of the hard disk.

bwkaz
07-18-2007, 07:52 PM
Perhaps a silly question, but why not use LVM? :)

No, LVM isn't the same setup as the old DOS partition tables, and you may not be able to interoperate with other OSes. But you can create one small partition for root+boot (or just for /boot, if your distro's initramfs supports LVM), and a large partition for all the Linux systems. Then make that large partition into a physical volume, and add it to a volume group. Then make several logical volumes out of that group, one per Linux system you want to host. Put all their kernels and initramfs images onto the /boot partition (because grub doesn't understand LVM yet, and may never understand it).

AFAIK, LVM isn't limited at all in the number of logical volumes you can create in a group. :)

saikee
07-18-2007, 08:12 PM
I have so far stay away from the LVM but know we can use it to span several disks together to form one volume.

I am not looking for a solution here. It is just something I tried. I possibly still prefer to see each distro installed completely in a self contain partition with its own boot loader. This way I can understand, maintain, resize and migrate the system a lot easier.

Half of the thread is to show how to nest a group of Grub menus.

Hosting Grub is a separte /boot partition is necessary for a LVM as you have indicated. As far as I am aware no Linux boot loader can read a LVM so the kernel must be placed outside the LVM.

I am sure when I come down to a few disros to use them continuously I would need to get into LVM. At the moment I am still installing with every distro I can find. The advance in Linux in the last couple of years has been truly amazing and it is a challenge just to see what is going on.

bwkaz
07-19-2007, 06:40 PM
I am not looking for a solution here. Right. But I figured if anyone else was looking, LVM might help them if they need tons of partitions on a SCSI device. Hey, whatever. :)

As far as I am aware no Linux boot loader can read a LVM so the kernel must be placed outside the LVM. Supposedly LILO can do LVM, but I have no idea how it does it. I have an idea on how to add support to grub for LVM, but I have a feeling it wouldn't be accepted upstream. (Basically, the way grub has a stage1_5 now, I'd add a stage1_1 that loaded LVM. Then it'd look for the stage1_5 inside the logical volume, to load the FS, which would then let it find stage2 and menu.lst.)

I am sure when I come down to a few disros to use them continuously I would need to get into LVM. Oh, I don't know about that. I've been using just a couple distros (well actually, one LFS, and one other partition that's holding the previous or next LFS version while I build it) for a few years now, and I haven't moved any of my FSes to LVM yet. Mostly that was because I never looked into what all it was able to do, though.

(And writing a mkinitramfs for LFS forced me to look into LVM. :))

saikee
07-19-2007, 07:29 PM
bwkaz,

I must admit your idea of
I have an idea on how to add support to grub for LVM, but I have a feeling it wouldn't be accepted upstream. (Basically, the way grub has a stage1_5 now, I'd add a stage1_1 that loaded LVM. Then it'd look for the stage1_5 inside the logical volume, to load the FS, which would then let it find stage2 and menu.lst.)

wets my appetite.

I am not optimistic though. One can host Grub in a floppy or a bootable CD or a pen drive that has stage1.5 and stage2. Thus Grub is equipped with the full intelligence. We have to load a driver into Grub if we want it to read a LVM.

The driver inside a kernel to read a LVM may be small, as there are many modules already available, but for a simple boot loader it may be ill-equipped to do such a job. I am talking above my head here as I have no idea how LVM works except treating it as a management layer.

d_casper
07-20-2007, 01:49 PM
A little bit Info:

GRUB is no longer being developed because of messy code and design failures.

Development team is working on GRUB 2 now. Development version of GRUB 2 is usable and works fine on PC. OpenFirmware-based PowerPC machines (PowerMac and Pegasos) and EFI-based PC (IntelMac), and being ported to RiscOS/ARM and UltraSparc. GRUB 2 is working fine in my Test Rig.

Stable version of GRUB 2 will be available very soon.

saikee
07-20-2007, 03:42 PM
I reserve my judgement on Grub 2. The last time I tried I couldn't get anywhere as there was no documentation.

I probably have pushed the Legacy Grub, or the old version developed to 0.97, more than most users have done. In my experience the statement of
GRUB is no longer being developed because of messy code and design failures.
isn't justified in practice.

I can understand the existing Legacy Grub isn't well written and probably very hard to maintain. The truth of the matter is that the maintenance to Legacy Grub was at the point of being stopped when I started learning Linux but through out last few years I have not discovered any major shortcoming to warrant a complaint to Grub.

By any standard I have been able to get better service by Grub than any boot loader from any PC system. The thing that bothers me is I could not single out even one part of Grub that can fail or is known to be unreliable. I am sure there must be instance Grub will show up deficiencies but I just never ran into one in the normal usage, despite having made Grub boot over 150+ systems of any Dos, MS Windows, Linix, BSD and Solaris I could find.

I can only get Grub to hang by repeatedly loading it, i.e. boot to (hd0), then (hd1,2), then back to (hd0).

Chainloading from an older version to a newer version or vice versa does cause erratic Grub behaviour but that is to be expected because features in one version may not be available in another.

I still maintain in a Grub prompt there is no PC system Grub (legacy version) cannot boot. If a PC system is originally healthy and has a boot loader in its root partition it can always be fire it up by a Grub floppy as I have not run into an exception.

Of all the distros I come into contact with, including non-Linux distros, I haven't ran into Grub 2 myself. The Legacy Grub usage is still on the rise as less distros are using Lilo now while more Live CDs switch from isolinux to Grub. In the installation of the above 44-partition hard disk I think I could only find mainly the Slackware/Slax families are hanging onto the Lilo. Legacy Grub has enjoyed an increased popularity since I entered Linux. At the same time I have not seen a distro put the new Grub 2 into practice.

If the GNU/Grub team has done anything to popular Grub 2 then I must have missed it totally because even today I could only find the documentation section marked "GRUB 2 Documentation is under development.". That was the same status possibly 2.5 years ago. (http://www.gnu.org/software/grub/grub-2-support.en.html) I find it strange that users without any instruction could run Grub 2 because it is not possible to correct an error if one crops up.

I like to move with time same as everybody to get my teeth into Grub 2 but from my experience with the versions from 0.91 to 0.97 Grub Legacy I do find the existing Grub "extremely" stable and reliable. If there are messy codes and design failures then in its current "defective" form it still beats all other boot loaders put together.

There is a new challenge facing Grub soon and I am not sure of its outcome. This is due the the use of 2.6.20 and newer kernels forcing Pata disks to use SCSI/SATA/USB disk names. There does not seem to be an agreed standard on the order of how different disk controllers should be scanned by the Bios. Thus one motherboard may assign sda name to a eSata controller while another motherboard favours an internal Sata disk to take the sda name. When mixed with SCSI and Pata disks it can lead to a chaotic situation.

Grub is known to work with the Bios information and may commit mistakes in the recognition the disks in a correct order. This error is not detectable as nobody know or can define a correct sequence of how different disk should be assigned. The whole idea of sda, sdb, sdc, sdd, sde, sdf.... naming convention is to let the motherboard to detect whatever are available. Grub identifies a disk by assigning a number so it is unaffected by the change in the hard disk names but it is hard to tell if Grub has made an error.

I am aware the order detected by Grub is not always in agreement with the bios setting which can also be different from the order determined by Linux once it is booted so there may be a time bomb there when more different type of disks and controllers are introduced into the PC.

d_casper
07-21-2007, 01:43 PM
Of all the distros I come into contact with, including non-Linux distros, I haven't ran into Grub 2 myself.
Please read my post again. GRUB 2 is being Developed and Stable version is not available yet. You wont find it in any distro and it will released very soon.

If the GNU/Grub team has done anything to popular Grub 2 then I must have missed it totally because even today I could only find the documentation section marked "GRUB 2 Documentation is under development.". That was the same status possibly 2.5 years ago. I find it strange that users without any instruction could run Grub 2 because it is not possible to correct an error if one crops up.

Check this Link (http://www.gnu.org/software/grub/grub-2.en.html). its Home Page of GRUB2. I wonder, did you even try to Google for GRUB2?

I like to move with time same as everybody to get my teeth into Grub 2 but from my experience with the versions from 0.91 to 0.97 Grub Legacy I do find the existing Grub "extremely" stable and reliable. If there are messy codes and design failures then in its current "defective" form it still beats all other boot loaders put together.
Yes, existing GRUB is extremely stable but it lacks a lot of features. Please check the above link.

saikee
07-21-2007, 02:34 PM
d_casper,

I take it you are connected with the maintainers of Grub2.

The link you suggested still indicates "GRUB 2 Documentation is under development." It was the same site I checked before I replied Post #8.

Are you aware of any progress made in the last two years?

bwkaz
07-22-2007, 12:37 PM
There has been progress on GRUB 2, yes. (Of course the most recent "release" (i.e. 1.9x version) is 9 months old...) There has not been any progress on a GRUB 2 manual, or end-user documentation. (Or even a guide for "this is the data to put into your MBR before the partition table; this is how that code finds the next stage, this is how the module loading stuff works, this is how you tell it to read a config file", etc. There's plenty of "just run this command, it'll work, trust us", but not much "here's what that command actually does". It sounds like saikee wants the manual/docs before he'll use it; I want the "this is what this actually does" before I'll trust it.)

Many of us thoroughly understand grub legacy, to the point where we can get it to do almost anything (and even, in some cases, know exactly where to add new features that we'd like to see; not that those new features would ever be accepted upstream, but still). None of us knows grub2 that well -- but that's understandable, as it's new. However, there's no way for us to find out, either, because the documentation doesn't exist yet. (At least, hopefully that's a "yet".)

Now yes, I was able to sorta, kinda figure out how to get it sorta, kinda working, via the TestingOnX86 wiki page. (But I didn't replace my main qemu grub-legacy bootloader with it, I just added a multiboot-type entry to fire up the grub2 core.img that I had it generate.) I'm still nowhere near familiar enough with it to replace grub-legacy, or to recommend it to anyone else (except, perhaps, people that need /boot-on-LVM, and aren't afraid to go read sources).

orspain
12-07-2007, 08:32 AM
Hello,

First I want to say thank you for your very useful and informative posts. I've used the ideas presented in some of your other posts to create a multiboot system, with Grub installed on a data partition.

Second this is my first post here although I have been following the forums for some time.

Now I am attempting to follow the idea presented in this post, but can not seem to accomplish my goal, perhaps I am overlooking something and it will be easily resolved.

I have /dev/sdc which is 500 GB and I want to use 4 extended partitions, hiding/unhiding each partition with Grub which is on it's own partition on another disk (sdb2).

With fdisk I've created the 1st extended partition on sdc1. But when I try to change it's type (t) to 15 (hidden extended) I get the message: You cannot change a partition into an extended one or vise versa Delete it first.

There seems to be a number of possible combinations so I unfortunately do not know more than to just ask. Does your method depend on having Grub tied to another Linux? If so I have Ubuntu installed on (sda8) and could try it that way. Although it seems from your instructions that you have previously created and hidden the partitions.

I've tried using parted to set up the partitions first, but it will not allow me to set the flag on the extended partition to hidden. I have also tried cfdisk but it does not directly show the extended partition. I have tried searching on the internet and I find very little, other than your most intriguing post. Will you please assist me, if it is within your grasp?

Sincerely,
Otto

saikee
12-07-2007, 11:20 AM
orspain,

Wlcome to Justlinux.

I think it is timely to talk about the difference between a Grub prompt and a Grub shell.

I believe your problem could be due to the limitation of working in a Grub shell where the integrity of the partitions is protected by Linux. Your Grub is a shell inside the Linux.

At the Grub prompt, which is at the stage before a kernel is booted, you can freely hide and unhide the the extended partition. The change is passed onto the Bios too and so the Linux if booted will conform to the revised changes.

It makes sense if you think about it.

In practical you will have to hide or unhide the extended partition in order to select a system to boot and so you will in a Grub prompt when using the 44 partitions.

I have not had any problem with my 44 partitions in one disk yet and the disk is now fully populated with distros.

WallyWallWhackr
12-08-2007, 08:03 PM
Hi guys. I have read the 145 OS thread, and this one, and I love what you have done.

I want you to take a look at an old bootloader, see how it works, and incorporate some of what it does into grub 2.

The bootloader is XOSL. http://www.ranish.com/part/xosl.htm

The new grub, being graphical should have things like security features added to it like password protection on a OS basis level, and even a password prompt to bring up the menu at all, if set up that way by the user. It should also allow additions to the menu to be made without editing a .lst file. In other words, a person should be able to add an entry through the graphical front end of GRUB.

I have used XOSL for years, and have only recently come across problems with it. The mouse freezes after a few clics once in the loader screen, and it seems to have problems with SATA drives, and will not, of course, see the USB drive(s) I have in the PC at boot time. Anyhow, I just wanted to iterate that this boot loader was great in its day. It allowed me to boot BeOS, Linux, DOS, Windows, etc. without a hitch, and has switches for changing drive ordering, and hiding partitions, etc.

Grub is better, but a marraige between GRUB, and XOSL would be absolute heaven. It should also allow the user to put up his own graphic, and also even individual OS icons.

I noted also that it remarked about PPC versions being worked on. Don't forget to make it work on the Cell based PPC64 system that is a PS3. It has unique requirements for booting to an alternate OS than the Sony XMB front end (which I think is a glorified boot loader as well).

Anyway... great work, guys. Keep it up! :D

saikee
12-08-2007, 09:56 PM
WallyWallWhackr,

Welcome to Justlinux and telling us your experience with XOSL.

I am aware of XSOL but I was waiting to find out Grub's limit. As it happened Grub has answered all my need. My personal preference is to stick to the terminal mode as it makes the boot loader footprint a lot smaller. I don't think I have used Grub anywhere to its limit yet but probably in a position to make sensible comparison with other boot loaders. In terminal mode a user can communicate with Grub virtually like a mini operating system because a Grub prompt is a command interpretor just a Dos. Not many users know that we could manually boot up any PC system in the terminal mode of Grub. This feature is not available in other boot loaders which tend to be based on an operating system, whereas Grub can be installed unattached to any operating system.

Thus I stay away from any graphic boot loader because I want substance and not the appearance. There are a few graphic interfaces with Grub but they actually inhibit the full power of Grub available to the users.

Grub also has a file called stage2_eltorito enable Grub to be installed in any CD and DVD. Thus one can use one Grub to boot floppies, internal hard disks of any kind, external hard disks like eSata, USB devices, CD and DVD.

I do believe many bootloaders, which XOSL is one of them, are capable too but Grub seems to cover a much broader media yet remaining as the simplest and most flexible, at least to me.

I have not gone into the new Grub2 as there is not enough documentation for us to understand it yet. It is not used as the default boot loader by any distro yet, as far as I am aware.

WallyWallWhackr
12-09-2007, 04:34 AM
XOSL is also not tied to any operating system, and is fully manipulable from the graphical interface. In fact, that is the only way to set it up. The "footprint" thing is a non issue as this bootloader as well as others drops out of memory upon loading an OS. It's only problem is that it hasn't been maintained in the past 6 years, and that it requires an old DOS FAT16 partition to be installed onto. I am trying to get it to install onto a USB drive so I can do with it what you have done with grub, which is boot anything, and have anything on your system be available to boot, but have so far been unsuccessful at it. I even tried DOSBox to see if I could fool it into thinking the USB drive was a hard drive. What surprised me the most about XOSL is that it is a graphical interface, but the thing takes little memory space, and disappears after the OS selection is made. Grub 2 page mentioned that it would have graphical interface capacity.
I noticed that you did not have BeOS, OS/2, or DesqViewX in your list. :-]
DesqViewX ran under a QEMM modified DOS, but it was a really nice, early X-server, and would even allow a distributed process to be run on a remote machine. It would be cool to have a modern version of that floating around!

ASCII ya later...:o

saikee
12-09-2007, 06:24 AM
When I couldn't get Grub boot a USB device I also thought about the driver problem. However I later discovered Grub just relies on the Bios information and can see USB devices if the USB legacy support is enabled in the Bios. May be you should investigate in this direction too.

May be I didn't tried hard enough I do have BeOS installed inside a MS system and have not thought it requiring booting independently.

I did actually paid for a floppy-based OS2 system in the Internet with the view to try out its boot loader but none of my PC could runs it. There may be newer versions that can be run in modern PC but I consider it more or less a time waster. I did run an OS2 system donkey years ago.

johntn
02-14-2009, 11:28 PM
Hi,

I noticed in the front of this thread it says "Grub needs to be hosted elsewhere in another disk, floppy, CD or pen drive."

I've trying to follow both your awesome 145 and 44 distro threads. WOW!

I would like to do a close parallel to them. I have both an HP and a Compaq which both provide the capability for me to hit "ESC" at boot and boot from any installed device be it dvd, hd, usb, sd, etc.

I would like to set up a multi-distro linux HD on this system that I could select at boot time and then grub to any number of Linux distro's where it was all contained on the one disk.

If there is another thread like this I would appreciate direction, or barring that, guidance about how to apply the info you have already supplied.

Thanks again for all your great information to date!

John

saikee
02-15-2009, 09:12 PM
johntn,

Welcome to Justlinux!

First the bad news. Current Linux supports only 16 block devices names for a hard disk. Excluding the whole of the disk and one primary partition for converting into an extended partition (as they can't be used for storage) you can have a maximum of 3 primaries and 11 logical partitions of a total of 14 independent Linux each held in a partition. You therefore need a lot of hard disks if you want to boot say 100 OSes.

You can try virtual machines but they are not independent systems and you only boot its host. The rest are just guest systems you save as image files inside the host.

You could put all you Linux in a LVM but not every distro's installer supports it and you might end up with a common kernel. I didn't think this worth a pursuit.

The 44 logical partitions I described is actually using 4 primaries and turning each into an extended partition for holding set of 11 logical partitions. But no PC system support a hard disk with more than one extended partition because it will not be the PC standard that can be understood by every Dos, Windows, Linux and Unix. So I cheat by using only one extended partition and hide the other 3 at any one time.

As an example if I have extended partition sda1, sda2, sda3 and sda4 and hide the last 3 Linux will regard them as primaries from a foreign and unsupported system and would not bother to check the inside. I could then used the 11 logical partitions normally.

If I want to access the 11 logical partitions inside sda2 I have to hide sda1, unhide sda2 while sda3 and sda4 remain hidden. The second set of logical partition still have the same sda5 to sda15 device names but they are not the same as the first set.

Sda3 and sda4 are operated on the same method.

Since every one of these 44 partitions can be hidden some times and so not recognised by Linux and Grub I therefore cannot use any of them to store Grub. That is why Grub must be booted from another source, be it a floppy, CD, anther internal hard disk, an USB external hard disk, Pen drive, SD card....

The hiding and unhiding has to be perform by Grub so a partition permanent available is required to store Grub's configuration menu.lst.

If you use a hard disk in a normal way by having the standard one extended partition then there is no need to house Grub elsewhere. Grub can operate from any of the primary and logical partition to boot all the systems.

johntn
02-15-2009, 11:27 PM
Thanks Saikee,

I was hoping for maybe 33, so I guess I am back to the 44 with an SD or USB flash as my boot device to get there.

I guess I can use something like DSL on them since as I understand it, it will mainly serve as a means to get me to the new 44 HD?

Thanks so much for your reply!

John

johntn
02-15-2009, 11:48 PM
Sorry I failed to mention I have been trying VBox for the last few weeks and was flustered with the inability of the latest version to mount any of my local network drives.

I have been looking at the 44 version as a means of being able to access both my local system drives and my network drives.

I am getting back to Linux (Unix) after years of windows use so it is almost like starting anew. But Windows and it freaky need to control everything has continued to turn me off and away!

So Linux is becoming more attractive to me every day :)

John

saikee
02-16-2009, 04:53 AM
johntn,

Grub will work in any partition, with or without a Linux, but remember no stand alone MS system can survive in a logical partition. Your 33 or 44 systems have to be Linux or some Unix.

A floppy is the best in your case. The reason is if you insert a SD or USB flash it can only boot if you nominate it as the first boot disk so your 44 systems have to be recognised and installed as the second disk. Using a floppy you have only one hard disk in the system.

A CD is equally as good as a floppy but it is hellish to edit errors.

johntn
02-16-2009, 02:06 PM
saikee,

I currently have 4 systems, 1 wk2p, 1 xppro, 2 vista, all networked with my wife's computers and a couple in other rooms. (Yes I am out of control :)

I have been playing with several distros on VBox on the xppro and 2 vista machines, but am very dissatisfied with the lack of network capability from VBox. After reading your "how to's" I thought I might add another HD to the vista machines, just for Linux distros only, so I could get a real experience including local networking.

I planned to leave the existing vista HDs (in HP/Compaq machines) and use the added HD's for Linux only. So far I have tried about 10 Linux distros in VBox which I would give up on once I got the Linux HDs going.

Knowing I will probably continue trying out new Linux distros I am hoping to get the 44 one going now by booting from an sd device which both HP and Compaq allow. With that in mind I plan to install Linux (or the master grub) on an SD device where, if I understand it correctly, I will install the master.1st grub pointing to the new Linux (44) HD.

I guess I would have to work out the correct (44 Linux) HD that the (SD) master grub would point to, but it seems doable.

I would appreciate your conformation that this plan is workable? In my mind it seems it is but....?

John

saikee
02-16-2009, 08:18 PM
johntn,

Your wish can be accomplished easily.

Basically you can put Grub, sourced from most Linux, into a SD card and set the bios to boot it first. Say this disk is recognised as device sda. To Grub this is the 1st boot disk known as (hd0)

If you have another existing hard disk it may become device sdb. To Grub this is the 2nd boot disk known as (hd1)


When you add the new disk for Linux it could become your sdc and will be call the 3rd disk in Grub under the name (hd2).

You therefore proceed to create 44 partitions and install 44 OSes in sdc. When you boot up Grub in sda you simply tell Grub which partition in (hd2) you wish to fire up. This is done by having a list of 44 systems for you to select.

The easiest way is called chainloading. Say you want the choice of booting the 5th and then the 6th partitions of disk sdc. In Grub's convention they are 5th and 6th partitions of the 3rd disk known as (hd2,4) and (hd2,5). The choices you need to write on menu.lst in sda are just
title OS in (hd2,4)
root (hd2,4)
chainloader +1

title OS in (hd2,5)
root (hd2,5)
chainloader +1

You can have from 7th to 15th partitions booting by changing (hd2,5) to (hd2,6) and then all the way to (hd2,15) to build up the first compliment of 11 logical partitions.

For an OS "chainloadable" you need to place its boot loader inside its root partition. 99.9% of Linux distros provide this facility and every MS system from Dos to Vista does it automatically.

For getting the 2nd, 3rd and 4th complements of each 11 logical partitions you need to read the thread.

bwkaz
02-16-2009, 11:16 PM
First the bad news. Current Linux supports only 16 block devices names for a hard disk. Not anymore. :p

This (http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=bcce3de1be61e424deef35d1e86e86a 35c4b6e65) change, this (http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f615b48cc7df7cac3865ec76ac1a5bb 04d3e07f4) change, and this (http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=3e1a7ff8a0a7b948f2684930166954f 9e8e776fe) change all went into 2.6.28; this lifted the 16-partition limit.

(What the limit is now, I'm not sure. It looks like the block layer has a limit of approximately a million per dynamically-allocated major number, but some of those commit messages seem to imply that either the SCSI layer, or some other layer, still has a limit of 64. Either way, 64 is better than 16.)

Of course, this requires udev (or equivalent), a kernel >= 2.6.28, and (perhaps) this option being enabled. But it is possible. :)

Anyway, carry on. Just wanted to mention that. :)

johntn
02-17-2009, 12:14 AM
So are we back to being able to boot from the added drive and being able to have up to 64 distros in the one extended partition? :)

Now that would be cool :)

Now I just need to figure out the swap and data partitions for each one :)

John

saikee
02-17-2009, 05:16 PM
bwkaz,

I have been expecting the 16 minors to be breach some times as it makes no sense to limit a large disk like 1TB to 15 partitions.

Thanks for pointing out the update.

johntn
02-27-2009, 09:28 AM
Hi saikee,

I am not sure, maybe this needs to be a separate subject?

I have an HP with 2 HDs. The first currently has Vista which I would like to leave untouched. The second is a 1.5T HD, now for data only. The HP allows for booting from any installed device, so I would like to develop HD 2 as a duel use drive.

I would like to have HD 2 bootable for several Linux distros, let's say 10, and the reminder of the HD (NTFS) for use by either Vista or Linux for data.

I am looking for a duel boot solution that is HD based

My plan is to disconnect HD 1, the vista drive, so I can then partition HD2 from a live CD, and then install my additional Linux distros.

It is the partitioning I am unsure of? I know I can only have 4 primary partitions.

I understand Vista does not recognize Linux formatted partitions, and since I want the end product to include a data partition both Vista and Linux can recognize, I think it has to be NTFS and one of my 4 primaries?

So that leaves me 3 primaries for Linux distro use:

1.Linux partition 1 with the mbr for booting all the other installed Linux distros (30G?)
2.Linux partition 2 (30G?)
3.Linux partition 3 (240G?) subdivided into 8- 30G logical drives for Linux distro (8-10) installs.

And my final data partition:

4.NTFS partition (1.2T) for use by both Vista and Linux (if required).

My next question is which of the 4 partitions comes first, remembering I want to be able to boot Linux from it but also have Vista able to use the data part of it as if it was a normal HD for Vista purposes?

Assuming all this will work I hope to use some of your earlier Grub examples for booting the various installed Linux distros.

Your guidance and comments would be appreciated.

John

saikee
02-27-2009, 10:12 AM
Our Super Mod bwkaz village elder has alerted me with his last post here that Linux kernel 2.6.28 and later have started to support more than 16 partitions and even beyond 64 partitions in a hard disk.

I can confirm that this is the case as I have used 67th partition when I tried. However not all the current partitioning programs, like cfdisk and fdisk, have been modified to reflect the new change. I only manage it with sfdisk and one or two other desktop-based partitioning tools to reach beyond the traditional 64 device names in a hard disk.

Conclusion this thread using hidden partition technique to get 44 partitions is now obsolete.

Regarding your case I shall explain as follow

(1) Only MS systems use the bootable flag. Linux never has a need of it! The bootable flag in the first 4 primaries can be obtained by one-read and so that is used by MS systems boot loader which boot any of the 4 primaries if it has the bootable flag switched "on". All the partitioning tools I know of always switch off the existing if a user select another primary partition's bootable flag.

The above explains that you can put any number of MS systems on the same disk and boot each one up simply by making the partition you want to boot "active" and deactivate the other. You need to hide the MS supported system in front of the booting MS system if you want it to be booted up as the "C" drive. I can explain it further if you need it.

To make a partition "active" or "bootable" is equivalent to switch on the bootable flag. I believe the action just toggles a binary bit in the partition table.

(2) Regarding booting Linux the operation is a lot simpler. If you install 10 Linux just tell the installer to put its boot loader inside its own partition. You can then nominate any of the boot loader from the 10 Linux or any of the MS systems to control the booting by occupying the MBR.

You then configure this boot loader to boot all the rest. The configuration is the easiest with Grub because you can try the operation bit by bit, line by line manually and even write the configuration file "before" installing any operating system.

Even with 64 or more partitions the hard disk works as 4 primaries only. If you want more than 4 you turn one of the primaries into an extended partition. All the partition starting from the 5th are all logical partitions which must be consecutive and wholly fitted inside the extended partition. You can use any of the 1 to 4 primaries as the extended partition which can onccur once in a hard disk but the best is always the 4th partition as you can keep on increasing at the end. Each logical partition has its own partition table and contain the hard disk address of the next logical partition down the line.

It may be a bit of confusing but you can boot any installed operating system with Grub, in a floppy, CD or jump drive. SO you can install all the systems first and then select any Grub, modify it configuration as the permanent boot loader (or alternately keep modifying it as you go along).

Hope the above help.

johntn
02-27-2009, 12:36 PM
I would greatly appreciate a little more detail on the structure and sequence of the partitions. (What goes where? :)

Since I do not plan to boot Windows from HD 2, only Linux distros, what is my sequence for setting up my partitions?

I do want HD 2 to contain an NTFS partition that windows, when booted from the other HD, can recognize and use.

John

saikee
02-27-2009, 07:52 PM
Basically you can download drivers into a MS Windows to mount Linux partitions for the read/write operations. In Linux equally you can mount any NTFS partition to read/write. There the position and order of data partition in NTFS and Linux partition in Ext3 are immaterial.

The easiest thing to do is to load a Linux live CD. The best one I think in your case is Slax.

You simply use Slax's terminal mode command
fdisk -l to check the existing hard disks and their partitions.
To partition a hard disk, say it is your second hard disk (you check the partitions and details) sdb you use the program cfdisk in command
cfdisk /dev/sdb
Inside it you just create sda1, sda2, sda3 in sizes of 30Gb ,30Gb and 12Gb respectively. The 12Gb of sdb3 needs to be NTFS so you use the "type" option to change the partition ID from 83 to 7. A standard partition created in Linux is always type 83.

Your logical partition should start at the remainder of the hard disk. My suggestion is to create the first logical partition of 1Gb and specify it type ID 82 so that it becomes the common swap partition usable by all Linux. You can then continue partition sda6, sda7, sda8, sda9..... to the sizes you desire. Say you have a large data partition in sda10 and you want it to be NTFS so just repeat what you have done on sda3.

cfdisk program is the most educational partitioning software.

When done you opt for "write" to write the partition table out and reboot the system.

If you install a Linux just tell its installer which one of the sda1, sda2, sda6 to sda9 partitions you want to install that Linux. My practice is one operating system per partition as it is easier to maintain.

If you boot up a MS Window it cannot mount your sda3 and sda10 yet because they have not been formatted. You will find them in the 3rd and 10th partitions in the disk management program with which you can format them. Once formatted the sda3 and sda10 will be assigned a drive letter each and you can start using them.

Since sda3 is a primary partition it can be used for installation of a bootable MS system.

You will find sda4 is missing because as an extended partition it is just an envelope. It will show up in fdisk program but not cfdisk. If you understand the reason behind then you understand the working of extended and logical partitions.

johntn
03-02-2009, 10:53 PM
Just a quick note to say thanks for sharing all your grub(y) experiences :) I was able to get 8 linux distros installed and working on the second HD of my HP desktop. I have a total of 24 partitions I hope to use although a couple of them complained that I had more than 15 and let me know I could forget thinking they would write to any of them.

I did learn immediately that having an NTFS partition first was not going to work. So i ended up with p1 and 2 linux, p3 ntfs, p4 extented (this was an interesting experience with this 1.5T drive. It would not let me create the extended p4, but when I tried to create a p4 swap, it immediately changed it to p5. Later when I did an fdisk I discovered it had created the p4 extended on it's own.) I then when on creating partitions up to 24.

So far i've installed Granular, Ubuntu 8.10, Mint64, Fedora 10-64, Ear MS, Mepis, Mandriva 2009, and OpenSuse 11. All but two played fair and got along. The two that tried to take over the world were Mepis and OpenSuse 11. I ended up having to use a live cd to edit their menu.lst's to bring things back under control :) They just refused to get along! OpenSuse even tried to format two of the other partitions.

It is great being able to boot my Linux distros from HD 2 and allow them to have full use of the computer and local network. I also have a 1.2T NTFS drive on the same HD for either windows or linux use as required.

Again thanks! John

saikee
03-03-2009, 04:40 AM
johntn,

It looks like you are starting to enjoy the power of Linux.

The cfdisk program is very educational. To be frank it taught me a lot about partitioning, especially while the first logical partition is always No. 5 even if you start from a raw disk without having any primary first.

There is a big change in partitioning going on in Linux and not everything has been aligned together. As an example I have been able to get 130 partitions in one hard disk but haven't been able to boot it yet except for using them for storage. This is set up everything from no 5th position is a logical partition. I believe with the hard disk standard there is no limit to the number of logical partitions. The limit is only set by the operating systems.

Here are a few things I have found

(1) Only sfdisk can be used to get the largest number of partitions. It stops at 130.
(2) cfdisk has always been able to partition up to 63 partitions but the 60th and beyond are not reliable.
(3) fdisk is the most robust but it doesn't do or show more than 60 partitions.
(4) I have been able to generate partitions using scripts with sfdisk and fdisk but not cfdisk.
(5) Some graphic partitioning tools like gparted can create/handle 63+ partitions.
(6) Only kernel 2.6.28 and newer support 15+ partitions. Older kernels still think 15 partitions is the limit.
(7) Many installers, from distros with 2.6.28 kernels, have not been written to anticipate 15+ partitions and unable to cope with their device names even if they were generated by the users.

It will take some time before the dust is settled down.

teeitup
03-06-2009, 02:19 PM
I meant to reply to the "Booting Tips" post. Reference in this reply are to that Thread" Sorry.

I need some help in booting on partitions that are beyond the BIOS boundry.

Grub works fine. Dual boot with XP and first Linux install works just fine.

The disk is 320GB replacing an 80GB.

In the left over space at the backend of the drive I installed Ubuntu. Nothing would boot after the install. Error 18 I think. I fixed grub and was able to get the original partitions to boot using (hd0,5). I can't get the new install to boot (hd0,8). It's sda9 and after fixing grub, adding the entries for the Ubuntu, I get an error that it can't read the file due to being out of the BIOS range.

I thought that post #3 Task G was going to help me. I'm not seeing it.

I need someone to point me in the right direction to help boot partitions in the upper ranges of a very large disk.

Thanks,

saikee
03-06-2009, 08:26 PM
teeitup,

I don't think that is a real error but something to do with one Grub loading another version of Grub.

What I would do in your case is to activate a Grub prompt, by press "esc" and the "c" key before booting any system.

You can then type
geometry (hd0)
to see if (hd0,8) is listed or not. It it does appear then try these commands
root (hd0,8)
configfile /boot/grub/menu.lst

Grub can boot from the back end of a 1TB disk.

teeitup
03-06-2009, 09:02 PM
The problem seems to be with the laptop's BIOS.
Error 18: Selected cylinder exceeds maximum support by BIOS

At the boot Grub screen:

geometry (hd0) -> lists partitions 0-6
find /boot/grub/menu/lst -> (hd0,5)


If I boot Linux and run Grub:

geometry (hd0) -> lists partitions 0-8
find /boot/grub/menu/lst -> (hd0,5) (hd0,8)

If I can't work around this limitation of the BIOS, I may need to reorder some of my partitions.

saikee
03-07-2009, 06:42 AM
I am not convinced it is a hardware problem. It is possible say if you chainload a newer version of Grub by an older version of it, or the other way round, Grub could misbehave. Also if Grub has not been installed properly or corrupted then this type of error can occur.

In your case the information confirms that there are indeed two menu.lst, one in (hd0,5) and the other in (hd0,8). This is evidence that there are two Linux installations with Grub as their boot loader.

I suggest you boot the system in (hd0,8) as follow

(1) While in the Grub prompt ask Grub to display the menu.lst in (hd0,8)
root (hd0,8)
cat /boot/grub/menu.lst
(2) You then read the "kernel" and "initrd" statements and type them, one line at a time, at the terminal. Forget the inird statement if there isn't one as the latest Ubuntu may have done away with the initrd.

(3) When done add this command to fire it up
boot

If the same error persists you can boot the system up with another Grub sourced say using a Live CD from here. (http://www.justlinux.com/forum/showthread.php?threadid=150549)

Let us know your progress. Also report any line Grub doesn't like.

teeitup
03-08-2009, 07:06 PM
I tried the Yoper LIVE CD and got the same results. I updated the BIOS on the laptop to latest version. No change in the behavior.

Since the BIOS identifies the new 320GB HD as 137GB it's becoming obvious that I won't be able to boot any partition beyond that number. Using the entire drive once booted is not an issue.

If I move the "home" and "data" partitions to end of the drive I should be able to boot at least 2 distros and maybe 3 if I plan it right.

I also could try sharing a boot partition or have multiple boot partitions within the 137GB boundary and put everything else beyond.

Looks like a little creativity will go a long way.

Later,

saikee
03-08-2009, 08:59 PM
I am certain Grub has no bother with a hard disk of 320Gb size. I routinely force Grub to boot from the end of my 500Gb and 1TB hard disks.

I have just wrote this thread (http://www.justlinux.com/forum/showthread.php?threadid=152404) on the maximum number of hard disk partitions with the new 2.6.28 kernel. I used a 1.5TB hard disk and generated 57 partitions. I have installed two Linux in the sdb56 and sdb55 partitions and boot them up successfully. They are at 1.1Tb position of a 1.5TB disk.

The 137Gb limitation is usually specific to the operating system and not a matter for the boot loader. If Grub is able to list the partitions it can boot them. This because Grub needs to search the disk to find the location of the last logical partition.

Having said the above it is possible if you are working with an old PC with a Bios limited to 137Gb (has to be very old though) then you may have a booting problem because the Bios would tell Grub there in no hard disk address beyond the 137Gb. However this limitation should disappear if your Bios allows you to use the hard disk in the LBA mode (Large block addressing). Can you check your Bios to see if the hard disk addressing mode can be switched?

saikee
03-09-2009, 09:02 PM
Due to an unforeseen problem I have reset my Bios in the mobo and end up with the same error of

"Error 18: Selected cylinder exceeds maximum support by BIOS"

I discovered the hard disks were read in a mode different to LBA after the reset. After I fixed the Bios I still got the problem. I managed to ask Grub to display the /boot/grub/menu.lst of the partition I want to boot and manually typed in each line of command to get the Linux booted.

So try it yourself.

Say if you want to boot a Linux in the 56th partition of the 2nd disk it will be (hd1,55)
root (hd1,55)
cat /boot/grub/menu.lst
Then just type each line starting from the "kernel" statement, then "initrd" line and finish with the "boot" statement.

teeitup
03-10-2009, 01:56 PM
saikee,

I don't think my problem is a Grub issue.

I'm doing this on a Dell laptop. The laptop is very restrictive in what settings you can make in the BIOS. The HD is identified as being smaller than it actually is. The BIOS also indicates that it is in "LBA" mode.

I moved all the data/storage partitions to the back end of the drive. This leaves me with enough space within the BIOS range to boot multiple Linux installs and the original XP. I can live with this solution.

Props to to you for sticking with this. I tried most of your suggestions. I've become much more comfortable with the inner workings of Grub than I ever thought I'd need to be.

Thanks!

bwkaz
03-11-2009, 01:28 AM
Well, LBA != LBA48.

Plain LBA uses 28-bit sector numbers, and each sector is 512 bytes. 28 bits gives you 256MB worth of unique addresses (268435456 different addresses). When each address refers to a 512-byte sector, you get 128GB worth of data (multiply by 1K, divide by two). That's 137438953472 bytes' worth of space that you can use. Given that hard drive manufacturers are dumb, and insist on using powers of 10 instead of 2 (because it makes their drives look bigger), that's 137GB according to them. Look like a familiar number? :p

LBA48 is a newer LBA extension that uses 48 bits for the sector number, instead of 28 bits. Those extra 20 bits give you another 1MB worth of addresses, which turns 128GB into 128PB (yes, petabytes).

If your BIOS does LBA, but only LBA28 (or classic LBA, or whatever you want to call it), then you'll still be stuck with 128GB of addressable space. The only way to get around that limit is to bypass the BIOS (like Linux does once the kernel has loaded up) -- but GRUB doesn't have enough space in the single boot sector to be able to get enough code loaded up to be able to do this. (All GRUB has is the MBR, minus the partition table: something like 400-some bytes.)