2020-11-12 04:04:29 +00:00
|
|
|
# udisksctl
|
|
|
|
# The udisks command line tool
|
|
|
|
|
2019-11-13 15:11:49 +00:00
|
|
|
# Output low-level information for the provided block device and partition.
|
|
|
|
udisksctl info -b /dev/sdd1
|
|
|
|
|
2020-11-12 04:04:29 +00:00
|
|
|
# Mount partition on the given block device. This will by default use
|
|
|
|
# '/media', and on typical systems won't even require root privileges.
|
2019-11-13 15:11:49 +00:00
|
|
|
udisksctl mount -b /dev/sd??
|
|
|
|
|
|
|
|
# Set up a loop device using 'imagefile'. This only sets it up, so you will
|
2020-11-12 04:04:29 +00:00
|
|
|
# probably also want to mount it thereafter, using the device given to you
|
|
|
|
# after executing this command. often, if not always, this is '/dev/loopX', -
|
|
|
|
# where X is the loop device number.
|
2019-11-13 15:11:49 +00:00
|
|
|
udisksctl loop-setup -f image file
|
|
|
|
|
|
|
|
# Like the above, except this will delete the loop device (assuming 'loop0' was
|
2020-11-12 04:04:29 +00:00
|
|
|
# previously created) but note that this will NOT delete the image file. Be
|
|
|
|
# sure to unmount the filesystem(s) on the device first, before deleting it.
|
2019-11-13 15:11:49 +00:00
|
|
|
udisksctl loop-delete -b /dev/loop0
|
|
|
|
|
2020-11-12 04:04:29 +00:00
|
|
|
# Power off block device. May not work for all devices, and may vary in effect.
|
2019-11-13 15:11:49 +00:00
|
|
|
udisksctl power-off -b /dev/sdb
|
2020-11-12 04:04:29 +00:00
|
|
|
|
|
|
|
# Example of a suitable mount request for auto-mounting at startup. Useful if
|
|
|
|
# fstab isn't playing nice. This also demonstrates using `mount`-style options.
|
|
|
|
udisksctl mount --no-user-interaction --options noatime -b /dev/sde1
|
|
|
|
|
|
|
|
# In some distributions of Linux, such as an Ubuntu 18.04 base install, will
|
|
|
|
# not have its policies set to allow regular users to mount filesystems with
|
|
|
|
# udisksctl(1) without root access, despite that being the point of this tool.
|
|
|
|
# This can be resolved by updating the policies to this effect. In Ubuntu 18.04
|
|
|
|
# it's as easy as a simple package installation procedure.
|
|
|
|
sudo apt-get install policykit-desktop-privileges
|