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.


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...

  • 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 clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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