KIO::is_manually_mounted() and device UUIDs
Stephen Leaf
smileaf at smileaf.org
Thu Apr 26 00:39:34 BST 2007
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}"
--
Stephen Leaf
More information about the kde-core-devel
mailing list