Hal and auto-mounting external (e-)sata devices
I came up with some trouble to enable auto mounting on all my external esata devices. I have 2 of them on e-sata and one on a sata port with extension.
Most documentation online stats you should create a fdi file for each disk or disable not mounting fixed disks all together. The 2nd option isn’t really an option so I decided to go for the fdi file.
In the first part, I’ll assign each of my external drives a additional property in the storage namespace. I called it ‘is_external‘ and it is obviously a boolean. The disks get selected by their storage.serial property which is unique for each disk. You can find the lshal utility to find out the correct string for your disk.
<!-- My External DISK -->
<match key="storage.serial" string="SATA_WDC_WD6401AALS-_WD-WMASY6092959">
<merge key="storage.is_external" type="bool">true</merge>
</match>
A small word of caution: If your external drive has both a usb and a (e-)sata interface, the disks storage.serial will be different for the used interface.
Once we have listed our external disks, we just need to add the rules to make sure they are treated like removable disks. I do this like this:
<match key="storage.is_external" bool="true">
<merge key="storage.removable" type="bool">true</merge>
<merge key="storage.hotpluggable" type="bool">true</merge>
<merge key="volume.ignore" type="bool">false</merge>
</match>
This will take all devices with our storage.is_external property set to true and adjust the device so it is removable, hotpluggable and no longer ignored.
Since we are not actually mounting the disk, but rather the partitions on it, we need some additional rules that check whether or not the ‘parent’ object had is_external and set the volume.ignore property to false.
<match key="@block.storage_device:storage.is_external" bool="true">
<merge key="volume.ignore" type="bool">false</merge>
</match>
And everything together gives:
Complete example file
<?xml version="1.0" encoding="utf-8"?>
<deviceinfo version="0.2">
<device>
<!-- HDSeries -->
<match key="storage.serial" string="SATA_WDC_WD6401AALS-_WD-WMASY6092959">
<merge key="storage.is_external" type="bool">true</merge>
</match>
<!-- White -->
<match key="storage.serial" string="SATA_SAMSUNG_HD103UJS1PVJ1NQ600562">
<merge key="storage.is_external" type="bool">true</merge>
</match>
<!-- DONT CHANGE -->
<match key="storage.is_external" bool="true">
<merge key="storage.removable" type="bool">true</merge>
<merge key="storage.hotpluggable" type="bool">true</merge>
<merge key="volume.ignore" type="bool">false</merge>
</match>
<match key="@block.storage_device:storage.is_external" bool="true">
<merge key="volume.ignore" type="bool">false</merge>
</match>
</device>
</deviceinfo>
July 26th, 2009 at 01:53
THANK YOU SO MUCH!
Adding this to a new HAL policy file made my eSATA automount when powered on, and unmount from nautilus.
Reply
August 15th, 2009 at 10:03
Thank you dude, you made my day!
Reply
September 15th, 2009 at 09:22
MAN! THANK YOU VERY MUCH!
Works like a charm, when added to my /etc/hal/fdi/policy/preferences.fdi
Using xfce 4.6.1
Reply
November 29th, 2009 at 16:23
Does not change anything with my fuk*** karmic
Reply