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


Results 1 to 15 of 42

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

Threaded View

  1. #1
    Join Date
    Jun 2004
    Location
    Newcastle upon Tyne
    Posts
    2,978

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

    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.



    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

    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
    Code:
    #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)
    Code:
    #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
    Code:
    #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
    Code:
    #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
    Code:
    #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)
    Code:
    #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
    Last edited by saikee; 03-08-2009 at 09:05 PM.
    Linux user started Jun 2004 - No. 361921
    Using a Linux live CD to clone XP
    To install Linux and keep Windows MBR untouched
    Adding extra Linux & Doing it in a lazy way
    A Grub menu booting 100+ systems & A "Howto" to install and boot 145 systems
    Just cloning tips Just booting tips A collection of booting tips

    Judge asked Linux "You are being charged murdering Windoze by stabbing its heart with a weapon, what was it?" Replied Linux "A Live CD"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •