Modifying mount points of USB Mass Storage devices

John (J5) Palmieri johnp at redhat.com
Wed Dec 7 19:01:51 PST 2005


Not completely sure what you want but you can merge and append keys in
fdi files:

 <merge key="volume.policy.desired_mount_point"
type="copy_property">@block.storage_device:storage.bus</merge>
          <append key="volume.policy.desired_mount_point"
type="string">disk</append>

so instead of type="string"  if you want to refer to a property just use
type="copy_property".  Notice the @block.storage_device: this follows a
udi and gives you access to it's keys.


On Wed, 2005-12-07 at 18:21 -0800, Bill Paxton wrote:
> I hate asking these kinds of questions, I've read the archives and 
> googled for a couple days but I can't figure it out on my own. Sorry.
> 
> So here we have a USB Mass Storage camera. I can tickle udev to make a 
> snazzy device name for it, that works well but it's just cosmetic. The 
> big deal comes from the fdi entry and the mount point. I don't care if 
> it's /dev/sd? but I do care where it gets mounted.
> 
> The Mass Storage entities has all kinds of uniquely identifiables;
> name, vendor, product, serial, etc.
> I can make an entry something like:
> 
> ---
> <device>
>  <match key="@storage.physical_device:info.bus" string="usb">
>   <match key="@storage.physical_device:usb.vendor_id" int="0x12345">
>     <match key="@storage.physical_device:usb.product_id" int="0x12345">
>      <merge key="volume.policy.desired_mount_point" 
> type="string">foo</merge>
>     </match>
>   </match>
>  </match>
> </device>
> ---
> 
> hotplug and udev and hal are all working fine...
> ... but fstab-sync makes the mount point /media/usbdisk
> 
> And it does make those entries in the corresponding udi when you check 
> it with lshal. But that's not where the actual mount is; it's a parent 
> device.
> 
> When looking at lshal, it's like the uniquely identifiable part is the 
> overall drive structure and the actual data partition has absolutely 
> nothing to I.D. it with other than the volume number and size:
> 
> ---
> udi = '/org/freedesktop/Hal/devices/volume_part1_size_262118912'
>   info.callouts.remove = {'fstab-sync'} (string list)
>   info.callouts.add = {'hald-add-selinux-mount-option', 'fstab-sync'} 
> (string list)
>   volume.policy.desired_mount_point = 'usbdisk'  (string)
>   volume.policy.mount_filesystem = 'vfat'  (string)
>   volume.policy.should_mount = true  (bool)
>   info.udi = '/org/freedesktop/Hal/devices/volume_part1_size_262118912'  
> (string)
>   volume.partition.msdos_part_table_type = 6  (0x6)  (int)
>   info.product = 'Volume (vfat)'  (string)
>   volume.size = 262118912  (0xf9f9e00)  (uint64)
>   volume.num_blocks = 511951  (0x7cfcf)  (int)
>   volume.block_size = 512  (0x200)  (int)
>   volume.partition.number = 1  (0x1)  (int)
>   info.capabilities = {'volume', 'block'} (string list)
>   info.category = 'volume'  (string)
>   volume.is_partition = true  (bool)
>   volume.is_disc = false  (bool)
>   volume.is_mounted = false  (bool)
>   volume.mount_point = ''  (string)
>   volume.label = ''  (string)
>   volume.uuid = ''  (string)
>   volume.fsversion = 'FAT16'  (string)
>   volume.fsusage = 'filesystem'  (string)
>   volume.fstype = 'vfat'  (string)
>   block.storage_device = 
> '/org/freedesktop/Hal/devices/storage_model_USB_DRIVEUNIT'  (string)
>   block.is_volume = true  (bool)
>   block.minor = 17  (0x11)  (int)
>   block.major = 8  (0x8)  (int)
>   block.device = '/dev/sdb1'  (string)
>   linux.hotplug_type = 3  (0x3)  (int)
>   info.parent = 
> '/org/freedesktop/Hal/devices/storage_model_USB_DRIVEUNIT'  (string)
>   linux.sysfs_path_device = '/sys/block/sdb/sdb1'  (string)
>   linux.sysfs_path = '/sys/block/sdb/sdb1'  (string)
> 
> ---
> 
> I need to refer to some of the elements listed in info.parent udi, 
> apparently, because there's not a single thing uniquely identifiable 
> here. Using the volume number and the partition size is unacceptable.
> 
> This is a child of the device that contains all the goodies that I can 
> use to uniquely identify this particular device. So there's got to be a 
> method to have the child inherit or at least refer. Right? This can't be 
> as hard as I'm making it, but the archives show lots of similar questions.
> 
> All I want to do is control the mount point of any media; that's ANY 
> media, any size, any format, anything, by the fact that it's being 
> served up from a USB Mass Storage device from vendor_id 0x12345 
> product_id 0x12345 (and/or other unique identifiers.)
> 
> Any help appreciated. Thanks for reading.
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around 
> http://mail.yahoo.com 
> _______________________________________________
> hal mailing list
> hal at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/hal
-- 
John (J5) Palmieri <johnp at redhat.com>



More information about the hal mailing list