udisksctl

udisksctl — udisks command line tool

Synopsis

udisksctl info { --object-path OBJECT | --block-device DEVICE }

udisksctl mount { --object-path OBJECT | --block-device DEVICE } [ --filesystem-type TYPE ] [--option OPTION...]

udisksctl unmount { --object-path OBJECT | --block-device DEVICE } [--option OPTION...]

udisksctl monitor

udisksctl dump

udisksctl help

Description

udisksctl is a command-line program used to interact with the udisks daemon.

Commands

mount

Mounts a device. The device will be mounted in a subdirectory in the /media hierarchy - upon successful completion, the mount point will be printed to standard output.

The device will be mounted with a safe set of default options. You can influence the options passed to the mount(8) command with --option - do not use a comma to separate options into one word - instead simply use the option several times. Note that only safe options are allowed - requests with inherently unsafe options such as suid or dev that would allow the caller to gain additional privileges, are rejected.

The special option auth_no_user_interaction can be used to request that no interaction (such as the user being presented with an authentication dialog) must occur when checking with polkit(8) whether the caller is authorized to perform the requested action.

unmount

Unmounts a device previously mounted with e.g. udisksctl. The special option force can be used to request that the device is unmounted even if active references exists.

monitor

Monitors the daemon for events.

dump

Prints the current state of the daemon.

help

Prints help and exit.

Audience

This program does not assume that the caller is the super user - it is intended to be used by unprivileged users and authorizations are checked by the udisks daemon using polkit(8). Additionally, this program is not intended to be used by scripts or other programs - options/commands may change in incompatible ways in the future even in maintenance releases. Scripts and/or other programs should either use the D-Bus APIs of udisks2-daemon(8) or native low-level commands such as mount(8).

Bash completion

udisksctl ships with a bash completion script to complete commands, objects, block devices and some options.

Examples

Mounting and unmounting devices:

$ udisksctl mount --block-device /dev/mmcblk0p2
Mounted /dev/mmcblk0p2 at /media/stuff

$ udisksctl unmount --block-device /dev/mmcblk0p2
Unmounted /dev/mmcblk0p2
    

Mounting with non-standard options:

$ udisksctl mount --block-device /dev/mmcblk0p2 --option flush --option utf8=0 --option iocharset=iso8859-15
Mounted /dev/mmcblk0p2 at /media/stuff

$ udisksctl mount --block-device /dev/mmcblk0p2 --option suid
Error mounting /dev/mmcblk0p2: GDBus.Error:org.freedesktop.UDisks.Error.Failed: Mount option `suid' is not allowed
    

Showing information about a device:

$ udisksctl info --block-device /dev/mmcblk0p2
/org/freedesktop/UDisks/devices/mmcblk0p2:
  org.freedesktop.UDisks.BlockDevice:
    Device:             /dev/mmcblk0p2
    Major:              179
    Minor:              2
    Size:               15794176
    Symlinks:           /dev/block/179:2
                        /dev/disk/by-id/mmc-SD01G_0x50882907-part2
                        /dev/disk/by-path/pci-0000:05:00.2-part2
                        /dev/disk/by-uuid/6DA7-F983
                        /dev/disk/by-label/stuff\x22
  org.freedesktop.UDisks.BlockDevice.Probed:
    Label:              stuff"
    Type:               vfat
    UUID:               6DA7-F983
    Usage:              filesystem
    Version:            FAT16
  org.freedesktop.UDisks.Filesystem:
    MountPoints:
  org.freedesktop.UDisks.LinuxSysfsDevice:
    Subsystem:          block
    SysfsPath:          /sys/devices/pci0000:00/0000:00:1e.0/0000:05:00.2/mmc_host/mmc0/mmc0:9ffc/block/mmcblk0/mmcblk0p2    

Monitoring the daemon:

$ udisksctl monitor
Monitoring the udisks daemon. Press Ctrl+C to exit.
14:33:21.363: The udisks-daemon is running (name-owner :1.1254).

14:33:27.616: Added /org/freedesktop/UDisks/jobs/10
  org.freedesktop.UDisks.Job:
    ExpectedEndTime:    0
    Progress:           0.0
    StartTime:          0
14:33:27.663: /org/freedesktop/UDisks/devices/mmcblk0p2: org.freedesktop.UDisks.Filesystem: Properties Changed
  MountPoints:          /media/stuff"
14:33:27.663: /org/freedesktop/UDisks/jobs/10: org.freedesktop.UDisks.Job::Completed (true, '')
14:33:27.664: Removed /org/freedesktop/UDisks/jobs/10

14:33:29.751: Added /org/freedesktop/UDisks/jobs/11
  org.freedesktop.UDisks.Job:
    ExpectedEndTime:    0
    Progress:           0.0
    StartTime:          0
14:33:29.752: /org/freedesktop/UDisks/devices/mmcblk0p2: org.freedesktop.UDisks.Filesystem: Properties Changed
  MountPoints:
14:33:29.759: /org/freedesktop/UDisks/jobs/11: org.freedesktop.UDisks.Job::Completed (true, '')
14:33:29.759: Removed /org/freedesktop/UDisks/jobs/11
    

Author

Written by David Zeuthen with a lot of help from many others.

Bugs

Please send bug reports to either the distribution bug tracker or the upstream bug tracker at http://bugs.freedesktop.org/enter_bug.cgi?product=udisks.

See also

udisksd(8), udisks(7),