the concept of subpartition

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
ITchimp
Member
Member
Posts: 134
Joined: Sat Aug 18, 2018 8:44 pm

the concept of subpartition

Post by ITchimp »

the MBR has a partition table of up to 4 partitions; at each partition there could be another MBR with 4 more partitions, this concept can nest many times... therefore I have to ask, what is the limit on how many sub-partition there could be from a device driver point of view? also there is extended partition, are those also considered sub-partition? Then how many minor device # there must be to account for all the complexity?
Octocontrabass
Member
Member
Posts: 5568
Joined: Mon Mar 25, 2013 7:01 pm

Re: the concept of subpartition

Post by Octocontrabass »

ITchimp wrote: Sun Oct 20, 2024 4:51 pmat each partition there could be another MBR with 4 more partitions, this concept can nest many times...
Which OS recognizes a MBR inside a partition like that?
ITchimp wrote: Sun Oct 20, 2024 4:51 pmalso there is extended partition, are those also considered sub-partition?
No.
rdos
Member
Member
Posts: 3297
Joined: Wed Oct 01, 2008 1:55 pm

Re: the concept of subpartition

Post by rdos »

This once worked, but I think Linux broke it all by using an incorrect concept.

It worked by linking the four entries to a special partition type (actually, there were more than one). In the new partition entry, there could be four more links. The correct usage of these extended partitions was that the disc address was relative, while Linux considered it as absolute (or if it was the other way around), which resulted in partition hell.

Since DOS/Windows connects partitions to a drive number, I think you can assume there can be no more than 25 partitions on a disc.
User avatar
iansjack
Member
Member
Posts: 4703
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: the concept of subpartition

Post by iansjack »

GPT allows 128 partitions (in Windows) on a disk.

https://learn.microsoft.com/en-us/windo ... windows-11
Octocontrabass
Member
Member
Posts: 5568
Joined: Mon Mar 25, 2013 7:01 pm

Re: the concept of subpartition

Post by Octocontrabass »

rdos wrote: Mon Oct 21, 2024 8:04 amThis once worked, but I think Linux broke it all by using an incorrect concept.
According to whom? Last I checked, Linux agrees with Windows on how to handle MBR extended partitions.
ITchimp
Member
Member
Posts: 134
Joined: Sat Aug 18, 2018 8:44 pm

Re: the concept of subpartition

Post by ITchimp »

when you load the OS with bootloader like lilo and grub, can the running os peek into the partitions with other OSes might resides? Or it is completely unaware of other partitions?
Octocontrabass
Member
Member
Posts: 5568
Joined: Mon Mar 25, 2013 7:01 pm

Re: the concept of subpartition

Post by Octocontrabass »

ITchimp wrote: Mon Oct 21, 2024 2:34 pmwhen you load the OS with bootloader like lilo and grub,
Huh? Why does the bootloader matter?
ITchimp wrote: Mon Oct 21, 2024 2:34 pmcan the running os peek into the partitions with other OSes might resides? Or it is completely unaware of other partitions?
As long as the running OS understands the partition table, it can see the partitions. Whether it understands the contents of the partitions is another matter.
ITchimp
Member
Member
Posts: 134
Joined: Sat Aug 18, 2018 8:44 pm

Re: the concept of subpartition

Post by ITchimp »

minix3 allows sub partitions to have boot record. That is every drive has 4 partitions, every partition can be divided into 4 sub partitions... one of the partitions have a mbr
Octocontrabass
Member
Member
Posts: 5568
Joined: Mon Mar 25, 2013 7:01 pm

Re: the concept of subpartition

Post by Octocontrabass »

Minix 3 subpartitions are not standard. I have no idea if anything other than Minix 3 supports them.
rdos
Member
Member
Posts: 3297
Joined: Wed Oct 01, 2008 1:55 pm

Re: the concept of subpartition

Post by rdos »

I think all FAT partitions will have a boot record, but it's not used. It's only the BIOS Parameter Block (BPB) that is used by filesystem drivers. Other filesystems don't have this. OTOH, it's up to the boot loader what it does with this. With MBR, I only support booting from the first partition, and the boot loader is directly after (on sector 1 to 12). Other OSes might boot other boot records too.
rdos
Member
Member
Posts: 3297
Joined: Wed Oct 01, 2008 1:55 pm

Re: the concept of subpartition

Post by rdos »

Octocontrabass wrote: Mon Oct 21, 2024 10:28 am
rdos wrote: Mon Oct 21, 2024 8:04 amThis once worked, but I think Linux broke it all by using an incorrect concept.
According to whom? Last I checked, Linux agrees with Windows on how to handle MBR extended partitions.
They probably fixed it now, as this was many years ago.
nullplan
Member
Member
Posts: 1790
Joined: Wed Aug 30, 2017 8:24 am

Re: the concept of subpartition

Post by nullplan »

I guess I'm wondering what the point of subpartitions is. In the end, the MBR offers an array of 4 partitions, and the simplified Extended Partition scheme used by Windows, Linux, and many other operating systems, allows it to be extended by a linked list. Having multiple extended partitions, each using more than one of its partition table fields, would turn this into a tree. But I know of no operating system that would do anything with this tree other than flatten it back into a list. You end up with a massively more complicated data structure that can't do anything more than what the current system can.
Carpe diem!
User avatar
iansjack
Member
Member
Posts: 4703
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: the concept of subpartition

Post by iansjack »

When you install some BSDs as one of multiple OSs on a disk it will partition one physical partition into several subpartitions.
User avatar
BenLunt
Member
Member
Posts: 941
Joined: Sat Nov 22, 2014 6:33 pm
Location: USA
Contact:

Re: the concept of subpartition

Post by BenLunt »

I did a little research some time ago and found that a well-known OS documentation stated that if you use an Extended partition, there can only be one actual partition within that four-entry table, other than the Extended partition entry itself. This was to "protect" the partitions from MBRs that didn't understand Extended entries.

I wrote a little about it here.

Another thing within that post is that I wrote a small test utility. Place your MBR code in the first sector and see which partition is booted. This will test your MBR code to see if it correctly parses Extended partitions (which some may be nested). It includes source code so that you can modify the test to boot another partition to again test your MBR code.

It was a quick and dirty afternoon project to test my findings. It may or may not be useful to you.

Ben
Post Reply