libvolume_id: narrow down ufs detection
Andriy Gapon
avg at icyb.net.ua
Tue Aug 25 18:30:15 UTC 2009
I think that libvolume_id should compare fs size to provider size similarly to
what geom_label does and for the same reasons. With geom providers stacked upon
each other current libvolume_id may see the same fs on multiple volume-like devices.
An example:
o ad6s1a and ad10s1a comprise a geom_mirror named 'bootgm'
o there is a UFS on bootgm and it is labeled as 'bootfs'
Snippets from lshal output:
=======================
udi = '/org/freedesktop/Hal/devices/volume_label_bootfs_0'
block.device = '/dev/ad6s1a' (string)
block.is_volume = true (bool)
block.major = 0 (0x0) (int)
block.minor = 92 (0x5c) (int)
block.storage_device = '/org/freedesktop/Hal/devices/pci_8086_2922_storage_0'
(string)
info.capabilities = {'block', 'volume'} (string list)
info.category = 'volume' (string)
info.interfaces = {'org.freedesktop.Hal.Device.Volume'} (string list)
info.parent = '/org/freedesktop/Hal/devices/volume_part2_size_6440361984_0'
(string)
info.product = 'bootfs' (string)
info.subsystem = 'block' (string)
info.udi = '/org/freedesktop/Hal/devices/volume_label_bootfs_0' (string)
org.freedesktop.Hal.Device.Volume.method_argnames = {'mount_point fstype
extra_options', 'extra_options', 'extra_options'} (string list)
org.freedesktop.Hal.Device.Volume.method_execpaths = {'hal-storage-mount',
'hal-storage-unmount', 'hal-storage-eject'} (string list)
org.freedesktop.Hal.Device.Volume.method_names = {'Mount', 'Unmount', 'Eject'}
(string list)
org.freedesktop.Hal.Device.Volume.method_signatures = {'ssas', 'as', 'as'}
(string list)
volume.block_size = 512 (0x200) (uint64)
volume.fstype = 'ufs' (string)
volume.fsusage = 'filesystem' (string)
volume.fsversion = '2' (string)
volume.ignore = false (bool)
volume.is_disc = false (bool)
volume.is_mounted = false (bool)
volume.is_mounted_read_only = false (bool)
volume.is_partition = false (bool)
volume.label = 'bootfs' (string)
volume.mount.valid_options = {'ro', 'noexec', 'noatime'} (string list)
volume.mount_point = '' (string)
volume.num_blocks = 4194304 (0x400000) (uint64)
volume.size = 2147483648 (0x80000000) (uint64)
volume.uuid = '' (string)
===============================
udi = '/org/freedesktop/Hal/devices/volume_label_bootfs'
block.device = '/dev/ufs/bootfs' (string)
block.is_volume = true (bool)
block.major = 0 (0x0) (int)
block.minor = 112 (0x70) (int)
block.storage_device = '/org/freedesktop/Hal/devices/pci_8086_2922_storage'
(string)
info.capabilities = {'block', 'volume'} (string list)
info.category = 'volume' (string)
info.interfaces = {'org.freedesktop.Hal.Device.Volume'} (string list)
info.parent = '/org/freedesktop/Hal/devices/volume_size_2147483136' (string)
info.product = 'bootfs' (string)
info.subsystem = 'block' (string)
info.udi = '/org/freedesktop/Hal/devices/volume_label_bootfs' (string)
org.freedesktop.Hal.Device.Volume.method_argnames = {'mount_point fstype
extra_options', 'extra_options', 'extra_options'} (string list)
org.freedesktop.Hal.Device.Volume.method_execpaths = {'hal-storage-mount',
'hal-storage-unmount', 'hal-storage-eject'} (string list)
org.freedesktop.Hal.Device.Volume.method_names = {'Mount', 'Unmount', 'Eject'}
(string list)
org.freedesktop.Hal.Device.Volume.method_signatures = {'ssas', 'as', 'as'}
(string list)
volume.block_size = 512 (0x200) (uint64)
volume.fstype = 'ufs' (string)
volume.fsusage = 'filesystem' (string)
volume.fsversion = '2' (string)
volume.ignore = false (bool)
volume.is_disc = false (bool)
volume.is_mounted = true (bool)
volume.is_mounted_read_only = false (bool)
volume.is_partition = false (bool)
volume.label = 'bootfs' (string)
volume.mount.valid_options = {'ro', 'noexec', 'noatime'} (string list)
volume.mount_point = '/.bootdir' (string)
volume.num_blocks = 4194303 (0x3fffff) (uint64)
volume.size = 2147483136 (0x7ffffe00) (uint64)
volume.uuid = '' (string)
=============================
I think that UFS on the first volume should not be reported.
--
Andriy Gapon
More information about the freebsd-gnome
mailing list