Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'd like to prevent automounting one partition (known UUID etc. ) on one external harddrive. Others should be automounted. Distro is 'modern' (uses lots of beta software) and uses udisk+udev for mounting.

share|improve this question
up vote 6 down vote accepted

One possibility is to add your own udev rule for this partition, that overrides the default ones. On Ubuntu 10.04 /lib/udev/rules.d/80-udisks.rules has some default rules that make udisks ignore some partitions (e.g. partitions that are known to be rescue partitions etc.) which might be an inspiration...

On Ubuntu 10.04 your own rules should go into /etc/udev/rules.d/ (see the README there).

After some experimenting, the following seems to work:

ENV{ID_FS_UUID}=="6b7f8268-c6a2-4265-9563-78f808b3c1cd", ENV{UDISKS_PRESENTATION_HIDE}:="1"

Put that line in a *.rules file that has a name that lexically follows the rules file that contains the normal udisk-related rules. Easiest to do that is to start it with a higher number (so I used 81 to make sure it overrides the rules in 80-*). Of course use whatever UUID your partition has.

On another distro those things might be located differently, but the basics should be the same...

share|improve this answer
That I have to modify the udev rule I suspected. But what attribute should I set to what? (PS. I had modify the rules in past so I know what should go where) – Maciej Piechotka Aug 25 '10 at 9:43
I managed to "hide" a partition with a rule like: ENV{ID_FS_UUID}=="6b7f8268-c6a2-4265-9563-78f808b3c1cd", ENV{UDISKS_PRESENTATION_HIDE}:="1" (of course, use the UUID of your partition). – JanC Aug 25 '10 at 19:03
(This was a rule in a new file 81-* I added to /etc/udev/rules.d/) – JanC Aug 25 '10 at 19:05
Thanks. All I needed was ENV{UDISKS_PRESENTATION_HIDE}:="1" :D – Maciej Piechotka Aug 26 '10 at 9:53

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.