Skip to content
olf edited this page Mar 23, 2023 · 3 revisions

Technical ToDo list

  • Auto-detect devices capable of discards (i.e., the "trim" operation) per udev rule, then call a unlocking unit with / without allow-discards
  • Allow users to eject media, if the device (e.g., an optical drive attached via USB) is capable of that (or just always).
    The same goes for powering off media and external usb devices.

Potential starting points

  • Removable {0|1}?
    • Disk only: cat /sys/block/sda/removable
  • Rotational {0|1}?
    • Disk only: cat /sys/block/sda/queue/rotational
  • Able to set power save mode {on|off|auto}?
    • Disk & Partition: cat /sys/block/sda/power/control & cat /sys/block/sda/sda1/power/control
    • Disk also: cat /sys/block/sda/device/power/control
  • Supports Discards (in bytes)?
    1. Per ATTR{discard_alignment}!="0", but IIRC that was an unreliable indicator.
      • Disk & Partition: cat /sys/block/sda/discard_alignment & cat /sys/block/sda/sda1/discard_alignment
    2. Per ATTR{queue/discard_granularity}!="0", but that is ...
      • Disk only: cat /sys/block/sda/queue/discard_granularity
Clone this wiki locally