On Wednesday 12 December 2007, Serguei Miridonov wrote: > The situation: External USB hard drive (WD Passport) mounts > automatically when connected, works OK, and unmounts when > choosing "Safely Remove" on the icon menu... > > However, it does not stop spinning after unmounting and > disconnecting the USB cable makes the drive to do emergency > heads parking. To stop the drive I have to use "sdparm -C > stop /dev/sdb" before disconnecting. > > Is there any way to do this automatically? Any user guide to > udev/hal subsystems? > > Thanks. I tried to rewrite HAL rules with attached files /etc/hal/fdi/policy/50-wdpassport.fdi and /usr/lib/hal/scripts/hal-wdpassport-remove but it does not help. The drive makes an attempt to stop spinning but it seems hal or udev touch it again and it continue to spin. Any help?
<?xml version="1.0" encoding="UTF-8"?> <deviceinfo version="0.2"> <device> <match key="@info.parent:storage.hotpluggable" bool="true"> <match key="info.product" string="WD Passport"> <!--append key="info.callouts.remove" type="strlist">hal-wdpassport-remove</append--> <remove key="org.freedesktop.Hal.Device.Volume.method_names" type="strlist">Unmount</remove> <remove key="org.freedesktop.Hal.Device.Volume.method_argnames" type="strlist">extra_options</remove> <remove key="org.freedesktop.Hal.Device.Volume.method_signatures" type="strlist">as</remove> <remove key="org.freedesktop.Hal.Device.Volume.method_execpaths" type="strlist">hal-storage-unmount</remove> <append key="org.freedesktop.Hal.Device.Volume.method_names" type="strlist">Unmount</append> <append key="org.freedesktop.Hal.Device.Volume.method_argnames" type="strlist">none</append> <append key="org.freedesktop.Hal.Device.Volume.method_signatures" type="strlist">as</append> <append key="org.freedesktop.Hal.Device.Volume.method_execpaths" type="strlist">hal-wdpassport-remove</append> </match> </match> </device> </deviceinfo>
Attachment:
hal-wdpassport-remove
Description: application/shellscript