# FreeBSD 10.0: usb-memstick automount not working



## wearesix (Feb 12, 2014)

Hello all,

I have a fresh installation of FreeBSD 10.0 (i386) on a Sony vaio notebook.  Plugging a USB memstick (FAT32) won't be recognized by any DE (e.g KDE or Xfce).

I am able to mount this memstick as root and as normal-user, but automounting via any DE doesn't work!  After mounting  this device  manually, accessing works perfectly. A prior installation of FreeBSD 9.1 on this notebook was working properly. The device notifier (KDE) recognized the memstick immediately. 

But FreeBSD 10.0 behaves different. The configuration files for user mounting were changed as described in Chap. 18.5.
When inserting a CD, it will be recognized and mounted by KDE or Xfce4.

I tried to find the difference between FreeBSD 9.1 and 10.0, when plugging a USB memstick by comparing the lshal outputs; FreeBSD 9.1 generates a block device /dev/da0s1, FreeBSD 10.0 does not:

Part of `lshal` (only FreeBSD 9.1)

```
udi = '/org/freedesktop/Hal/devices/volume_uuid_7C21_DD79'
  block.device = '/dev/da0s1'  (string)
  block.is_volume = true  (bool)
  block.major = 0  (0x0)  (int)
  block.minor = 139  (0x8b)  (int)
  block.storage_device = '/org/freedesktop/Hal/devices/storage_serial_AA00000000002449'  (string)
  info.capabilities = {'block', 'volume'} (string list)
  info.category = 'volume'  (string)
  info.interfaces = {'org.freedesktop.Hal.Device.Volume', 'org.freedesktop.Hal.Device.Volume'} (string list)
  info.parent = '/org/freedesktop/Hal/devices/storage_serial_AA00000000002449'  (string)
  info.product = 'Volume (vfat)'  (string)
  info.subsystem = 'block'  (string)
  info.udi = '/org/freedesktop/Hal/devices/volume_uuid_7C21_DD79'  (string)
  org.freedesktop.Hal.Device.Volume.method_argnames = {'mount_point fstype extra_options', 'extra_options', 'extra_options', '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', 'hal-storage-mount', 'hal-storage-unmount', 'hal-storage-eject'} (string list)
  org.freedesktop.Hal.Device.Volume.method_names = {'Mount', 'Unmount', 'Eject', 'Mount', 'Unmount', 'Eject'} (string list)
  org.freedesktop.Hal.Device.Volume.method_signatures = {'ssas', 'as', 'as', 'ssas', 'as', 'as'} (string list)
  volume.block_size = 512  (0x200)  (uint64)
  volume.fstype = 'vfat'  (string)
  volume.fsusage = 'filesystem'  (string)
  volume.fsversion = 'FAT32'  (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 = true  (bool)
  volume.label = ''  (string)
  volume.mount.valid_options = {'ro', 'noexec', 'noatime', 'longnames', 'shortnames', 'nowin95', '-u=', '-g=', '-m=', '-M=', '-L=', '-D=', 'large', 'ro', 'noexec', 'noatime', 'longnames', 'shortnames', 'nowin95', '-u=', '-g=', '-m=', '-M=', '-L=', '-D=', 'large'} (string list)
  volume.mount_point = ''  (string)
  volume.num_blocks = 31162336  (0x1db7fe0)  (uint64)
  volume.partition.media_size = 15955116032  (0x3b6ffc000)  (uint64)
  volume.partition.number = 2  (0x2)  (int)
  volume.partition.scheme = 'mbr'  (string)
  volume.partition.start = 16384  (0x4000)  (uint64)
  volume.partition.type = '0x0'  (string)
  volume.size = 15955116032  (0x3b6ffc000)  (uint64)
  volume.uuid = '7C21-DD79'  (string)
```
 
Part of `dmesg` (FreeBSD 9.1)

```
ugen0.2: <SMI Corporation> at usbus0
umass0: <SMI Corporation USB DISK, class 0/0, rev 2.00/11.00, addr 2> on usbus0
umass0:  SCSI over Bulk-Only; quirks = 0x4000
umass0:3:0:-1: Attached to scbus3
da0 at umass-sim0 bus 0 scbus3 target 0 lun 0
da0: <SMI USB DISK 1100> Removable Direct Access SCSI-4 device 
da0: 1.000MB/s transfers
da0: 15216MB (31162368 512 byte sectors: 255H 63S/T 1939C)
```

FreeBSD 10.0 

`pkg info` : hal-0.5.14_23

PolicyKit.conf:

```
<config version="0.1">
    <define_admin_auth group="wheel"/>

    <match user="root|lutz">
	<return result="yes"/>
    </match>

  <match action="org.freedesktop.hal.storage.mount-removable">
   <match user="lutz">
     <return result="yes"/>
   </match>
  </match>

</config>
```

sysctl.conf:

```
#security.bsd.see_other_uids=0
vfs.usermount=1
hw.syscons.bell=0
#hw.psm.synaptics_support=1
kern.ipc.shm_allow_removed=1
compat.linux.osrelease=2.6.16
```

Part of `dmesg` (FreeBSD 10.0)

```
ugen0.2: <SMI Corporation> at usbus0
umass0: <SMI Corporation USB DISK, class 0/0, rev 2.00/11.00, addr 2> on usbus0
umass0:  SCSI over Bulk-Only; quirks = 0x4000
umass0:2:0:-1: Attached to scbus2
da0 at umass-sim0 bus 0 scbus2 target 0 lun 0
da0: <SMI USB DISK 1100> Removable Direct Access SCSI-4 device 
da0: Serial Number AA00000000002449
da0: 1.000MB/s transfers
da0: 15216MB (31162368 512 byte sectors: 255H 63S/T 1939C)
da0: quirks=0x3<NO_SYNC_CACHE,NO_6_BYTE>
```

The only way to mount an usb-device is `mount_msdosfs /dev/da0s1 /mnt`.

I'd like to mount a USB device via KDE or xfce4. Any ideas?

Thank you in advance!


----------



## Chris_H (Apr 11, 2014)

I can't speak to /usr/ports/x11/kde4. But where Xfce4 is concerned. I usually build/install /usr/ports/sysutils/xfce4-mount-plugin. Which provides a clickable mount icon, on your panel. You can even choose the command to be used to mount devices.
Just out of curiosity; what's the contents of your /etc/fstab file? eg; `cat /etc/fstab`.

--Chris


----------

