Auto-mounts Lenovo USB drive at /mnt/usb on plug-in using systemd-mount.
| File | Location | Purpose |
|---|---|---|
99-usb-lenovo.rules |
/etc/udev/rules.d/99-usb-lenovo.rules |
udev rule - runs systemd-mount on plug-in |
USB PLUGGED IN
│
▼
KERNEL: detects USB → /dev/sdX1, UUID 61F4-EB04 (exFAT)
│
▼
UDEV: matches rule → runs systemd-mount
│
▼
systemd-mount: creates automount at /mnt/usb
│
▼
On first access to /mnt/usb → filesystem mounts automatically
| Approach | Result |
|---|---|
mount in udev RUN |
❌ Breaks — udev sandbox, mounts invisible to system |
SYSTEMD_WANTS + fstab |
❌ Fragile — dependency conflicts, boot failures |
systemd-mount in udev RUN |
✅ Works — proper systemd integration, no conflicts |
# 1. Create mount point
sudo mkdir -p /mnt/usb
# 2. Copy udev rule
sudo cp 99-usb-lenovo.rules /etc/udev/rules.d/
# 3. Remove any conflicting fstab entry
sudo sed -i '/61F4-EB04/d' /etc/fstab
# 4. Reload
sudo udevadm control --reload-rules
sudo systemctl daemon-reload
# 5. Plug in USB — it auto-mounts at /mnt/usbThe remove rule runs systemd-mount --umount which cleanly unmounts and removes the automount unit.
# Check if device is detected
lsusb | grep Lenovo
# Check block devices
lsblk
# Check mount
mount | grep /mnt/usb
# Test systemd-mount manually
sudo systemd-mount --no-block --automount=yes --options=defaults,uid=1000,gid=1000 /dev/sdX1 /mnt/usb