You are not logged in.

#1 2013-10-26 01:52:17

drcouzelis
Member
From: Connecticut, USA
Registered: 2009-11-09
Posts: 4,092
Website

[SOLVED / Workaround] Hiding a TrueCrypt volume

I have a TrueCrypt file that contains my personal information. I mount it from the command line when I need it. How can I hide the mounted TrueCrypt volume from appearing in my file manager (PCManFM)?

I tried creating a udev rule in "/etc/udev/rules.d/99-hide-partitions.rules":

KERNEL=="dm-[0-9]*", ENV{UDISKS_IGNORE}:="1"

It had a small effect: the volume still appears in the file manager but it has a different name.

Here is the output from "udevadm monitor" when I mount the volume:

KERNEL[720.311712] add      /devices/virtual/bdi/0:34 (bdi)
UDEV  [720.329283] add      /devices/virtual/bdi/0:34 (bdi)
KERNEL[720.523306] change   /devices/virtual/block/loop0 (block)
KERNEL[720.525338] change   /devices/virtual/block/loop0 (block)
KERNEL[720.535095] add      /devices/virtual/bdi/254:0 (bdi)
UDEV  [720.537028] add      /devices/virtual/bdi/254:0 (bdi)
KERNEL[720.537390] add      /devices/virtual/block/dm-0 (block)
UDEV  [720.538406] add      /devices/virtual/block/dm-0 (block)
KERNEL[720.540339] change   /devices/virtual/block/dm-0 (block)
UDEV  [720.558886] change   /devices/virtual/block/loop0 (block)
UDEV  [720.588484] change   /devices/virtual/block/loop0 (block)
UDEV  [720.612304] change   /devices/virtual/block/dm-0 (block)

How can I hide the volume from my file manager? Should I use udev or another method?

Thank you!

Last edited by drcouzelis (2014-01-01 00:14:01)

Offline

#2 2013-10-28 13:13:41

qinohe
Member
From: Netherlands
Registered: 2012-06-20
Posts: 1,494

Re: [SOLVED / Workaround] Hiding a TrueCrypt volume

Hi, could you try your line without the colon, like this

#KERNEL=="dm-[0-9]*",ENV{UDISKS_IGNORE}="1"

or just

#KERNEL=="dm-0",ENV{UDISKS_IGNORE}="1"

Offline

#3 2013-10-28 23:06:11

drcouzelis
Member
From: Connecticut, USA
Registered: 2009-11-09
Posts: 4,092
Website

Re: [SOLVED / Workaround] Hiding a TrueCrypt volume

Thank you for the suggestion. I'm afraid it didn't have any effect...

Do I need to restart or reboot anything before it will take effect?

Offline

#4 2013-10-28 23:20:49

Xyne
Administrator/PM
Registered: 2008-08-03
Posts: 6,963
Website

Re: [SOLVED / Workaround] Hiding a TrueCrypt volume

  1. maximize pcmanfm

  2. stick post-it note over side bar

tongue


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#5 2013-10-29 00:10:43

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [SOLVED / Workaround] Hiding a TrueCrypt volume

I think you need to at least issue a udevadm control --reload.

Offline

#6 2013-10-29 13:25:16

drcouzelis
Member
From: Connecticut, USA
Registered: 2009-11-09
Posts: 4,092
Website

Re: [SOLVED / Workaround] Hiding a TrueCrypt volume

"udevadm control --reload" didn't have an effect either...

I think my problem comes from the fact that, one, I don't know if "UDISKS_IGNORE" is actually the control that does what I'm looking for, and two, if "dm-0" is the udev name of the device I'm trying to hide...

Xyne wrote:
  1. maximize pcmanfm

  2. stick post-it note over side bar

Yeah, I'll tell you where you can stick that post-it note! wink

Offline

#7 2013-10-29 14:09:24

qinohe
Member
From: Netherlands
Registered: 2012-06-20
Posts: 1,494

Re: [SOLVED / Workaround] Hiding a TrueCrypt volume

drcouzelis wrote:

"udevadm control --reload" didn't have an effect either...

Of course this has effect, only it's not working for you, but the rules are reloaded.

I think my problem comes from the fact that, one, I don't know if "UDISKS_IGNORE" is actually the control that does what I'm looking for, and two, if "dm-0" is the udev name of the device I'm trying to hide...

Yes , I thought of this one also, but I'm not that a bright light with udev, I found this

KERNEL="dm-[0-9]*", OPTIONS ="ignore_device"

Btw. that rule I posted, is working for my USB disks.

Offline

#8 2013-10-30 13:05:07

drcouzelis
Member
From: Connecticut, USA
Registered: 2009-11-09
Posts: 4,092
Website

Re: [SOLVED / Workaround] Hiding a TrueCrypt volume

Thank you all for your suggestions. I'm still unable to hide a TrueCrypt volume from PCManFM.

I will read more about udev and TrueCrypt.

Offline

#9 2013-10-30 13:19:01

qinohe
Member
From: Netherlands
Registered: 2012-06-20
Posts: 1,494

Re: [SOLVED / Workaround] Hiding a TrueCrypt volume

drcouzelis wrote:

and two, if "dm-0" is the udev name of the device I'm trying to hide...

Yes, as far as I know dm-0 is correct, you can use it like that in a udev rule.
Did you have a look at '/lib/udev/rules.d' , maybe you need to change "99" in 99-hide-partitions.rules, it needs to have a different number I guess, looking at the files in  '/lib/udev/rules.d'.
I would call it 15-hide-partitions.rules, really I don't know if it works, but you could try
I can't check it for you as I don't have a dm device on this machine.


edit: Ah, so now I see what you mean, although I don't have a solution.
I checked with Truecrypt volume on USB disk, all other USB's are correctly ignored, also the USB disk with truecrypt vol. on it. When I mount it, it shows up in the list.

I tried to write a few rules for it, but they all fail, I use a little script to enable/disable it which is working fine for USB.

I guess you already issued a command like this to find out more about your device:

#udevadm info -a -p $(udevadm info -q path -n /dev/sd**)

Because it looks like when you issue the command, dm-0 is not appearing in the list, I only see this with "udevadm monitor" , so I try some more, I think however, we need some help wink

edit2: I have been playing around with udev, I just couldn't get it to work ,so I wrote a little script for it, maybe you can use it, with an alias in your zshrc
It's just a little mount/unmount script, check your major/minor number, and change the mountpoint to yours.

#!/bin/bash

if [ "$(mountpoint  -d /media/truecrypt1)" = "254:0" ] ; then
    sudo umount /media/truecrypt1
    echo "Device /media/truecrypt1 is unmounted"
else
    sudo mount  /dev/dm-0 /media/truecrypt1
    echo "Device /media/truecrypt1 is mounted"
fi
exit 0

Last edited by qinohe (2013-10-31 12:36:08)

Offline

#10 2014-01-01 00:13:45

drcouzelis
Member
From: Connecticut, USA
Registered: 2009-11-09
Posts: 4,092
Website

Re: [SOLVED / Workaround] Hiding a TrueCrypt volume

I found a "solution" that works for me. Instead of using PCManFM, I switched to it's crazy child, SpaceFM. SpaceFM has a TON of settings including hiding partitions (actually, my TrueCrypt partition didn't show up by default).

Thank you everyone for your suggestions and help. smile

Offline

Board footer

Powered by FluxBB