Auto Mount

From The World according to Vissie
Jump to navigation Jump to search

udiskie

apt-get install udiskie

to run as a service just do

udiskie&

to list all attached drives, do:

lsblk
udisksctl status

udevil

Use devmon to automount


vim: ~/.bashrc
drive_off(){
    # Function that unmounts and powers off a USB drive
    # Usage example: drive_off /media/myusbdrive
    devicedisk=$(mount | grep ${1%/} | cut -d' ' -f1)
    udevil --unmount -b "$1" && udisksctl power-off -b "$devicedisk"
    echo -e "\033[0;32mDevice \033[0;33m$1\033[0;32m is safely ejected!\033[0m"
}