mount: fix iPod automount (lsblk flags + udisks suffixed paths)

Two bugs kept the connected iPod from being auto-mounted:

- `lsblk -o PATH,LABEL -n -l -P` is invalid (--pairs and --list are
  mutually exclusive), so device lookup by label always failed with
  "no block device found" — a regression from the earlier parse fix.
  Drop -l.
- udisks mounted the iPod volume at /media/sebastian/IPOD1 because the
  configured directory /media/sebastian/IPOD already exists, so even a
  resolved device failed with AlreadyMounted. The configured mount point
  is now treated as a hint: mounted_path_for() resolves an exact mount or
  the lowest-numbered udisks-suffixed sibling (IPOD → IPOD1) from
  /proc/self/mountinfo, and the sync destination, storage stats, settings
  display and fatsort resolution all use the real mount.

Also harden fatsort: resolve_fatsort_target now refuses to run when the
path is not a mount point, so findmnt can never fall back to the root
filesystem's block device.

Verified on the connected iPod: mounted_path_for → IPOD1,
resolve_block_device → /dev/sdb2, mount_device → "already mounted at
/media/sebastian/IPOD1", UI shows ● mounted with 9.7 GiB free · 92% and
mount point ✓ /media/sebastian/IPOD1.

Bump to 0.3.3.
This commit is contained in:
Sebastian
2026-09-10 20:20:40 +02:00
parent 9366186245
commit 23508fdc89
8 changed files with 198 additions and 39 deletions
+6 -3
View File
@@ -107,9 +107,12 @@ mounts the target first (resolved by mount-point label via `lsblk`). Only the
mlove `fatsort` step needs root (raw block device).
Mount status and sync targets are validated against the kernel mount table
(`/proc/self/mountinfo`), not just directory existence: if the configured
`mount_point` exists but is not actually mounted, `dap-tui` refuses to sync to
it rather than writing the library onto the root filesystem.
(`/proc/self/mountinfo`), not just directory existence. The configured
`mount_point` is a hint: if udisks mounted the volume at a suffixed sibling
because the configured directory already existed (e.g. `IPOD` → `IPOD1`),
dap-tui follows the actual mount and uses it as the sync destination. If the
path exists but is not a mount at all, syncing into it is refused rather than
writing the library onto the root filesystem.
## Development