LinuxCommandLibrary

udiskie

Manage automatic mounting of removable devices

TLDR

Start udiskie with tray icon and notifications

$ udiskie --tray --notify
copy

Run udiskie without using a config file
$ udiskie --no-config
copy

Specify a custom config file
$ udiskie --config [path/to/config.yml]
copy

Use a custom password prompt command
$ udiskie --password-prompt '[command]'
copy

Enable verbose output
$ udiskie --verbose
copy

Display help
$ udiskie --help
copy

Display version
$ udiskie --version
copy

SYNOPSIS

udiskie [OPTIONS]
udiskie --udisks-info [--format {json,text,list}] [OBJECT_PATH]

PARAMETERS

-h, --help
    Show program's help message and exit.

-v, --verbose
    Increase verbosity of output messages for debugging.

-d, --daemon
    Run udiskie as a daemon in the background.

-c FILE, --config FILE
    Specify an alternative configuration file to use.

--config-dir DIR
    Specify an alternative configuration directory for udiskie.

-f {json,text,list}, --format {json,text,list}
    Output format for --udisks-info (json, text, or list).

-m, --automount, --no-automount
    Control automatic mounting of new devices (default: enabled). Use --no-automount to disable.

-e, --autoeject, --no-autoeject
    Control automatic ejection of media upon removal (default: enabled). Use --no-autoeject to disable.

--notify, --no-notify
    Control desktop notifications for device events (default: enabled). Use --no-notify to disable.

--tray, --no-tray
    Control the display of the system tray icon for interactive management (default: enabled). Use --no-tray to disable.

--icon-name NAME
    Specify the name of the icon to display in the system tray.

--app-name NAME
    Specify the application name used for notifications and the tray icon.

--menu MENU
    Specify an alternative command to generate the device menu shown in the tray icon context menu.

--filter FILTER
    Specify a filter string or file for devices to be ignored or included based on specific criteria.

--fstab-locations, --no-fstab-locations
    Control whether to consider devices defined in /etc/fstab for mounting (default: enabled). Use --no-fstab-locations to ignore them.

--udisks-info
    Display UDisks device information instead of running as a daemon. This option usually runs udiskie as a one-shot query command.

--file-manager CMD
    Specify the command to open a file manager for a mounted device.

--terminal CMD
    Specify the command to open a terminal for interacting with devices (e.g., for encrypted devices).

--password-agent CMD
    Specify the command to use as a password agent for encrypted devices (e.g., gcr-prompter).

--mount-options OPTIONS
    Default mount options to apply to automatically mounted devices (e.g., nosuid,nodev).

--unmount-options OPTIONS
    Default unmount options to apply to devices.

--version
    Show program's version number and exit.

DESCRIPTION

udiskie is a lightweight daemon designed for automatic mounting of removable media and management of UDisks devices. It provides a non-desktop-environment-specific solution for handling external storage, optical drives, and other removable devices. When run, udiskie monitors the system for new devices using the UDisks API, automatically mounting them to a designated location (typically /media) and optionally displaying a system tray icon for easy interaction. It supports encrypted devices, prompting for passphrases through a configurable agent. Beyond automounting, udiskie also offers a command-line interface to list device information, manually mount, and unmount devices, making it a versatile tool for both graphical and headless environments. Its lightweight nature makes it suitable for tiling window managers and minimal desktop setups.

CAVEATS

udiskie relies on the udisks2 daemon and polkit for privilege escalation. Proper polkit rules are essential for udiskie to perform mount/unmount operations without requiring root privileges. Without a running udisks2 service, udiskie will not function. Customizing mount points or specific device handling often requires careful configuration of the config.yaml file, which can be complex. In some minimal environments, the notify-send command or a password agent might not be pre-installed, requiring manual installation for full functionality.

CONFIGURATION FILE (<CODE><I>CONFIG.YAML</I></CODE>)

udiskie can be extensively configured via a YAML file, typically located at ~/.config/udiskie/config.yaml or specified via -c/--config. This file allows users to define custom mount points, specific mount options per device, ignore rules, and advanced behaviors for the tray icon, notifications, and external commands (file manager, terminal, password agent). It provides fine-grained control over how udiskie interacts with devices and the user environment.

COMPANION CLI TOOLS

While udiskie itself can act as an information query tool (--udisks-info), it often comes with a set of dedicated helper scripts: udiskie-mount, udiskie-umount, and udiskie-info. These scripts provide direct command-line access to mount, unmount, and retrieve information about devices, often delegating to a running udiskie daemon or interacting directly with udisksctl. They are useful for scripting or manual control from a terminal without starting the main daemon.

HISTORY

udiskie emerged as a lightweight, flexible alternative for automatic media management, particularly popular in environments without full-featured desktop shells (like GNOME or KDE) that typically integrate such functionality. It fills a niche for users of tiling window managers (e.g., i3, AwesomeWM) or minimal desktop setups, providing convenient automounting and a system tray interface without the overhead of larger desktop components. Developed in Python, it leverages the udisks2 D-Bus API to interact with storage devices, offering a more modern and robust solution compared to older, often less secure, methods involving fstab and pmount alone.

SEE ALSO

udiskie-mount(1), udiskie-umount(1), udiskie-info(1), udisksctl(1), mount(8), umount(8), pmount(1), fstab(5)

Copied to clipboard