- Debugger: Getting mixed signals
- 'Packaging Infrastructure' Contract Weekly Report #4
- Haiku monthly activity report - 06/2015
- 'Packaging Infrastructure' Contract Weekly Report #3
- 'Packaging Infrastructure' Contract Weekly Report #2
- GCI 2014 winners trip report (mentor side)
- TeX Live and LyX; Changes to the boot code
- 'Packaging Infrastructure' Contract Weekly Report #1
- Beginning of 'Packaging Infrastructure' Contract
- Haiku monthly activity report - 05/2015
Finishing up extended partitions
Aloha Haiku Land!
I have been putting the finishing touches on support for Extended Partitions today. For those of you who do not know the Master Boot Record or an MBR can only contain 4 primary partitions. This leaves something to be desired when you want to run a bunch of operating systems or split your install across multiple partitions. There is a way however to get as many partitions as you want however by creating what is called an Extended Partition.
Extended Partitons are interesting because unlike the MBR that is just a table, Extended Partitions (actually Logical Partitions) form a Link List structure on the physical media. While this makes them more flexible it also adds a little more complexity to the scheme. So things took a little longer than I thought they would. I have however become pretty good using a hex editor (HUGS DiskProbe) which is something I have never used before.
The good news is that everything seems to be working well. There are probably still bugs. This is something that will need more testing so I would urge anyone who wants to test this out, to do so somewhere that does not contain critical data or make sure you have backups. *THIS COULD DESTROY EVERYTHING* -or at least you partition tables- but hopefully it will work as expected. On that note I have been able to use logical partition that DriveSetup created to install and run Haiku! It also seems to work pretty well with parted (gparted).
So to wind up my final days as a GSoC student I will be fixing UI bugs and looking for more bugs and starting on GPT write support.
Happy Hacking,
Bryce
- bebop's blog
- Login or register to post comments

Comments
That's timely for Alpha 1!
Nice job, Bryce.
Your contribution is welcome right before going to public alpha. We now have a native builtin tool to create/delete/init primary and extended/logical Intel partition without requiring an external tool.
Time are becoming exciting for Haiku.
Re: Finishing up extended partitions
Does it will allow to resize partitions ? (One of the feature BeOS's Drivesetup lacked)
I think if your tool is about to modify the MBR, it should be merged with the boot manager.
BTW, is there already a bootman for Haiku ?
Thanks indeed for your work Bryce !
Re: Finishing up extended partitions
BTW, is there already a bootman for Haiku ?
There's bootman, which looks and feels exactly like BeOS boot manager. (Does it contain the Mandelbrot easter egg?)
Nice to hear that the logical partition support is integrated into Haiku. Well done!
Re: Finishing up extended partitions
Awesome work Bryce :)
This was indeed one of the more annoying missing pieces in Haiku, preventing a simple installation process for new users of Haiku.
I'm guessing that partition resize will come, but the harder part will likely be the ability to resize filesystems.
Also, yes bootman does exist, just type "bootman" from a terminal while in Haiku :D
Note: Bootman needs some love as well, since it doesn't currently support installing to or booting from more than disk yet.
Re: Finishing up extended partitions
Yes, the ability to resize a partition is rather related to the filesystem, then to the DriveSetup. And if Haiku's reincarnation of bfs allows it, can be easy integrated to DriveSetup.
My question is: having extended partition nested layout is there a physical limit to number of logical partitions (Linux is limited to 64 device names for a hard disk)? Is it practical to force such a limit?
Alexandru.
Re: Finishing up extended partitions
First, thanks for the comments and sorry it took me so long to respond.
Bootman works well if you have an "intel" style partition layout and do not have a gpt header/"system partition" after the MBR. I would really like to add support for gpt in bootman because I have an Intel Mac and would like to not have to use grub. However this will probably take some time before it can be implemented correctly.
As far as resize, it is in the framework already (at least partition resize/moving) however as Urias pointed out, it is mainly the job of the filesystem, as the partitioning system knows nothing about the filesystem it contains. In fact the type of the partition does not even need to be the same as the filesystem. If I ever become a filesystem guru I will attempt this :)
As far as extended partition limitations, we have no fixed amount of extended partitions. I am not sure if devfs has a limit on how many nodes it can create but I would be surprised if there was a hard limit on this. If you try to create a bunch of partitions and you find you can only create a certain amount let me know.