Re: Rereading A Partition Table
Re: Rereading A Partition Table
- Subject: Re: Rereading A Partition Table
- From: "Duane Murphy" <email@hidden>
- Date: Wed, 15 Aug 2007 18:58:15 -0700
--- At Wed, 15 Aug 2007 17:26:42 -0700, Chris Sarcone wrote:
>Duane --
>
>I'm making changes to GUID partition disks partition table, and I would
>like the system to re-read the disk in order to recognize new partitions
>on the disk.
>
>What do I need to do to get the system to re-read the disk and recognize
>the changes?
>
>I've tried several disk util commands (unmountDisk, mountDisk, and
>eject) but they don't re-read the disk.
>
>Disk Utility->Eject does the same thing (ie nothing).
>
>I note that this is a FireWire drive, but it could also be an internal
>drive or any other non-network drive.
>
>For example, when Disk Utility partitions a disk, it fully unmounts and
>then remounts the disk. How can I do the same thing?
>
>Try opening and closing the raw disk node for the whole device.
>
Hi Chris,
That's what I was told. In fact, I am editing the partition table using /
dev/rdisk1
(or whatever number). But when it is closed it doesn't do anything.
Here's how I open. inDisk is "/dev/rdisk1" (for example);
int diskDescriptor
= open( inDisk, O_RDWR | O_SHLOCK, S_IRUSR | S_IWUSR | S_IRGRP );
later I just
close( diskDescriptor );
There's no errors and in fact, the disk is nicely edited. If I unplug
the drive and plug it back in the partitions looks exactly like what I
want, but it's hard to do that for internal disks. :-)
...Duane
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden