Matt Fiddles

Life's so vast, there's just so much to do...

User Tools

Site Tools


Sidebar

"...[Arthur] leapt to his feet like an author hearing the phone ring..."

- Who says that the character of Arthur isn't autobiographical?



Where will you go today?

"Does it worry you that you don't talk any kind of sense? "
computers:linux:udisks2

Udisks 2

Yet another way to take a simple task and make it very complicated….

  • No command line fuction, even the man page says “do not rely on command line functions.”
  • Must use udisk APIs.
  • Very limited in that respect

Seems like they just wanted a disk system for Gnome. That's not the way linux is suppose to work. It's suppose to be open, shareable, and useable. Not limited systems that just work when they want to.

Found an article of many other problems with udisks, but I'll have to find it again….

Don't Show Internal Drives

To keep internal drives from showing up in your file manager, add the following to /etc/udev/rules.d/70-hide-local-drives.rules

SUBSYSTEM!="block", GOTO="hide_local_end"

# do not show internal disks - note the := makes it permanent
KERNEL=="sda*", ENV{ID_BUS}=="ata",  ENV{UDISKS_IGNORE}:="1", ENV{UDISKS_PRESENTATION_HIDE}:="1"
KERNEL=="dm-*", ENV{removable}=="0", ENV{UDISKS_IGNORE}:="1", ENV{UDISKS_PRESENTATION_HIDE}:="1"

# do not show loop devices.
KERNEL=="loop[0-100]", ENV{UDISKS_IGNORE}:="1", ENV{UDISKS_PRESENTATION_HIDE}:="1"

# add aditional rules here (see below)

LABEL="hide_local_end"

Hide LUKS

If you have a LUKS (cryptsetup) device that is showing, here's how to hide it (note that commands may not work, as udisks is an odd child):

First, get it's UUID without dashes:

root:~# cryptsetup luksDump /dev/loop0 | grep UUID: | cut -f2 | sed s/-//g

Now, we are going to use that number to get the udisks path. We are going to ask Udisk to print out all the devices, and grep for the one we want. Run this next command substituting the number you got in the last one.

root:~# udisks --dump | grep -i <number you got from the last command>

It will give you a single line of the dump, which should be something like

by-id:  /dev/disk/by-id/dm-uuid-CRYPT-LUKS1-fd0db31cb27cae83b8f22e7eb9efb6c7-name_of_device

Take everything after (and including) CRYPT-LUKS1- and that's what you add to /etc/udev/rules.d/70-hide-local-drives.rules, before the ending line: “LABEL=hide_local_end”.

Here's an example using the above result.

# hide internal (unused) LUKS partitions
ENV{DM_UUID}=="CRYPT-LUKS1-fd0db31cb27cae83b8f22e7eb9efb6c7-name_of_device", ENV{UDISKS_IGNORE}:="1", ENV{UDISKS_PRESENTATION_HIDE}:="1"

More

Option to not auto mount: x-systemd.automount

Udisks2 man page

computers/linux/udisks2.txt · Last modified: Nov 25, 2013 (5 years ago) by Matt Bagley