Dit deel is nog niet vertaald. Je ziet de Engelse tekst.
Wat het doet
udisksctl talks to the udisks2 service. A user at the local desktop may mount USB sticks, SD cards and ISO files without root; polkit decides what is allowed. Mounts go to /run/media/USER/LABEL. power-off stops the whole device so it is safe to unplug.
It also sets up loop devices for image files and unlocks LUKS-encrypted disks.
Zo schrijf je het
udisksctl COMMAND [OPTION]...Belangrijkste delen
Commands
status- List the drives and their block devices.
info-bDEV- All details of a device (from udisks).
mount-bDEV- Mount a file system as the user.
unmount-bDEV- Unmount it.
unlock-bDEV/lock-bDEV- Open / close a LUKS encrypted device.
loop-setup-fFILE- Make a loop device for an image file.
loop-delete-bDEV- Remove a loop device.
power-off-bDEV- Stop the drive so it can be removed.
smart-simulate-fFILE-bDEV- Load SMART data from a file (testing).
monitor- Show udisks events live.
dump- Show everything udisks knows.
help- Show help.
Opties 11
Meest gebruikt
Options
Niets past bij dit filter.
Voorbeelden 10
$ als gewone gebruiker# als root (of met sudo)
1Show all drives
udisksctl status MODEL REVISION SERIAL DEVICE -------------------------------------------------------------------------- SanDisk Ultra 1.00 4C530001231022115423 sda2Mount a USB stick as a normal user
udisksctl mount -b /dev/sda1 Mounted /dev/sda1 at /run/media/student/BACKUP3Mount read-only
udisksctl mount -b /dev/sda1 -o ro4Unmount and power off before you unplug it
udisksctl unmount -b /dev/sda1 Unmounted /dev/sda1. udisksctl power-off -b /dev/sda5Open an ISO file without root
udisksctl loop-setup -r -f ~/Downloads/rhel-10.0-x86_64-dvd.iso Mapped file /home/student/Downloads/rhel-10.0-x86_64-dvd.iso as /dev/loop0. udisksctl mount -b /dev/loop0 udisksctl unmount -b /dev/loop0 udisksctl loop-delete -b /dev/loop06Unlock an encrypted USB disk
udisksctl unlock -b /dev/sdb1 Passphrase: Unlocked /dev/sdb1 as /dev/dm-3. udisksctl mount -b /dev/dm-37Lock it again after use
udisksctl unmount -b /dev/dm-3 udisksctl lock -b /dev/sdb18Details of a device
udisksctl info -b /dev/sda1 | grep -E 'IdLabel|IdType|Size'9Watch what happens when you plug a device in
udisksctl monitor10Use it in a script without password prompts
udisksctl mount -b /dev/sda1 --no-user-interaction || echo "not allowed"
Niets past bij dit filter.
Let op
- Over SSH, polkit normally does not allow normal users to mount; use
sudo mountthere. power-offworks on the whole disk (/dev/sda), not on a partition.
Bestanden
/run/media/USER/- Where udisks mounts devices for a user.
/etc/udisks2/- Settings of udisks2.
Tips om te onthouden
lsblk -ffirst: it shows the label and file system of every partition.
Exitcodes
0 | Success. |
1 | Error (not allowed, busy, not found). |