9

I'm trying to install the udisks utility. The problem is that it says that I have already the newest version of udisks installed on my computer:

sudo apt-get install udisks2
Reading package lists... Done
Building dependency tree       
Reading state information... Done
udisks2 is already the newest version (2.1.7-1ubuntu1).
0 upgraded, 0 newly installed, 0 to remove and 83 not upgraded.

However, running the following command produces no output which indicates that I don't have it installed:

which udisks2

Running commands like the following one gives me an error:

udisks2 --unmount /dev/sdb
udisks2: command not found
Zanna
  • 69,223
  • 56
  • 216
  • 327
misha
  • 942
  • 4
  • 10
  • 21

2 Answers2

12

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

Zanna
  • 69,223
  • 56
  • 216
  • 327
  • How do I unmount a flash drive? – misha Jul 14 '16 at 11:03
  • @misha see my edit, let me know if it's clear :) – Zanna Jul 14 '16 at 11:19
  • What about detaching the device? Is it not necessary? Because when I used previous versions of the `udisks` utility, it was a good idea to always detach the drive after unmounting it. I ran this command to do that: `udisks --detach /dev/sdb` – misha Jul 14 '16 at 11:33
  • @misha once it has been unmounted you can safely remove it. There's no `detach` command in `udisksctl` – Zanna Jul 14 '16 at 11:37
  • 1
    @misha, you can detach device: udisksctl power-off -b /dev/sdb – Nikolja Sep 18 '19 at 17:51
  • @Zanna this is _somewhat_ true in that there shouldn't arise any consistency issue for the (now) unmounted volume. But it's still bad advice. There's a difference between umounting _one_ volume of a disk which - yes, even for USB keys - can contain multiple partitions. – 0xC0000022L Aug 22 '20 at 19:32
4

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.

Pilot6
  • 88,764
  • 91
  • 205
  • 313