Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Some background information on drive partitioning System
For those planning to partition their drives (e.g. for Linux installation side by side with MacOSX, or to create separate partitions for /Users, Swap, Scratch and so on...), take care to not exceed six to eight partitions (on a single disk, that is).

The pdisk man page (% man pdisk) recommends:
Creating more than fifteen partitions is not advised. There is currently a bug in the some (all?) of the kernels which causes access to the whole disk fail if more than fifteen partitions are in the map.
I can confirm this bug for the Linux kernel, and others have observed the same under Darwin. Remember that Apple partition maps and drivers take the first eight to ten partitions.

Read the rest of the article to see a typical partition map and for a bit more info on this subject...

[Editor's note: I have no personal knowledge of this potential issue, so I can't confirm this article. I'm publishing it in the hopes that it inspires some comments either confirming or denying the presence of the bug in the OS X kernel.]

Here is how it looks on the (only) 20GB disk in my iBook600:
/dev/disk0  map block size=512
#: type name length base ( size )
1: Apple_partition_map Apple 63 @ 1
2: Apple_Driver43*Macintosh 54 @ 64
3: Apple_Driver43*Macintosh 74 @ 118
4: Apple_Driver_ATA*Macintosh 54 @ 192
5: Apple_Driver_ATA*Macintosh 74 @ 246
6: Apple_FWDriver Macintosh 200 @ 320
7: Apple_Driver_IOKit Macintosh 512 @ 520
8: Apple_Patches Patch Partition 512 @ 1032
9: Apple_HFS MacOSX 18432000 @ 1544 ( 8.8G)
10: Apple_HFS MacOS9 10240000 @ 18433544 ( 4.9G)
11: Apple_HFS Scratch 1331200 @ 28673544 (650.0M)
12: Apple_HFS Apple_Bootstrap 65536 @ 30004744 ( 32.0M)
13: Apple_HFS Linux_Swap 524288 @ 30070280 (256.0M)
14: Apple_HFS Linux_Root 6511418 @ 30594568 ( 3.1G)
15: Apple_HFS Linux_Home 1964094 @ 37105986 (959.0M)
Also, if you partition your driver with Apple Drive Setup, the program will create an unallocated partition at the end of the drive (Apple_Free type) to top the total number of blocks (so that there won't be spare blocks). This will impact the partition process in two ways:
  1. It will subtract one partition out of 15 :-(
  2. It will steal valuable disk space (in my case 959.0M)
As you can see above, wit pdisk it is possible to rescue this unallocated partition and to convert it to a usable partition ;-)
    •    
  • Currently 4.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (1 vote cast)
 
[7,688 views]  

Some background information on drive partitioning | 11 comments | Create New Account
Click here to return to the 'Some background information on drive partitioning' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
clarification.
Authored by: bhines on Jun 25, '02 06:32:29AM
This was discussed in march on darwin-development, search the archives for pdisk. In summary I don't think we have to worry about it on OS X.
Date: Sun, 24 Mar 2002 11:00:15 +0000 Subject: Re: pdisk man page comment clarification... From: Ken FitzGerald-Smith To: darwin-development@lists.apple.com > From the pdisk man page: > > "Creating more than fifteen partitions is not advised. There is > currently a > bug in the some (all?) of the kernels which causes access to the > whole disk > fail if more than fifteen partitions are in the map." > > Is this still true? What is the problem? > > -Kevin Elliott > Software Engineer There is 1 good reason why 15 partitions could have been a limitation and that is because if you were creating a ISO/HFS hybrid CD your partition map would necessarily be limited to 63 sectors, ie sector 1 to 63. Since the map needed to be readable at boot time, it had to be laid out in 2K blocks thus yielding 15 as a max. I do not include the ddm in sector 0 as part of the map in the above maths. This condition is still true today if you want to preserve the ISO blocks that must start at block 16/Sector 64 on a CD. > I just create a disk image with 61 data partitions (the max for a > 63-sector pmap partition created by pdisk, with 1 for the pmap > itself and > one for the Apple_Free at the end). There is no requirement for an apple free at the end of the partition map. > All device nodes were created correctly. Interestingly, I but a UFS > partition on each one, but autodiskmount totally croaked and > claimed there > were no filesystems. Hmmmm... I will see if I can reproduce... > Ken From: "David A. Gatwood" To: Ken FitzGerald-Smith cc: darwin-development@lists.apple.com Subject: Re: pdisk man page comment clarification... On Sun, 24 Mar 2002, Ken FitzGerald-Smith wrote: > There is 1 good reason why 15 partitions could have been a > limitation and that is because if you were creating a ISO/HFS > hybrid CD your partition map would necessarily be limited to 63 > sectors, ie sector 1 to 63. Since the map needed to be readable at > boot time, it had to be laid out in 2K blocks thus yielding 15 as a > max. I do not include the ddm in sector 0 as part of the map in the > above maths. The cause of this issue has to do with the major/minor number allocation in Linux. Each device is assigned exactly one major number, and there are only 16 minor numbers per major number. One minor number is reserved for the "whole disk partition", leaving room for fifteen partitions. If the mapping mechanism is broken, you'd get partition 16 instead of the "whole disk" partition, or worse.


[ Reply to This | # ]
clarification.
Authored by: gvitale on Jun 25, '02 06:55:50AM

I'm sorry, but after reading this I do not see why the 15 partitions limit is not an issue in Darwin



[ Reply to This | # ]
Is is an issue?
Authored by: porkchop_d_clown on Jun 25, '02 08:15:28AM

Well, the important point is that it "isn't a bug it's a feature!" in other words, the partitioning code is broken as designed, not broken because of an error in the kernel programming.

As the previous poster noted there are valid technical reasons that limit the size of the partition map and the absolute number of partitions on a drive.

I guess for me the question is why does Apple reserve so many hidden partitions?



[ Reply to This | # ]
clarification.
Authored by: bhines on Jun 26, '02 05:54:54AM

"This condition is still true today if you want to preserve the ISO
blocks that must start at block 16/Sector 64 on a CD."

Is your main hard drive CD?



[ Reply to This | # ]
Man Page
Authored by: JohnnyMnemonic on Jun 25, '02 09:07:01AM

I've read the manpage on pdisk, but can't quite get it to show the list like in the parent comment. Assuming my drive is at /dev/disk0, what is the exact command string? I'm more curious than attempting to edit my partitions.



[ Reply to This | # ]
Man Page
Authored by: gvitale on Jun 25, '02 09:30:59AM

% sudo pdisk
Password:
Top level command (? for help): ?
Notes:
Base and length fields are blocks, which vary in size between media.
The name of a partition is descriptive text.

Commands are:
h print help
v print the version number and release date
l list device's map
L list all devices' maps
e edit device's map
r toggle readonly flag
a toggle abbreviate flag
p toggle physical flag
q quit the program
Top level command (? for help): e /dev/disk0
/dev/disk0
Command (? for help): p



[ Reply to This | # ]
Man Page
Authored by: houchin on Jun 25, '02 11:31:07AM

At least on my system, the man page for pdisk does not match the usage given by the application.

Try "sudo pdisk /dev/disk0 -dump"
(pdisk needs root access to read the partition map)



[ Reply to This | # ]
Limited # of partitions - yep
Authored by: barryjaylevine on Jun 26, '02 11:41:27PM

This could be why burning about 17 sessions or more on a single CD creates problems reading that CD. I was doing some beta-testing for James Sentman's CD Session Burner (a most excellent program, by the way!) and I wanted to see what would happen if I just kept burning small sessions until "something went wrong" (y'know, normal stress-testing).

CD Session burner runs in OSX only and, yes, there is a distinct "hit" to the mounting process as you create add'l sessions (partitions, of course). Finally, the sessions stop mounting.

In OS9, the "20-session" CD (created in OSX) only mounted the first 15 or so sessions.

This is obviously an OS issue and NOT (I wish to stress) a problem with CD Session Burner as normal use (way fewer than 17 sessions) works just fine!

Barry



[ Reply to This | # ]
man pages are frequently wrong
Authored by: magill on Jun 27, '02 04:46:41AM

This is yet another case where the OS X man page bares no relationship to reality.

Believing the man pages in ANY Unix is a dangerous thing. They are simply intended as "refreshers" for information that you already know... are usually only ever written once; and are virtually never updated.

In general, if the program adheres to standard Unix conventions,
"<command> -h" will give you a list of the command's syntax. Frequently, however, you simply need to give it any bad (or unexpected) parameter and it will disgorge the same information.



[ Reply to This | # ]
man pages are frequently wrong
Authored by: magill on Jun 27, '02 04:51:34AM

This is yet another case where the OS X man page bares no relationship to reality.

Believing the man pages in ANY Unix is a dangerous thing. They are simply intended as "refreshers" for information that you already know... are usually only ever written once; and are virtually never updated.

In general, if the program adheres to standard Unix conventions,
"<command> -h" will give you a list of the command's syntax. Frequently, however, you simply need to give it any bad (or unexpected) parameter and it will disgorge the same information.



[ Reply to This | # ]
My G5 has only 5 partitions
Authored by: rae on Nov 18, '03 11:07:11PM
On my G5 I don't have anywhere near as many partitions:
Top level command (? for help): L   
/dev/rdisk0  map block size=512
   #:                 type name                  length   base      ( size )
   1:  Apple_partition_map Apple                     63 @ 1        
   2:           Apple_Free                     41685440 @ 64        ( 19.9G)
   3:           Apple_Free                            0+@ 41685504 
   4:            Apple_HFS Apple_HFS_Untitled_5 448287088 @ 41947648  (213.8G)
   5:           Apple_Free                            0+@ 490234736

Device block size=512, Number of Blocks=490234752
DeviceType=0x0, DeviceId=0x0
I left 20 Gig of space for a Linux install later, which should end up as two partitions replacing the 20 Gig "Apple Free". I am guessing that not supporting Mac OS 9 booting helps keep the number of partitions down?

[ Reply to This | # ]