Configuration

Actions a user can perform using udisks are restricted with Polkit. If the user session is not activated or present (for example, when controlling udisks from a systemd/User service), adjust Polkit rules accordingly.

See [2] for common udisks permissions for the storage group, and [3] for a more restrictive example.

Note: devmon only uses udisks or udisks2 for mounting (in this order) if udevil or pmount miss the SUID permission. To remove this permission, run chmod -s /usr/bin/udevil as root.

udevadm monitor

You may use udevadm monitor to monitor block events and mount drives when a new block device is created. Stale mount points are automatically removed by udisksd, such that no special action is required on deletion.

Mount loop devices

This will create a loop device and show the ISO image ready to mount. Once unmounted, the loop device will be terminated by udev.

Note: This mounts a read only image. To mount raw disk images, such as for QEMU, remove the -r flag, and release the image after use with udisksctl loop-delete -b /dev/loop0. Substitute /dev/loop0 with the name of the loop device.

Hide selected partitions

If you wish to prevent certain partitions or drives appearing on the desktop, you can create a udev rule, for example /etc/udev/rules.d/10-local.rules:

shows all partitions with the exception of sda1 and sda2 on your desktop. Note that if you are using udisks2, the above will not work as UDISKS_PRESENTATION_HIDE is no longer supported. Instead, use UDISKS_IGNORE as follows:

The above line is also useful to hide multi device btrfs filesystems, as all the devices from a single btrtfs filesystem will share the same UUID across the devices but will have different SUB_UUID for each individual device.

Apply ATA settings (udisks2)

At start-up and when a drive is connected, udisksd will apply configuration stored in the file /etc/udisks2/IDENTIFIER.conf where IDENTIFIER is the value of the Drive:Id property for the drive. Currently ATA settings are supported. See udisks(8) for available options. These settings have essentially the same effect as those of hdparm, but they are persistent as long as the udisks daemon is autostarted.

For example, to set standby timeout to 240 (20 minutes) for a drive, add the following:

Alternatively, use a GUI utility to manage the configuration file, such as gnome-disk-utility.

Troubleshooting

Hidden devices (udisks2)

Udisks2 hides certain devices from the user by default. If this is undesired or otherwise problematic, copy /usr/lib/udev/rules.d/80-udisks2.rules to /etc/udev/rules.d/80-udisks2.rules and remove the following section in the copy:

# ------------------------------------------------------------------------
# ------------------------------------------------------------------------
# ------------------------------------------------------------------------
# Devices which should not be display in the user interface
[...]

Devices do not remain unmounted (udisks)

udisks remounts devices after a given period, or polls those devices. This can cause unexpected behaviour, for example when formatting drives, sharing them in a virtual machine, power saving, or removing a drive that was not detached with --detach before.

Broken standby timer (udisks2)

The udisks daemon polls S.M.A.R.T. data from drives regularly. Hard drives with a longer standby timeout than the polling interval may fail to enter standby. Drives that are already spun down are usually not effected. There seems no way to disable polling or change the interval as for udisks2 by now. See [4], [5].