Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Device File convenience methods



On Friday, June 15, 2001, at 12:26 PM, Ryan Dary wrote:

Are there any functions which can take a device name like "disk1" and
determine if it is a whole device, or a partition of a device?

If you use IORegistryExplorer, you can see that the IOKit node corresponding to BSD name disk0 has a property Whole=YES, while BSD name disk0s9 has Whole=NO. A more complex way would be climb the IOKit tree and see if you run into an Apple_partition_scheme, but I don't that's particularly robust, or a good idea (the IOKit tree on intel might not use it, for example)

I am pretty sure that I can just assume that:

disk1 - whole device
disk1s0 - partition of device disk1

Right?

I know that data CDs look like disk1s1 for whole disk, disk1s1s10 for a partition. I'm not sure why, though. The rationale might be in the xnu sources, though.

But I am wondering if this is standard "trusted" naming conventions (for
storage devices) or if it is possible for them to have other naming
conventions.

Shantonu


References: 
 >Device File convenience methods (From: "Ryan Dary" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.