Re: finding the offset of a partition
site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com On Feb 3, 2006, at 8:40 AM, Jason Bobier wrote: -rick Thanx, Jason -- Jason Bobier jason@prismatix.com Space Cowboy http://www.prismatix.com/ On Feb 2, 2006, at 11:28 PM, Justin C. Walker wrote: On Feb 2, 2006, at 22:49 , Jason Bobier wrote: Regards, Justin -- Justin C. Walker, Curmudgeon-At-Large Institute for the Absorption of Federal Funds -------- If you're not confused, You're not paying attention -------- This email sent to jason@prismatix.com ________________________________________________________________ This message could have been secured by PGP Universal. To secure future messages from this sender, please click this link: _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... In the driver, the disk and the partition are represented by IOMedia objects and you can use getBase on the partition to know where it is relative to the disk. So the system knows how the two are related. I'm trying to get the offset on disk of a particular file. In order to do this I use F_LOG2PHYS which gives me the offset from the beginning of the partition. So I need to add the partition offset somehow. IMHO, this is bad idea. What happens if the file turns out to be on striped RAID volume? Also, there are many different types of partitioning schemes that Mac OS X supports, but I don't believe there is any API that you could use for generically finding the start of a partition on each one. I only see sizes in the IO Registry for partitions. I think you are better off using the offset from the start of the partition. It's hard to pull yourself up by your bootstraps if your feet are bare. I can't seem to find a way to find the offset of a partition on a drive without reading the partition table myself. Is there an easy way to do this? i.e. given disk1s1 what is it's offset from the beginning of disk1? AFAIK, there is nothing intrinsic about partitions. It's the partition table that defines them. That's what the system uses to find them, when partitions on a disk are mounted. Why do you think it's otherwise possible? _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/jason% 40prismatix.com https://keys.prismatix.com/b/b.e?r=darwin-dev% 40lists.apple.com&n=nZyHwo255DU%2F6VzP%2BOTPvw%3D%3D _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/rsulack%40apple.com This email sent to rsulack@apple.com __ rick sulack darwin core os group apple computer, inc -------------------------------------------------------------- "More computing sins are committed in the name of efficiency (without necessarily achieving it) than for any other single reason - including blind stupidity" -Wulf 1972 This email sent to site_archiver@lists.apple.com
participants (1)
-
Rick Sulack