Re: Rereading A Partition Table
Re: Rereading A Partition Table
- Subject: Re: Rereading A Partition Table
- From: "Duane Murphy" <email@hidden>
- Date: Thu, 16 Aug 2007 08:38:13 -0700
--- At Thu, 16 Aug 2007 10:53:50 -0400, Dan Markarian wrote:
>Hey Duane,
>
>We do not detect live changes to a partition map in Tiger.
Thanks. Then I am back to my original question. When Disk Utility
(diskutil) partitions a drive it takes it off-line then puts it back on-
line. Clearly this causes everything to be re-read.
I'd like to do the same thing. Disk Arbitration doesn't seem quite the
right tool for doing this. In fact even Disk Utility does not fully
"eject" a firewire disk unless it is partitioning.
I surely don't want to request the user to restart just to re-read
changes to a disk.
Is there somewhere I should look for how to do this? Another mailing list?
Thanks for the help.
>On 15 Aug 2007, at 9:58 PM, Duane Murphy wrote:
>
>> --- 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