[parted-devel] Warning message if create partition when a partition is mounted

Curtis Gedak gedakc at gmail.com
Mon Oct 19 22:41:19 UTC 2009


Jim Meyering wrote:
> Curtis Gedak wrote:
>
>   
>> The reason I have been following up on this, perhaps incorrectly, is
>> because there is legacy code in GParted that uses the
>> ped_disk_commit_to_os() to determine if a device can have it's
>> partition table re-read by the kernel.
>>     
>
> But that is only useful if that partition table has been changed.
> Is GParted changing partition tables that have mounted partitions?
> If so, wouldn't it be better to refuse to do that, requesting that the
> user first unmount those partitions?
>   

The existing functionality in GParted does permit adding partitions and 
manipulating unmounted partitions on a device that has a partition 
mounted.  Parted permits this functionality too including with BETA 
parted-2.0.  Whether this is planned functionality in parted or not is 
another question.  The only restriction is that mounted partitions can 
not be modified and this makes sense to me.

This ability permits a person to run parted or gparted from a mounted 
partition that contains the operating system.  If the drive has 
additional free space on it, then the user can create new partitions, or 
manipulate unmounted partitions on the same device.

I know that a person can boot from a LiveCD and hence have no mounted 
partitions on a device.  This is what we often recommend for users 
wishing to edit partitions.

I see that Karel Zak has contributed to this discussion as well.  My 
knowledge of the kernel internals is minimal.  Perhaps some of Karel's 
suggestions would permit the kernel's vision of the partition table to 
be properly kept up-to-date while still permitting parted, and gparted 
to add or remove partitions from a device that has at least one 
partition mounted?

Again I defer to your decisions on what features parted will offer and 
support.

Curtis



More information about the parted-devel mailing list