coldfix / udiskie

Automounter for removable media
MIT License
866 stars 53 forks source link

Not showing "internal HDD" #254

Closed enoryw closed 1 year ago

enoryw commented 1 year ago

I'm using a SATA power switch and it's not detecting the drive. I would like it to detect as external HDD, since for all intents and purposes, it's treated like an external HDD.

I don't see any devices with /usr/bin/udiskie --tray and even added an explicit rule to automount it:

If I mount the drive manually sudo mount /dev/sdb1 /media it mounts fine. This drive is plain ext4, not encrypted.


Unrelated question, but does udiskie support automounting and dismounting of external zfs drives? I assume to do so properly also involves importing/exporting before/after.

coldfix commented 1 year ago

Hi,

sorry for the late reply, I somehow missed this. You should adapt your rule to include ignore: false.

  - id_uuid: 6379c57e-716d-4e37-8643-2034e8f23a14
    automount: true
    ignore: false

This overwrites any later fallback rules that would set ignore: true for internal devices.


Alternatively, if you want it to be fully handled as external device, you can first check whether the device is recognize as internal or external using (look for HintSystem):

udisksctl info -b /dev/sdb1

It will probably be internal if it's connected with SATA data cables directly to the Motherboard, because that's kind of exactly what makes an internal device. In that case, you can try using an udev rule (/etc/udev/rules.d/50-mydevice.rules) like this to mark it as external for udisks:

SUBSYSTEM=="block", ENV{ID_FS_UUID}=="XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXXX", ENV{UDISKS_SYSTEM}="0"

Check the correct property name on your system with man udisks locally, I think there was a change at some point, at least it's listed as UDISKS_SYSTEM_INTERNAL on some online ubuntu man page, but seems to be UDISKS_SYSTEM on my system.)

Also, you may have a better experience in marking the parent device intsead of the partition with the filesystem. Just look for reasonable properties using udevadm info /dev/sdb | less (not sdb1), such as ID_PART_TABLE_UUID instead of ID_FS_UUID, depending on whether you created a partition table at root level on the device.

You can test it with:

# udevadm control --reload-rules
# udevadm trigger