Udiskie is an automatic disk mounting service using udisks. It can be used for mounting CDs, flash drives, and other media. It is simple to use and requires no configuration.
Start the Udiskie service by adding
Once Udiskie is running, all removable media will automatically be mounted under
/media under a new directory that matches the device name.
udiskie requires permission for the
org.freedesktop.udisks.filesystem-mount action to be granted through PolicyKit. If you use a desktop manager that supports ConsoleKit this will be taken care of for you automatically. If you are not using a desktop manager that supports ConsoleKit, you'll need to grant the permission manually. This can be done by creating
/etc/polkit-1/localauthority/50-local.d with these contents:
[udiskie] Identity=unix-group:storage Action=org.freedesktop.udisks.filesystem-mount ResultAny=yes
This example configuration allows any member of the
storage group to mount and unmount disks with udiskie.
udiskie-umount command to unmount media. For example, for a device named "MY_USB_DRIVE":
Or, you can unmount all media with the command:
Window Manager Menu Scripts
For convenience, you can add a script to the menu in some window managers to allow for easy access and control of removable media.
Create a "Generated Submenu" entry in the root menu.
#!/bin/bash # For a Window Maker menu for removable media. # # This script will generate sub-menus for any device mounted # under /media. You can browse the device in a file manager or # unmount it. # # It will ignore the "cd", "dvd", and "fl" directories. # # It uses "emelFM2" file manager to browse the media. cd /media echo \"Media\" MENU for i in * do if ["$i" != "*" ] && [ "$i" != "cd" ] && [ "$i" != "dvd" ] && [ "$i" != "fl" ] then echo \"Browse $i\" EXEC \"emelfm2 -1 \'/media/$i\'\" fi done for i in * do if ["$i" != "*" ] && [ "$i" != "cd" ] && [ "$i" != "dvd" ] && [ "$i" != "fl" ] then echo \"Unmount $i\" EXEC \"udiskie-umount \'/media/$i\'\" fi done echo \"Eject Disc\" EXEC \"eject --traytoggle\" echo \"Media\" END