Automounting of large external drives



udiskie is a front-end for UDisks written in python. Its main purpose is automatically mounting removable media, such as CDs or flash drives. It has optional mount notifications, a GTK tray icon and user level CLIs for manual mount and unmount operations. The media will be mounted in a new directory under /media or /run/media/USER/, using the device name if possible.

Something like this in your .config/openbox/autostart

# automount
udiskie -2 &

headless raspbian with usbmount

apt install usbmount


sudo vi /lib/systemd/system/systemd-udevd.service 
# change from MountFlags=slave to MountFlags=shared


It should mount as /media/usb#. Also make sure if disk is ext4 that it is chowned to you, for example

sudo chown -R pi:pi /media/usb

headless raspbian manual

Since usbmount since to stop working for some reason…, on pi an alias like:

alias mountusb='sudo mount /dev/sda1 ~/usbman'

On desktop still the same thing

alias mountpi='sshfs pi@ ~/pi'
# and in openbox autostart
sshfs pi@ ~/pi

fstab way

fix me.