To use the udisks2 utility commands, type
udisksctl
And you see the options:
$ udisksctl
Usage:
udisksctl COMMAND
Commands:
help Shows this information
info Shows information about an object
dump Shows information about all objects
status Shows high-level status
monitor Monitor changes to objects
mount Mount a filesystem
unmount Unmount a filesystem
unlock Unlock an encrypted device
lock Lock an encrypted device
loop-setup Set-up a loop device
loop-delete Delete a loop device
power-off Safely power off a drive
smart-simulate Set SMART data for a drive
Use "udisksctl COMMAND --help" to get help on each command.
Example
You wanted to unmount a flash drive with udisksctl you will need to get the name of the mounted partition. You can find out with:
lsblk
example output:
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 1 15.2G 0 disk
└─sda1 8:1 1 15.2G 0 part /media/zanna/4C45-110F
so I can unmount this device:
udisksctl unmount -b /dev/sda1
This is reversible with udisksctl mount -b /dev/sda1
To use the udisks2 utility commands, type
udisksctl
And you see the options:
$ udisksctl
Usage:
udisksctl COMMAND
Commands:
help Shows this information
info Shows information about an object
dump Shows information about all objects
status Shows high-level status
monitor Monitor changes to objects
mount Mount a filesystem
unmount Unmount a filesystem
unlock Unlock an encrypted device
lock Lock an encrypted device
loop-setup Set-up a loop device
loop-delete Delete a loop device
power-off Safely power off a drive
smart-simulate Set SMART data for a drive
Use "udisksctl COMMAND --help" to get help on each command.
Example
You wanted to unmount a flash drive with udisksctl you will need to get the name of the mounted partition. You can find out with:
lsblk
example output:
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 1 15.2G 0 disk
└─sda1 8:1 1 15.2G 0 part /media/zanna/4C45-110F
so I can unmount this device:
udisksctl unmount -b /dev/sda1
This is reversible with udisksctl mount -b /dev/sda1
udisks2 is installed in your system.
There is no command udisks2 that can be run in a terminal.
So everything looks correct.
You can use other terminal commands related to udisks like udisksctl.
See also man udisksd.
In Trusty udisks2 is installed by default and used by nautilus.
The binary is in
/usr/bin/udisksctl
found via dpkg -L udisks2 | grep bin/
from man udisksctl
NAME
udisksctl - The udisks command line tool
SYNOPSIS
udisksctl status
udisksctl info {--object-path OBJECT | --block-device DEVICE}
udisksctl mount {--object-path OBJECT | --block-device DEVICE} [--filesystem-type TYPE] [--options OPTIONS...] [--no-user-interaction]
udisksctl unmount {--object-path OBJECT | --block-device DEVICE} [--force] [--no-user-interaction]
udisksctl unlock {--object-path OBJECT | --block-device DEVICE} [--no-user-interaction]
udisksctl lock {--object-path OBJECT | --block-device DEVICE} [--no-user-interaction]
udisksctl loop-setup --file PATH [--read-only] [--offset OFFSET] [--size SIZE] [--no-user-interaction]
udisksctl loop-delete {--object-path OBJECT | --block-device DEVICE} [--no-user-interaction]
udisksctl power-off {--object-path OBJECT | --block-device DEVICE} [--no-user-interaction]
udisksctl smart-simulate --file PATH {--object-path OBJECT | --block-device DEVICE} [--no-user-interaction]
udisksctl monitor
udisksctl dump
udisksctl help
Here is a short test
% sudo apt-get remove udisks2 Reading package lists... Done Building dependency tree Reading state information... Done The following packages will be REMOVED: arronax arronax-nautilus brasero deja-dup-backend-gvfs gnome-disk-utility gnome-shell-extensions gnome-sushi gvfs gvfs-backends gvfs-backends-goa gvfs-daemons gvfs-fuse nautilus nautilus-sendto nautilus-share software-center ubuntu-gnome-desktop udisks2 usb-creator-common usb-creator-gtk 0 upgraded, 0 newly installed, 20 to remove and 0 not upgraded. After this operation, 20,9 MB disk space will be freed. Do you want to continue? [Y/n]
% sudo apt-get remove udisks Reading package lists... Done Building dependency tree Reading state information... Done The following packages will be REMOVED: udisks 0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded. After this operation, 1.043 kB disk space will be freed. Do you want to continue? [Y/n]
I was using udisks to mount an NTFS partition on the same disk as the Operating System. My command looked like this
/usr/bin/udisks --mount /dev/disk/by-uuid/
I used this command in 16.04 (mint 18):
udisksctl mount --block-device /dev/disk/by-uuid/