KIO::is_manually_mounted() and device UUIDs

Krzysztof Lichota krzysiek at lichota.net
Thu Apr 26 08:23:45 BST 2007


Stephen Leaf napisaƂ(a):
> On Wednesday 25 April 2007 18:08:30 David Faure wrote:
>> KIO::is_manually_mounted() greps /etc/fstab for the "noauto" option, for a
>> given device. But this doesn't work anymore, now that kubuntu converted
>> /etc/fstab to use UUIDs instead of device names:
>>
>> # /dev/sda7 -- converted during upgrade to edgy
>> UUID=2c31247e-d3a0-11da-bd28-314ffa00bcaa /home ext3 defaults 0 2
>>
>> I tried using KMountPoint::currentMountPoints with
>> KMountPoint::NeedMountOptions but this doesn't help, because /etc/mtab
>> keeps the mount options but not "noauto" (since it doesn't care about it).
>>
>> Any other ideas? How would I go about finding the uuid of a given device?
>>
>> I know, this all sounds hackish, but this is the best way to know if we
>> should keep a watch (with kdirwatch) on a given directory being listed by
>> kdirlister; manually mounted directories (like CDROMs or USB keys) cannot
>> be unmounted if FAM is watching a given directory (#37780).
> 
> May help 
> In /dev/disk/by-uuid/ you'll find a bunch of symlinks to their devices.
> 
> This of course depends on a udev rule that maybe distro dependent. probably 
> isn't anything we can rely on always being available.
> 
> /etc/udev/rules.d/60-persistent-storage.rules:ENV{ID_FS_USAGE}=="filesystem|
> other|crypto", ENV{ID_FS_UUID}=="?*", 
> SYMLINK+="disk/by-uuid/$env{ID_FS_UUID}"
> 

Isn't it a task for HAL?
As far as I can see in lshal, there are "storage.automount_enabled_hint"
and "volume.uuid" keys which sound like doing the right job.

HTH

	Krzysztof Lichota

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 254 bytes
Desc: OpenPGP digital signature
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20070426/576c0efd/attachment.sig>


More information about the kde-core-devel mailing list