PINE64
What does handle SD card automount? - Printable Version

+- PINE64 (https://forum.pine64.org)
+-- Forum: PinePhone (https://forum.pine64.org/forumdisplay.php?fid=120)
+--- Forum: PinePhone Software (https://forum.pine64.org/forumdisplay.php?fid=121)
+---- Forum: Mobian on PinePhone (https://forum.pine64.org/forumdisplay.php?fid=139)
+---- Thread: What does handle SD card automount? (/showthread.php?tid=17799)



What does handle SD card automount? - mdk - 01-12-2023

Hi!

I've read multiples times that the SD is mounted « on demand », what does that mean and what handles it? I've found nothing in the logs (tried `sudo journalctl --grep mount`, `sudo journalctl --grep media` and `sudo journalctl --grep sd1`).

I've spotted a bug in the automount behavior, sometimes it appends a `1` in the directory name (under /media/mobian) after the fs label.

I mean my SD card is named `sd` and it sometimes gets mounted as `/media/mobian/sd` and sometimes as `/media/mobian/sd1`.

It's bad because lollypop and syncthings are loosing it when it has the wrong name.

I know I could fix it by adding it to `/etc/fstab` but I'd prefer understanding the issue and ultimately making the system easier to use for everyone.


RE: What does handle SD card automount? - mdk - 01-29-2023

OK it's udisks2 that handles the automount, and it can be manipulated:

    udisksctl unmount -b /dev/mmcblk0p1
    udisksctl mount -b /dev/mmcblk0p1

I tried to `rmdir` the abandonned directory in /media/mobian so now `udisksctl mount` does not need to append the `1`.

I'll see if it lasts long of if there's an event that make `/media/mobian/sd` stay at reboot forcing udisks2 to create `/media/mobian/sd1`.