You are not logged in.
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
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
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
maximize pcmanfm
stick post-it note over side bar
My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone
Offline
I think you need to at least issue a udevadm control --reload.
Offline
"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...
maximize pcmanfm
stick post-it note over side bar
Yeah, I'll tell you where you can stick that post-it note!
Offline
"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
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
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
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
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.
Offline