LinuxCommandLibrary

udiskie-umount

Unmount removable storage devices

TLDR

Unmount a mounted device

$ udiskie-umount [path/to/mount]
copy

Unmount and power down a USB device
$ udiskie-umount --detach [path/to/mount]
copy

Eject an optical drive
$ udiskie-umount --eject [path/to/mount]
copy

Display help
$ udiskie-umount --help
copy

SYNOPSIS

udiskie-umount [OPTIONS] [DEVICE|LABEL|UUID|MOUNTPOINT]

PARAMETERS

--all, -a
    Unmount all currently mounted removable devices managed by udiskie.

--detach, -d
    Unmount the device and do not wait for it to be physically removed.

--force, -f
    Force unmount the device. This option should be used with caution as it can lead to data corruption if files are in use.

--no-confirm, -N
    Do not ask for confirmation before performing the unmount operation.

--wait, -w
    Wait for the unmount operation to complete successfully. This is the default behavior.

--timeout, -t SECONDS
    Set a timeout in seconds for the unmount operation when waiting.

--verbose, -v
    Enable verbose output, showing more details about the operation.

--help, -h
    Display a help message and exit.

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

DEVICE|LABEL|UUID|MOUNTPOINT
    Specifies the target device to unmount. This can be the device node path (e.g., /dev/sdb1), a volume label, a UUID, or the device's mountpoint (e.g., /media/usb).

DESCRIPTION

udiskie-umount is a command-line utility provided by the udiskie project, designed to facilitate the safe and convenient unmounting of removable storage devices. It acts as a high-level wrapper around the underlying UDisks D-Bus interface, which is commonly used by desktop environments to manage disks and media. Unlike the standard umount command, udiskie-umount leverages udiskie's knowledge of automatically mounted devices, making it particularly useful in scenarios where devices are mounted by the system without explicit user intervention (e.g., when inserting a USB stick).

This command is especially beneficial for users of minimalistic window managers or those who prefer a command-line workflow, as it provides a simple and consistent way to eject devices that might otherwise require more complex udisksctl commands or GUI interactions. It can target a specific device by its path, label, UUID, or mountpoint, or unmount all currently managed removable devices with a single option. Its primary goal is to ensure data integrity by properly unmounting devices before physical removal.

CAVEATS

Permissions
Unmounting devices, especially those mounted by the root user or system, may require elevated privileges. If udiskie is running as a user service, it typically handles devices mounted by that user or via polkit policies.

Data Loss Risk
Using the --force option should be done with extreme caution. Forcing an unmount can lead to data corruption or loss if the device is actively being written to or if files are open on the filesystem. Always attempt a regular unmount first.

UDiskie Dependency
This command relies on the udiskie daemon being active and properly communicating with the UDisks D-Bus service. If udiskie is not running or misconfigured, udiskie-umount may fail.

HOW UDISKIE-UMOUNT WORKS

udiskie-umount doesn't directly interact with the kernel's umount system call. Instead, it sends a request via D-Bus to the running udiskie daemon. The udiskie daemon then communicates with the UDisks D-Bus service, which in turn orchestrates the actual unmounting of the device by calling the necessary system functions. This layered approach ensures that unmounting operations respect system policies and proper device management practices.

EXAMPLES

  • To unmount a specific USB drive mounted at /media/myusb:
    udiskie-umount /media/myusb
  • To unmount a device identified by its label "BackupDisk":
    udiskie-umount "BackupDisk"
  • To unmount all currently mounted removable devices:
    udiskie-umount --all
  • To forcefully unmount a device, for example, if it's busy:
    udiskie-umount --force /dev/sdb1

HISTORY

udiskie and its associated utilities like udiskie-umount were developed to fill a gap for users who needed automatic and convenient management of removable media, particularly in environments without a full-fledged desktop environment (e.g., tiling window managers like i3wm, AwesomeWM, or standalone environments). It provides a user-friendly abstraction over the powerful but more complex udisksctl interface, offering a simple way to mount and unmount devices with minimal configuration and user interaction. Its development focused on integrating seamlessly with the modern Linux desktop ecosystem's UDisks service, providing a robust solution for hot-plugging storage.

SEE ALSO

udiskie(1), udisksctl(1), mount(8), umount(8), fstab(5)

Copied to clipboard