UDisks: partition resize/move support
David Zeuthen
zeuthen at gmail.com
Mon Nov 7 11:56:19 PST 2011
Hey,
2011/11/7 Иво Георгиев <ivo at linvo.org>:
> Shouldn't the method contain "filesystem" (since it will re-size the
> file-system first), or it would not re-size file-systems (only modifying the
> partition table)?
I think we need to have both, e.g.
Filesystem.Resize()
and
Partition.Resize()
Applications would then use the Filesystem.Resize(), then
Partition.Resize() when shrinking and the opposite order when growing.
If we add support for e.g. LVM we could also have something like
LVMPV.Resize() etc etc. (but there are no plans for supporting LVM
right now).
Btw, we probably also want a way to get the size the filesystem think
the device is... for example on ext4 this is
# tune2fs -l /dev/sdb1 |grep "Block count"
Block count: 488448
We'd then store this as a property on the Filesystem interface. With
this we can also make the UI print a warning, e.g. something like "the
device is 10TB but the filesystem is only 8TB [Fix problem]". This is
also useful if you e.g. use the UI for your hardware RAID to resize
the device. I'm going to ask Karel (the util-linux / libblkid guy) for
this.
> And actually, from what I understand, the current UDisks partition modify
> helper has the ability to change the offset/size of an existing entry in the
> partition table (of course, without touching the FS itself), but the UDisks
> daemon does not allow this through the D-Bus API - judging from a quick code
> check, when partition modify is requested, it always passes the current
> size/offset to the helper.
>
> Also, if I want to create a private (since this functionality is not planned
> for this branch of udisks) patch to allow changing the partition table, what
> do I have to call in a helper (or in the demon, after the helper finishes
> execution) to force UDisks update partition table data?
The current code in master simply shells out to the parted(8),
sgdisk(8) and sfdisk(8) tools to do the heavy lifting. I expect the
implementation of Partition.Resize() to do something similar. Ideally
libparted would be used but that library just doesn't do what I need.
David
More information about the devkit-devel
mailing list