udisks
Manage disks and storage devices
SYNOPSIS
udisksctl [OPTIONS] COMMAND [ARGS...]
PARAMETERS
--help
Display help message for udisksctl or a specific command.
--version
Show program version information.
status
Show an overview of known block devices and their current status.
info --block-device DEVICE
Show detailed information about a specific block device (e.g., /dev/sda1).
mount --block-device DEVICE [--options OPTIONS]
Mount a filesystem located on a specified block device. Various mount options can be passed.
unmount --block-device DEVICE
Unmount a mounted filesystem from a specified block device.
power-off --block-device DEVICE
Power off a device, typically used for removable media like USB drives.
eject --block-device DEVICE
Eject removable media (e.g., CD/DVD) from an optical drive.
loop-setup --file FILE [--options OPTIONS]
Set up a loop device from a disk image file, making it accessible as a block device.
loop-delete --block-device DEVICE
Delete (disconnect) an existing loop device.
luks-unlock --block-device DEVICE [--key-file FILE]
Unlock a LUKS (Linux Unified Key Setup) encrypted volume, prompting for a passphrase if no key file is given.
luks-lock --block-device DEVICE
Lock a LUKS encrypted volume, making it inaccessible until unlocked again.
dump
Dump all information about all objects (devices, filesystems, etc.) currently managed by udisks.
DESCRIPTION
The udisks command typically refers to udisksctl, a command-line client for the udisksd D-Bus daemon. udisks provides a standardized and extensible way for applications and users to interact with and manage storage devices, including hard drives, solid-state drives, optical media, and removable devices like USB sticks.
It acts as a central service that exposes device information and capabilities via D-Bus, allowing desktop environments and user applications to perform operations such as mounting and unmounting filesystems, formatting partitions, enabling or disabling device caches, unlocking encrypted volumes (LUKS), and ejecting removable media.
Prior to udisks, similar functionality was often handled by separate utilities or by the now-deprecated HAL (Hardware Abstraction Layer) and DeviceKit. udisks aims to provide a unified, robust, and secure interface, often integrating with PolicyKit for privilege management and udev for device event handling. Users generally interact with udisks through its client udisksctl or through graphical file managers.
CAVEATS
udisks operations often require administrative privileges or proper PolicyKit authentication rules. Without these, commands like mounting or formatting may fail due to permission errors. Users interacting with desktop environments rarely need to use udisksctl directly, as these environments automate common tasks like mounting USB drives through the udisksd daemon. The term "udisks" can refer to the entire D-Bus service, the udisksd daemon, or the udisksctl client command; this analysis focuses on the user-facing udisksctl client.
<I>UDISKSD</I> DAEMON
The core of the udisks system is the udisksd daemon, which runs in the background. It continuously monitors block devices, manages their state, and provides the D-Bus interface that allows other applications and the udisksctl command to interact with storage hardware.
POLICYKIT INTEGRATION
udisks leverages PolicyKit (now commonly known as polkit) for fine-grained authorization. This integration enables system administrators to define precise rules on which users or groups are permitted to perform specific udisks operations (e.g., mounting external drives, formatting partitions) without needing direct root privileges for every action, enhancing system security.
DEVICE IDENTIFICATION
When using udisksctl, devices are typically identified by their full block device path (e.g., /dev/sda1) or by their udisks object path (e.g., /org/freedesktop/UDisks2/block_devices/sda1). These object paths can be discovered using commands like udisksctl dump or udisksctl info.
HISTORY
udisks is part of the FreeDesktop.org project and was developed as a modern replacement for older hardware abstraction layers like HAL (Hardware Abstraction Layer) and subsequently DeviceKit.
The initial udisks (sometimes referred to as udisks1) was succeeded by udisks2, which represents a significant rewrite and improvement. udisks2 offers better integration with systemd and PolicyKit, and provides a more robust D-Bus API for desktop environments and applications to manage storage devices. The udisksctl command described here is the standard client for udisks2.