title: How can I prevent all USB mass storages from mounting?
body: <p>I want to prevent every kind of USB mass storage from mounting using <a href="https://en.wikipedia.org/wiki/Udev" rel="nofollow noreferrer">udev</a> rules.</p>
  <p>Already I can detect all of USB mass storage devices connected to my system using the following rule:</p>
  <pre><code>SUBSYSTEMS==&quot;scsi&quot;, SUBSYSTEM==&quot;block&quot; KERNEL==&quot;sd[b-h]1&quot;
  </code></pre>
  <p>But how can I prevent them from mounting?</p>
  <p>I know I have to set the authorized file of its relevant USB device to zero! But how can I find the USB device path? The $DEVPATH gives me the path of storage device block for example sdb1!</p>
  <p>I have an application which should give permission to some of USB mass storage devices. So the used method for blocking the USB mass storage devices should not be very static!</p>