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
1
  • 5
    A package named tool does not necessarily have its command named tool.
    – Léo Lam
    Jul 14, 2016 at 13:26

2 Answers 2

13

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

6
  • How do I unmount a flash drive?
    – misha
    Jul 14, 2016 at 11:03
  • @misha see my edit, let me know if it's clear :)
    – Zanna
    Jul 14, 2016 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, 2016 at 11:33
  • @misha once it has been unmounted you can safely remove it. There's no detach command in udisksctl
    – Zanna
    Jul 14, 2016 at 11:37
  • 1
    @misha, you can detach device: udisksctl power-off -b /dev/sdb
    – Nikolja
    Sep 18, 2019 at 17:51
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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .