Last year I wrote about how to hack hal to recognise disks attached to an e-sata port as removable. Now that udisks is the default disk manager in Solid I will explain how to hack udisks to do the same:
- The hal hack is just a xml file that overrides disk's removable flag. With udisks things are a bit more complicated. I had to apply this patch to udisks and recompile it. The patch adds the flag UDISKS_FORCE_SYSTEM_INTERNAL, which lets us mark the disk as internal or external (AKA removable).
- Restart udisks. Just kill it and it will restart automatically: killall udisks-daemon # as root
- After that we need to add an udev rule which will actually mark the disk as removable:
- Reload udev rules: udevadm control --reload-rules
File /etc/udev/rules.d/99-esata.rules |
DEVPATH=="/devices/pci0000:00/0000:00:1f.2/host4/*", ENV{UDISKS_FORCE_SYSTEM_INTERNAL}="0" |
Code |
evolucao ~ # find /sys/devices/ -name sdb /sys/devices/pci0000:00/0000:00:1f.2/host4/target4:0:0/4:0:0:0/block/sdb |
There is already a bug entry about the e-sata problem in udisks' bugzilla. In fact, I found the UDISKS_FORCE_SYSTEM_INTERNAL patch in that bug entry.
8 comments:
I suffer so long from this problem. Always have to give root password in kde to mount my esata drive. I'll try your patch. Is there possibility to get it officially into udisks?
I also found another bug report/possible solution about this. What do you think about that:
https://bugzilla.kernel.org/show_bug.cgi?id=12898
Good catch, not having such a disk myself, I wouldn't know how to even reproduce it :)
@cyberbeat, maybe, the patch is already in udisks' bugzilla for some time. There is another patch in the bug entry to solve it. The oldest patch is there since 2009 so I am not that confident someone will commit either of them.
can you give me the link to the bug report?
It would be very cool if it was possible to recognize esata devices reliably. Too bad 'esata' is just a generic sata cable running to an esata connector in my machine. (a desktop box I built myself)
Industry fail?
Anyway, this is a nice solution :)
http://bugs.freedesktop.org/show_bug.cgi?id=22879
petr: I think this is a linux fail..under windows it works out of the box, so there are flags, which are not accessible in linux..
its a huge fail still existing in suse 12.2...
Post a Comment