USB sticks and drives do not automount correctly
If you are experiencing problems with automounting usb sticks and/or drives, but do not have problems with automounting CDs or DVDs, and if you are able to manually mount the USB device in question, then you should create the file "preferences.fdi" in the folder /etc/hal/fdi/policy and paste the following line into the file
Code:
<merge key="volume.ignore" type="bool">false</merge>
Also, if you have gparted installed, you might need to delete this file:
Code:
/usr/share/hal/fdi/policy/gparted-disable-automount.fdi
as being mentionned at the end of this thread
Another USB automounting fix From Antix: None of these solutions worked for automounting usb sticks on my SONY VGN-N365E notebook running XFCE.
I edited /etc/dbus-1/system.d/hal.conf and changed the "0" below to my username:
Code:
<policy user="0">
<allow send_interface="org.freedesktop.Hal.Device.SystemPowerManagement"/>
<allow send_interface="org.freedesktop.Hal.Device.VideoAdapterPM"/>
<allow send_interface="org.freedesktop.Hal.Device.LaptopPanel"/>
<allow send_interface="org.freedesktop.Hal.Device.Volume"/>
<allow send_interface="org.freedesktop.Hal.Device.Volume.Crypto"/>
</policy>
Now everything automounts fine.
Using PMountIf like me you couldn't get any of the above to work you may try to install pmount. PMount is a wrapper around the standard mount program which permits normal users to mount removable devices without a matching /etc/fstab entry.
Auto-mount only removable mediaBy default hal automounts all available partitions not mounted in /etc/fstab and create desktop icons for them. To override this behavior and automount only removable drives, just add this rule:
Code:
<device>
<match key="storage.hotpluggable" bool="false">
<match key="storage.removable" bool="false">
<merge key="storage.automount_enabled_hint" type="bool">false</merge>
</match>
</match>
</device>
If you are running KDE, and the device is being automounted (i.e. it comes up in Konquerer), but it is not on the desktop go to control center -> Desktop -> Behavior -> Device Symbols (3rd Tab) and make sure the box is checked.
Automount NTFS filesystems with write support (ntfs-3g)If you want write support for automounted NTFS filesystems, you must install ntfs-3g, then add this rule:
Code:
<device>
<match key="volume.fstype" string="ntfs">
<match key="@block.storage_device:storage.hotpluggable" bool="true">
<merge key="volume.fstype" type="string">ntfs-3g</merge>
<merge key="volume.policy.mount_filesystem" type="string">ntfs-3g</merge>
<append key="volume.mount.valid_options" type="strlist">locale=</append>
</match>
</match>
</device>
Note: starting from version 2.20 Gnome uses ntfs-3g for mounting ntfs partitions, so you don't need this anymore.
[edit]
mount.ntfs linking As of hal => 0.5.10 the above policy may not work. This is a workaround forcing hal to use the ntfs-3g driver instead of the standard ntfs driver. Please note that this method will use the ntfs-3g driver for all NTFS drives on your system! As root create a symbolic link from mount.ntfs to mount.ntfs-3g
Code:
# ln -s /sbin/mount.ntfs-3g /sbin/mount.ntfs
Possible issues using this method:
if mount is called with "-i" option it doesn't work
possible issues with the kernels ntfs module
[edit]
Locale issues If you use KDE, you may have problem with filenames containing non-latin characters. This happens because kde's mounthelper is not parsing correctly the policies and locale option. There is a workaround for this:
1) Remove the "/sbin/mount.ntfs-3g" which is a symlink. code: rm /sbin/mount.ntfs-3g
2) Replace it with a new bash script containing:
Code:
#!/bin/bash
/bin/ntfs-3g $1 $2 -o locale=en_US.UTF-8 #put your own locale here
3) Make it executable: chmod +x /sbin/mount.ntfs-3g
There is only a problem with partition labels containing spaces, so if you have such a label, replace the space with an underscore, otherwise when you try to mount it you will get an error.
Note: If ntfs-3g package gets updated the above script will be replaced so repeat the process.
Allow dmask and fmask for ntfs-3gdmask and fmask are very useful for setting different access rights for directories and files, e.g. dmask=000,fmask=111 will make directories accessible to all, while files will stay non-executable.
Code:
<device>
<match key="volume.fstype" string="ntfs">
<append key="volume.mount.valid_options" type="strlist">dmask=</append>
<append key="volume.mount.valid_options" type="strlist">fmask=</append>
</match>
</device>
For dbus and hal to function properly, local user accounts must be members of the following groups:
optical, storage. To achieve this, open a terminal and type the following commands as root: