Hey Geekbozu!
I took a look - indeed it's different from 20.04! I asked AI to make a summary if the findings below:
SD Card Auto-Mount Behavior Change: Ubuntu 20.04 vs 24.04
What Changed
On Ubuntu 20.04, SD cards would automatically mount at a predictable location
like /mnt/sdcard regardless of desktop session state.
On Ubuntu 24.04, SD card mounting is handled by udisks2 + GNOME gvfs, which:
- Mounts to
/media/<username>/<UUID-or-label> (e.g., /media/particle/4A21-0000)
- Only auto-mounts when the desktop session is active (screen unlocked)
- Does NOT auto-mount when screen is locked/idle (security feature)
Why This Happens
Ubuntu 24.04 uses a more "desktop-centric" approach to removable media:
- udisks2 detects the SD card and exposes it via D-Bus
- gvfs-udisks2-volume-monitor (running in user session) watches for new volumes
- GNOME Shell triggers the actual mount when
should_automount=1
- BUT: GNOME checks
IdleHint - if session is idle, it skips automount for security
This breaks headless/embedded use cases where you want the SD card mounted
regardless of whether someone is logged in or the screen is locked.
Solution: Systemd Service
Create a systemd service that mounts the SD card at boot, independent of the
desktop session. This restores the predictable 20.04 behavior.
/etc/systemd/system/sdcard-mount.service
[Unit]
Description=Mount SD Card at /mnt/sdcard
After=local-fs.target
Wants=local-fs.target
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStartPre=/bin/mkdir -p /mnt/sdcard
ExecStart=/bin/bash -c 'for i in 1 2 3 4 5; do [ -b /dev/mmcblk1p1 ] && break; sleep 1; done; mount -o uid=1000,gid=1000,dmask=0022,fmask=0022 /dev/mmcblk1p1 /mnt/sdcard || true'
ExecStop=/bin/umount /mnt/sdcard
[Install]
WantedBy=multi-user.target
Install the service
sudo cp sdcard-mount.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable sdcard-mount.service
Disable GNOME automount to prevent conflicts
gsettings set org.gnome.desktop.media-handling automount false
gsettings set org.gnome.desktop.media-handling automount-open false
Start immediately (or reboot)
sudo systemctl start sdcard-mount.service
Verify
mount | grep sdcard
# /dev/mmcblk1p1 on /mnt/sdcard type exfat (rw,uid=1000,gid=1000,...)
What the Service Does
- Waits up to 5 seconds for /dev/mmcblk1p1 to appear (handles slow card detection)
- Creates /mnt/sdcard if it doesn't exist
- Mounts with uid/gid 1000 (particle user) so apps can read/write without root
- Runs at boot before user login, independent of desktop session
- Gracefully handles missing SD card (won't fail boot if no card inserted)
Hope this answers your question!
I'll update this in the docs - thanks again for writing in!
Nick