<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
    <channel>
        <title>Automount USB drives with udev rules using disk label</title>
        <description> The following are my udev rules for automounting (hotplug) USB drives with the disk partition label. If you know what udev rules are and wish to use udev to automount USB drives, then this is for you. If you are not sure about udev rules, then I&amp;#039;d suggest looking into usbmount, autofs, ... to install one of these Debian packages to handle the automounting.

1. udev rules 

The udev rules below will mount all USB drives, uncluding mounting USB drives format with HFSplus file system in Read/Write mode.

Please be aware that HFSplus fie system driver is experimental and unsupported by mainline Linux (there is risk of data corruption by potential unknown bugs). If you don&amp;#039;t use HFSplus file system then it is OK to use this rules file as is. To remove HFSplus Write capability, comment out the 3 rules lines in blue (it will mount Read-Only as usual).

Create the automount rules file (or edit your current rules) /etc/udev/rules.d/70-automount.rules. Copy and paste the following rules below.


# NOTE: 
#       1. use pmount --sync if drive label ends with Sync/SYNC/sync in add action to allow removal without corruption
#       2. avoid mounting EFI partition for a HFS+ drive
#       3. force mount HFS+ partition as read-write
#       4. mount USB hardrive (which is identified as SSCI)

KERNEL!=&amp;quot;sd*&amp;quot;, GOTO=&amp;quot;media_label_end&amp;quot;
ENV{ID_TYPE}!=&amp;quot;disk&amp;quot;, GOTO=&amp;quot;media_label_end&amp;quot;

IMPORT{program}=&amp;quot;/sbin/blkid -o udev -p %N&amp;quot;, ENV{name}=&amp;quot;%E{ID_FS_LABEL}&amp;quot;
ENV{ID_FS_TYPE}==&amp;quot;&amp;quot;, GOTO=&amp;quot;media_label_end&amp;quot;

ENV{ID_FS_LABEL}!=&amp;quot;EFI&amp;quot;, GOTO=&amp;quot;continue&amp;quot;
ENV{ID_PART_TABLE_TYPE}==&amp;quot;gpt&amp;quot;, GOTO=&amp;quot;media_label_end&amp;quot;

LABEL=&amp;quot;continue&amp;quot;

ENV{name}==&amp;quot;&amp;quot;, ENV{name}=&amp;quot;%k&amp;quot;

KERNEL==&amp;quot;sd*&amp;quot;, SYMLINK+=&amp;quot;usb-storage/%E{name}&amp;quot;

ENV{name}==&amp;quot;*SYNC&amp;quot;, ENV{mode}=&amp;quot;--sync&amp;quot;
ENV{name}==&amp;quot;*Sync&amp;quot;, ENV{mode}=&amp;quot;--sync&amp;quot;
ENV{name}==&amp;quot;*sync&amp;quot;, ENV{mode}=&amp;quot;--sync&amp;quot;
ENV{name}!=&amp;quot;*SYNC&amp;quot;, ENV{mode}=&amp;quot;&amp;quot;

ENV{ID_FS_TYPE}==&amp;quot;hfsplus&amp;quot;, ENV{mode2}=&amp;quot;--read-write&amp;quot;
ENV{ID_FS_TYPE}==&amp;quot;hfsplus&amp;quot;, ENV{mode3}=&amp;quot;/bin/mount -v -o remount,force,rw /media/%E{name}&amp;quot;
ENV{ID_FS_TYPE}!=&amp;quot;hfsplus&amp;quot;, ENV{mode3}=&amp;quot;/usr/bin/pmount&amp;quot;

ACTION==&amp;quot;add&amp;quot;, RUN+=&amp;quot;/usr/bin/pmount -t %E{ID_FS_TYPE} %E{mode} %E{mode2} --noatime --umask 000 %k %E{name}&amp;quot;
ACTION==&amp;quot;add&amp;quot;, RUN+=&amp;quot;%E{mode3}&amp;quot;
ACTION==&amp;quot;remove&amp;quot;, RUN+=&amp;quot;/usr/bin/pumount --yes-I-really-want-lazy-unmount %E{name}&amp;quot;

LABEL=&amp;quot;media_label_end&amp;quot;


2. (DEPRECATED) Aumounting USB drives during system startup

 bodhi&amp;#039;s Update: this is not need anymore with my latest released kernels and rootfs. Keeping here for posterity.

A long time ago, we&amp;#039;ve found that udevs rules for automounting USB drives were not enough

During system startup, the rules were not triggered, so the USB drives were not aumounted (except for the rootfs, which is always mounted by the kernel). Perhaps with recent udev versions there might be  a better way than using a script.

The script below is to help automounting all USB drives that were not mounted by udev rules during system startup. This script should be executed in /etc/rc.local (preferably at the beginning). 

usb-storage.pmount

#!/bin/bash
 
logger -s -i &amp;quot;Pmounting all unmounted USB drives&amp;quot;

PMOUNT=`which pmount`
if [ -z &amp;quot;$PMOUNT&amp;quot; ]
then
  logger -s -i  &amp;quot;Error: $0 cant find pmount!&amp;quot; 1&amp;gt;&amp;amp;2
 exit 1
fi

ROOT=&amp;quot;/dev/usb-storage&amp;quot;
DEV_LIST=`ls -1 $ROOT`

logger -s -i &amp;quot;Mounting all unmounted USB disks: $DEV_LIST (skip rootfs)&amp;quot;

for DEV in $DEV_LIST; do
   
   if [ &amp;quot;$DEV&amp;quot; != &amp;quot;rootfs&amp;quot; ]; then
   
      if  ! /bin/mountpoint /media/$DEV -q ; then
         $PMOUNT --noatime --umask 000 --read-write $ROOT/$DEV $DEV
         
      fi
   fi

done

logger -s -i &amp;quot;Done Pmounting USB drives&amp;quot;

exit 0
</description>
        <link>https://forum.doozan.com/read.php?2,24139,24139#msg-24139</link>
        <lastBuildDate>Thu, 12 Mar 2026 20:19:39 -0500</lastBuildDate>
        <generator>Phorum 5.2.23</generator>
        <item>
            <guid>https://forum.doozan.com/read.php?2,24139,71869#msg-71869</guid>
            <title>Re: Automount USB drives with udev rules using disk label</title>
            <link>https://forum.doozan.com/read.php?2,24139,71869#msg-71869</link>
            <description><![CDATA[ Martin,<br />
<br />
Glad you&#039;ve got a working system as expected! My suggestion is to use partition label for these. It is much more friendly and flexible. UUID is not bad, but it will limit the usage in some use cases.]]></description>
            <dc:creator>bodhi</dc:creator>
            <category>Debian</category>
            <pubDate>Thu, 01 Nov 2018 16:43:45 -0500</pubDate>
        </item>
        <item>
            <guid>https://forum.doozan.com/read.php?2,24139,71814#msg-71814</guid>
            <title>Re: Automount USB drives with udev rules using disk label</title>
            <link>https://forum.doozan.com/read.php?2,24139,71814#msg-71814</link>
            <description><![CDATA[ dockstar boot from usb stick.<br />
<br />
I think, I will go forward using some hand-weaved script, mounting the USB-drive partition individually.<br />
I have cleaned up the entries in fstab.<br />
<br />
<br />
Powering the dockstar, waiting for login prompt, log in as root and then powering the USB hdd, afterwards<br />
<br />
<pre class="bbcode">
root@debian:~# mount UUID=04aae5de-6bed-4faa-999c-68ba85b591a4  /mnt/data
root@debian:~# mount UUID=44d90f04-3a0e-4fac-8993-853b3d60afd3  /mnt/unterhaltung
root@debian:~# mount UUID=e7f3cfb0-6abf-4591-9d18-2ae7bc92be2e  /mnt/backup</pre>
<br />
works well ...<br />
<br />
<br />
I think some shell script magic will be sufficient.<br />
<br />
EDIT:<br />
Here my first approach for a medium secure mount combined with fsck before<br />
<br />
<pre class="bbcode">
#!/bin/sh
# secure mounting with file system check of mounted partitions

fsck UUID=04aae5de-6bed-4faa-999c-68ba85b591a4
if [ $? -eq 0 ]
then
  mount UUID=04aae5de-6bed-4faa-999c-68ba85b591a4 /mnt/data
else
  echo file system check failed, &#039;mnt/data&#039; not mounted
fi
fsck UUID=44d90f04-3a0e-4fac-8993-853b3d60afd3
if [ $? -eq 0 ]
then
  mount UUID=44d90f04-3a0e-4fac-8993-853b3d60afd3 /mnt/unterhaltung
else
  echo file system check failed, &#039;mnt/unterhaltung&#039; not mounted
fi
fsck UUID=e7f3cfb0-6abf-4591-9d18-2ae7bc92be2e
if [ $? -eq 0 ]
then
  mount UUID=e7f3cfb0-6abf-4591-9d18-2ae7bc92be2e /mnt/backup
else
  echo file system check failed, &#039;mnt/backup&#039; not mounted
fi</pre>
<br />
Fast mount script will omit fsck, perhaps I will write a script for using &quot;fsck -f&quot;]]></description>
            <dc:creator>Martin aus Dortmund</dc:creator>
            <category>Debian</category>
            <pubDate>Thu, 01 Nov 2018 06:22:26 -0500</pubDate>
        </item>
        <item>
            <guid>https://forum.doozan.com/read.php?2,24139,71809#msg-71809</guid>
            <title>Re: Automount USB drives with udev rules using disk label</title>
            <link>https://forum.doozan.com/read.php?2,24139,71809#msg-71809</link>
            <description><![CDATA[ And regarding<br />
<br />
<blockquote class="bbcode"><div><small>Quote<br /></small><strong></strong><br />... but the problem remains, trouble, if USB hdd is not found at startup...</div></blockquote>
<br />
Where is the rootfs? is it on another drive?]]></description>
            <dc:creator>bodhi</dc:creator>
            <category>Debian</category>
            <pubDate>Thu, 01 Nov 2018 06:07:23 -0500</pubDate>
        </item>
        <item>
            <guid>https://forum.doozan.com/read.php?2,24139,71804#msg-71804</guid>
            <title>Re: Automount USB drives with udev rules using disk label</title>
            <link>https://forum.doozan.com/read.php?2,24139,71804#msg-71804</link>
            <description><![CDATA[ Martin,<br />
<br />
&gt; But my target is to remove it from the Linux PC to<br />
&gt; avoid the power consumption running the PC<br />
&gt; 24/7....<br />
<br />
I see.<br />
<br />
&gt; Perhaps it is not necessary to automount the<br />
&gt; partitions of the drive ... fstab entries might be<br />
&gt; sufficient - if there is a way to avoid the<br />
&gt; stopping of the boot process of the dockstar -<br />
&gt; since the hdd remains turned off until operating<br />
&gt; the push-button after a temporary power loss ...<br />
<br />
As long as the rootf is on a different partition. You could :<br />
<br />
1.   Have only rootfs partition in fstab, and then do the fsck explicitly for other partitions much later in /etc/rc.local. And mount them there.<br />
or<br />
2.  Have all partitions in fstab, but tell it to ignore the error for non-rootfs partition so it won&#039;t try to check them, and do the fsck explicitly much later in /etc/rc.local.]]></description>
            <dc:creator>bodhi</dc:creator>
            <category>Debian</category>
            <pubDate>Thu, 01 Nov 2018 06:06:00 -0500</pubDate>
        </item>
        <item>
            <guid>https://forum.doozan.com/read.php?2,24139,71799#msg-71799</guid>
            <title>Re: Automount USB drives with udev rules using disk label</title>
            <link>https://forum.doozan.com/read.php?2,24139,71799#msg-71799</link>
            <description><![CDATA[ Got success with following fstab options<br />
<br />
<br />
<pre class="bbcode">
LABEL=rootfs    /               ext4    noatime,errors=remount-ro 0 1
tmpfs          /tmp            tmpfs   defaults          0       0
UUID=04aae5de-6bed-4faa-999c-68ba85b591a4  /mnt/data  ext2  rw,suid,dev,exec,nouser,async,auto  0  2
UUID=44d90f04-3a0e-4fac-8993-853b3d60afd3  /mnt/unterhaltung  ext4  rw,suid,dev,exec,nouser,async,auto  0  2
UUID=e7f3cfb0-6abf-4591-9d18-2ae7bc92be2e  /mnt/backup  ext4  rw,suid,dev,exec,nouser,async,auto,  0  2</pre>
<br />
<br />
... but the problem remains, trouble, if USB hdd is not found at startup...]]></description>
            <dc:creator>Martin aus Dortmund</dc:creator>
            <category>Debian</category>
            <pubDate>Thu, 01 Nov 2018 06:04:42 -0500</pubDate>
        </item>
        <item>
            <guid>https://forum.doozan.com/read.php?2,24139,71789#msg-71789</guid>
            <title>Re: Automount USB drives with udev rules using disk label</title>
            <link>https://forum.doozan.com/read.php?2,24139,71789#msg-71789</link>
            <description><![CDATA[ bodhi Wrote:<br />
-------------------------------------------------------<br />
&gt; <br />
&gt; If you mount the partition accross the network<br />
&gt; using fstab, you need to use ASYNC option so that<br />
&gt; it does not stop at that point.<br />
&gt; <br />
<br />
The 4 Terabyte USB HDD is intended to be attached via USB to the dockstar permanenty. As long as I am on the way to create an environment on the dockstar to do so, I have attached it to my Linux Mint PC temporarily, and made it accessible in my home network on this way via SMB.<br />
<br />
But my target is to remove it from the Linux PC to avoid the power consumption running the PC 24/7....<br />
<br />
Formatting and partitioning has taken place on the Linux PC, that has given long UUIDs to each partition as Label.<br />
<br />
There are some flaws, on the way to move it.<br />
<br />
1) I have once moved the drive from PC to dockstar, and the dockstar triggers a fsck of the first partition. After success on fsck I moved the drive to PC .... and the PC triggers a fsck (with some orphan inodes as result)<br />
<br />
2) As the 3,5 &quot; drive was a spontaneous buy (It was a special offer in a shopping mall) I have not checked all characteristics before buying it.... Now I encountered, that the HDD housing has an push-button, that must be pushed (after inserting the wall power supply) to switch the drive on - the insertion alone does not power up. Not very helpful for unattended dockstar power up after an areal power break down...<br />
<br />
3) First partition is a dd-ed one duplicating a 1 TB USB hdd (perhaps that&#039;s the reason that it is a ext2 file system). The other ones are ext4, and were not mounted... (perhaps due to ownership problems?)<br />
<br />
Perhaps it is not necessary to automount the partitions of the drive ... fstab entries might be sufficient - if there is a way to avoid the stopping of the boot process of the dockstar - since the hdd remains turned off until operating the push-button after a temporary power loss ...]]></description>
            <dc:creator>Martin aus Dortmund</dc:creator>
            <category>Debian</category>
            <pubDate>Thu, 01 Nov 2018 05:07:25 -0500</pubDate>
        </item>
        <item>
            <guid>https://forum.doozan.com/read.php?2,24139,71774#msg-71774</guid>
            <title>Re: Automount USB drives with udev rules using disk label</title>
            <link>https://forum.doozan.com/read.php?2,24139,71774#msg-71774</link>
            <description><![CDATA[ Martin,<br />
<br />
&gt; My first approach was, to mount the 4TB USB HDD<br />
&gt; actually residing at my Linux PC using fstab<br />
&gt; entries.<br />
&gt; <br />
&gt; <br />
&gt; Unfortunately it seems, that mounting takes place<br />
&gt; prior to opening the SSH port of the dockstar, so<br />
&gt; a fsck run during mount process keeps the dockstar<br />
&gt; inacccesible after power on for a while...<br />
<br />
If you mount the partition accross the network using fstab, you need to use ASYNC option so that it does not stop at that point.<br />
<br />
Mounting NFS rootfs must be done a differrent way (at kernel boot).]]></description>
            <dc:creator>bodhi</dc:creator>
            <category>Debian</category>
            <pubDate>Thu, 01 Nov 2018 02:39:58 -0500</pubDate>
        </item>
        <item>
            <guid>https://forum.doozan.com/read.php?2,24139,71594#msg-71594</guid>
            <title>Re: Automount USB drives with udev rules using disk label</title>
            <link>https://forum.doozan.com/read.php?2,24139,71594#msg-71594</link>
            <description><![CDATA[ I am working through the HowTos concerning the syntax of the autofs configuration files ...<br />
<br />
My first approach was, to mount the 4TB USB HDD actually residing at my Linux PC using fstab entries.<br />
<br />
But I have &quot;gparted&quot; the HDD to three partitions, one ext2 of 1 TB as replacement of an elder 1 TB USB HDD, and two ext4 partitions witch 1.5 TB each using my Linux Mint PC.<br />
<br />
Unfortunately it seems, that mounting takes place prior to opening the SSH port of the dockstar, so a fsck run during mount process keeps the dockstar inacccesible after power on for a while...<br />
<br />
The fsck is only visible on the serial console of the dockstar. Log in is not possible via serial console until fsck has finished  ... <br />
The two 1.5 TB ext4 partitions are not mounted ...]]></description>
            <dc:creator>Martin from Dortmund</dc:creator>
            <category>Debian</category>
            <pubDate>Tue, 30 Oct 2018 03:08:09 -0500</pubDate>
        </item>
        <item>
            <guid>https://forum.doozan.com/read.php?2,24139,71519#msg-71519</guid>
            <title>Re: Automount USB drives with udev rules using disk label</title>
            <link>https://forum.doozan.com/read.php?2,24139,71519#msg-71519</link>
            <description><![CDATA[ Martin,<br />
<br />
Debian autofs is a really good tool,  which usually peope use it to automount NFS. It can also automount USB.]]></description>
            <dc:creator>bodhi</dc:creator>
            <category>Debian</category>
            <pubDate>Mon, 29 Oct 2018 16:09:00 -0500</pubDate>
        </item>
        <item>
            <guid>https://forum.doozan.com/read.php?2,24139,71509#msg-71509</guid>
            <title>Re: Automount USB drives with udev rules using disk label</title>
            <link>https://forum.doozan.com/read.php?2,24139,71509#msg-71509</link>
            <description><![CDATA[ bodhi Wrote:<br />
-------------------------------------------------------<br />
&gt; To install<br />
&gt; <pre class="bbcode">
&gt; apt-get install usbmount
&gt;</pre>
<br />
<br />
It seems, that usbmount is not longer supported and was removed from repository....<br />
<br />
&gt; E: Unable to locate package usbmount<br />
<br />
<a href="https://wiki.debian.org/usbmount"  rel="nofollow">https://wiki.debian.org/usbmount</a><br />
<br />
&gt; Note (made in 2013): currently the author of the package is unable to maintain it and no one else has taken it on yet. <br />
<br />
On the other hand -  the gitHub repository seems to be alive ...<br />
<br />
<a href="https://github.com/rbrito/usbmount"  rel="nofollow">https://github.com/rbrito/usbmount</a>]]></description>
            <dc:creator>Martin aus Dortmund</dc:creator>
            <category>Debian</category>
            <pubDate>Mon, 29 Oct 2018 14:33:38 -0500</pubDate>
        </item>
        <item>
            <guid>https://forum.doozan.com/read.php?2,24139,36320#msg-36320</guid>
            <title>Re: Automount USB drives with udev rules using disk label</title>
            <link>https://forum.doozan.com/read.php?2,24139,36320#msg-36320</link>
            <description><![CDATA[ bodhi Wrote:<br />
-------------------------------------------------------<br />
&gt; I actually discouraged people from using udev rule<br />
&gt; s. It just that it has the least footprint on a sy<br />
&gt; stem, so it might be useful to somebody.<br />
<br />
Got it! I experimented with the scripts and it worked, except that I had to remove locale option or I was getting this error:<br />
<br />
<pre class="bbcode">
[137246.680981] ntfs: driver 2.1.32 [Flags: R/W MODULE].
[137246.687304] ntfs: (device sdb1): parse_options(): Unrecognized mount option locale</pre>
<br />
bodhi Wrote:<br />
-------------------------------------------------------<br />
&gt; I don&#039;t believe it is still an issue anymore in th<br />
&gt; e latest kernel linux-4.12.8-kirkwood-tld-1. You c<br />
&gt; ould try the udev rules without the usb-storage.pm<br />
&gt; ount script and let me know!<br />
<br />
I haven&#039;t rebooted yet, but I will check and report.]]></description>
            <dc:creator>haridsv</dc:creator>
            <category>Debian</category>
            <pubDate>Fri, 01 Sep 2017 00:08:29 -0500</pubDate>
        </item>
        <item>
            <guid>https://forum.doozan.com/read.php?2,24139,36319#msg-36319</guid>
            <title>Re: Automount USB drives with udev rules using disk label</title>
            <link>https://forum.doozan.com/read.php?2,24139,36319#msg-36319</link>
            <description><![CDATA[ haridsv ,<br />
<br />
I actually discouraged people from using udev rules. It just that it has the least footprint on a system, so it might be useful to somebody. I think most people should use Debian packages.<br />
<br />
<blockquote class="bbcode"><div><small>Quote<br /></small><strong></strong><br />If you are not sure about udev rules, then I&#039;d suggest looking into usbmount, autofs, ... to install one of these Debian packages to handle the automounting.</div></blockquote>
<br />
&gt; During system startup, the rules wer<br />
&gt; e not triggered, so the USB<br />
&gt; &gt; drives were not aumounted (except for the rootfs<br />
&gt; , which is always mounted by the<br />
&gt; &gt; kernel). Perhaps with recent udev versions there<br />
&gt; might be a better way than<br />
&gt; &gt; using a script.<br />
&gt; <br />
&gt; Do you think this is still an issue?<br />
<br />
I don&#039;t believe it is still an issue anymore in the latest kernel linux-4.12.8-kirkwood-tld-1. You could try the udev rules without the usb-storage.pmount script and let me know!]]></description>
            <dc:creator>bodhi</dc:creator>
            <category>Debian</category>
            <pubDate>Fri, 01 Sep 2017 00:01:20 -0500</pubDate>
        </item>
        <item>
            <guid>https://forum.doozan.com/read.php?2,24139,36318#msg-36318</guid>
            <title>Re: Automount USB drives with udev rules using disk label</title>
            <link>https://forum.doozan.com/read.php?2,24139,36318#msg-36318</link>
            <description><![CDATA[ bodhi Wrote:<br />
-------------------------------------------------------<br />
&gt; The following udev rules are for automounting (hot<br />
&gt; plug) USB drives with the disk partition label. If<br />
&gt; you know what udev rules are and wish to use udev<br />
&gt; to automount USB drives, then this is for you. [co<br />
&gt; lor=#3333FF]If you are not sure about udev rules,<br />
&gt; then I&#039;d suggest looking into <b>usbmount</b>, <b><br />
&gt; autofs</b>,[/color] ... to install one of these De<br />
&gt; bian packages to handle the automounting.<br />
<br />
I found an <a href="https://superuser.com/a/64970/26006"  rel="nofollow">alternative approach</a> that uses shell scripts triggered from minimal udev rules. For someone who doesn&#039;t know much about udev, isn&#039;t this more manageable?<br />
<br />
You can quickly find all the scripts mentioned in the above post <a href="https://github.com/fatso83/Code-Snippets/tree/master/system-utils/ubuntu/automount"  rel="nofollow">here</a>.<br />
<br />
<br />
bodhi Wrote:<br />
-------------------------------------------------------<br />
&gt; A long time ago, we&#039;ve found that udevs rules for automounting USB drives were<br />
&gt; not enough. During system startup, the rules were not triggered, so the USB<br />
&gt; drives were not aumounted (except for the rootfs, which is always mounted by the<br />
&gt; kernel). Perhaps with recent udev versions there might be a better way than<br />
&gt; using a script. <br />
<br />
Do you think this is still an issue?]]></description>
            <dc:creator>haridsv</dc:creator>
            <category>Debian</category>
            <pubDate>Thu, 31 Aug 2017 22:45:09 -0500</pubDate>
        </item>
        <item>
            <guid>https://forum.doozan.com/read.php?2,24139,28464#msg-28464</guid>
            <title>Re: Automount USB drives with udev rules using disk label</title>
            <link>https://forum.doozan.com/read.php?2,24139,28464#msg-28464</link>
            <description><![CDATA[ bodhi Wrote:<br />
-------------------------------------------------------<br />
&gt; notoneofmyseeds,<br />
&gt; <br />
&gt; Note that I said in the other thread that there<br />
&gt; are many ways to set up USB automounting in Linux.<br />
&gt; <br />
&gt; <br />
&gt; The hardest way to set up is using udev rules<br />
&gt; (sometime you want to control the automounting at<br />
&gt; a lower level). That&#039;s why I posted the<br />
&gt; instruction here.  However, the easier way to set<br />
&gt; up is using usbmount or autofs.<br />
&gt; <br />
&gt; <blockquote class="bbcode"><div><small>Quote<br /></small><strong></strong><br />
&gt; ~# apt-cache show usbmount<br />
&gt; Package: usbmount<br />
&gt; Version: 0.0.22<br />
&gt; Installed-Size: 116<br />
&gt; Maintainer: Rogério Brito &lt;rbrito@ime.usp.br&gt;<br />
&gt; Architecture: all<br />
&gt; Depends: lockfile-progs, udev, util-linux (&gt;&gt;<br />
&gt; 2.16)<br />
&gt; Recommends: pmount<br />
&gt; Description-en: automatically mount and unmount<br />
&gt; USB mass storage devices<br />
&gt;  This package automatically mounts USB mass<br />
&gt; storage devices (typically<br />
&gt;  USB pens) when they are plugged in, and unmounts<br />
&gt; them when they are<br />
&gt;  removed. The mountpoints (/media/usb[0-7] by<br />
&gt; default), filesystem types<br />
&gt;  to consider, and mount options are configurable.<br />
&gt; When multiple devices<br />
&gt;  are plugged in, the first available mountpoint is<br />
&gt; automatically<br />
&gt;  selected. If the device provides a model name, a<br />
&gt; symbolic link<br />
&gt;  /var/run/usbmount/MODELNAME pointing to the<br />
&gt; mountpoint is automatically<br />
&gt;  created.<br />
&gt;  .<br />
&gt;  The script that does the mounting is called by<br />
&gt; the udev daemon.<br />
&gt;  Therefore, USBmount requires a 2.6 (or newer)<br />
&gt; Linux kernel.<br />
&gt;  .<br />
&gt;  Firewire devices are also supported by USBmount.<br />
&gt;  .<br />
&gt;  USBmount is intended as a lightweight solution<br />
&gt; which is independent of<br />
&gt;  a desktop environment. Users which would like an<br />
&gt; icon to appear when an<br />
&gt;  USB device is plugged in should use the pmount<br />
&gt; and hal packages<br />
&gt;  instead.<br />
&gt; Description-md5: 665bf065788bff1ada4b796e26321438<br />
&gt; Homepage: <a href="http://usbmount.alioth.debian.org/"  rel="nofollow">http://usbmount.alioth.debian.org/</a><br />
&gt; Tag: admin::filesystem, hardware::storage,<br />
&gt; hardware::usb, interface::daemon,<br />
&gt;  role::program, scope::utility, use::configuring<br />
&gt; Section: admin<br />
&gt; Priority: extra<br />
&gt; Filename:<br />
&gt; pool/main/u/usbmount/usbmount_0.0.22_all.deb<br />
&gt; Size: 17666<br />
&gt; MD5sum: 1d62c98011ac6452d1e9b3be7b56b272<br />
&gt; SHA1: 9a4d4d88ac7f609a27db15235bed605f3f6dadc1<br />
&gt; SHA256:<br />
&gt; 764462e65a544fc6a03ca4f90157898a4f289c3f3bea866c5b<br />
&gt; 739ff9184d6c93<br />
&gt; <br />
&gt; Package: usbmount<br />
&gt; Status: deinstall ok config-files<br />
&gt; Priority: extra<br />
&gt; Section: admin<br />
&gt; Installed-Size: 112<br />
&gt; Maintainer: Rogério Brito &lt;rbrito@ime.usp.br&gt;<br />
&gt; Architecture: all<br />
&gt; Version: 0.0.21<br />
&gt; Config-Version: 0.0.21<br />
&gt; Depends: udev, lockfile-progs, util-linux (&gt;&gt;<br />
&gt; 2.16)<br />
&gt; Recommends: pmount<br />
&gt; Conffiles:<br />
&gt;  /etc/usbmount/umount.d/00_remove_model_symlink<br />
&gt; 06304855418cfe29f6cec46042bdd857<br />
&gt;  /etc/usbmount/mount.d/00_create_model_symlink<br />
&gt; 13ef81167c202627ca43b1fe6c7cd0bf<br />
&gt;  /etc/usbmount/usbmount.conf<br />
&gt; a78d1be4f28c20bdb0b88b23cc01cf5d<br />
&gt; Description-en: automatically mount and unmount<br />
&gt; USB mass storage devices<br />
&gt;  This package automatically mounts USB mass<br />
&gt; storage devices (typically<br />
&gt;  USB pens) when they are plugged in, and unmounts<br />
&gt; them when they are<br />
&gt;  removed. The mountpoints (/media/usb[0-7] by<br />
&gt; default), filesystem types<br />
&gt;  to consider, and mount options are configurable.<br />
&gt; When multiple devices<br />
&gt;  are plugged in, the first available mountpoint is<br />
&gt; automatically<br />
&gt;  selected. If the device provides a model name, a<br />
&gt; symbolic link<br />
&gt;  /var/run/usbmount/MODELNAME pointing to the<br />
&gt; mountpoint is automatically<br />
&gt;  created.<br />
&gt;  .<br />
&gt;  The script that does the mounting is called by<br />
&gt; the udev daemon.<br />
&gt;  Therefore, USBmount requires a 2.6 (or newer)<br />
&gt; Linux kernel.<br />
&gt;  .<br />
&gt;  Firewire devices are also supported by USBmount.<br />
&gt;  .<br />
&gt;  USBmount is intended as a lightweight solution<br />
&gt; which is independent of<br />
&gt;  a desktop environment. Users which would like an<br />
&gt; icon to appear when an<br />
&gt;  USB device is plugged in should use the pmount<br />
&gt; and hal packages<br />
&gt;  instead.<br />
&gt; Description-md5: 665bf065788bff1ada4b796e26321438<br />
&gt; Homepage:<br />
&gt; <a href="http://usbmount.alioth.debian.org/"  rel="nofollow">http://usbmount.alioth.debian.org/</a></div></blockquote>
&gt; <br />
&gt; To install<br />
&gt; <pre class="bbcode">
&gt; apt-get install usbmount
&gt;</pre>
&gt; <br />
&gt; I&#039;d recommend trying the ready made solution<br />
&gt; usbmount first. udev rules takes a lot of time to<br />
&gt; troubleshoot when it does not work like you<br />
&gt; expect.<br />
<br />
Thanks a lot bohdi, that solved the problem after a restart and walking away from the project some few days.<br />
Now a ext4 formatted USB auto, yes, automounted. I cd to it, made a directory, checked and it&#039;s all good.<br />
I came to desktop installed, xfce, via Remmina, and did the same. All was good. It&#039;s mounted to USB0. That&#039;s fine. <br />
I hope once I move to setting up drives permanently, no problems. <br />
And so thanks a lot. The automounting issue is gone, for now. <br />
Now I move to configuration. Samba is not behaving. But I will now post on the relevant thread.]]></description>
            <dc:creator>notoneofmyseeds</dc:creator>
            <category>Debian</category>
            <pubDate>Wed, 08 Jun 2016 16:46:20 -0500</pubDate>
        </item>
        <item>
            <guid>https://forum.doozan.com/read.php?2,24139,28391#msg-28391</guid>
            <title>Re: Automount USB drives with udev rules using disk label</title>
            <link>https://forum.doozan.com/read.php?2,24139,28391#msg-28391</link>
            <description><![CDATA[ notoneofmyseeds,<br />
<br />
Note that I said in the other thread that there are many ways to set up USB automounting in Linux. <br />
<br />
The hardest way to set up is using udev rules (sometime you want to control the automounting at a lower level). That&#039;s why I posted the instruction here.  However, the easier way to set up is using usbmount or autofs.<br />
<br />
<blockquote class="bbcode"><div><small>Quote<br /></small><strong></strong><br />
~# apt-cache show usbmount<br />
Package: usbmount<br />
Version: 0.0.22<br />
Installed-Size: 116<br />
Maintainer: Rogério Brito &lt;rbrito@ime.usp.br&gt;<br />
Architecture: all<br />
Depends: lockfile-progs, udev, util-linux (&gt;&gt; 2.16)<br />
Recommends: pmount<br />
Description-en: automatically mount and unmount USB mass storage devices<br />
 This package automatically mounts USB mass storage devices (typically<br />
 USB pens) when they are plugged in, and unmounts them when they are<br />
 removed. The mountpoints (/media/usb[0-7] by default), filesystem types<br />
 to consider, and mount options are configurable. When multiple devices<br />
 are plugged in, the first available mountpoint is automatically<br />
 selected. If the device provides a model name, a symbolic link<br />
 /var/run/usbmount/MODELNAME pointing to the mountpoint is automatically<br />
 created.<br />
 .<br />
 The script that does the mounting is called by the udev daemon.<br />
 Therefore, USBmount requires a 2.6 (or newer) Linux kernel.<br />
 .<br />
 Firewire devices are also supported by USBmount.<br />
 .<br />
 USBmount is intended as a lightweight solution which is independent of<br />
 a desktop environment. Users which would like an icon to appear when an<br />
 USB device is plugged in should use the pmount and hal packages<br />
 instead.<br />
Description-md5: 665bf065788bff1ada4b796e26321438<br />
Homepage: <a href="http://usbmount.alioth.debian.org/"  rel="nofollow">http://usbmount.alioth.debian.org/</a><br />
Tag: admin::filesystem, hardware::storage, hardware::usb, interface::daemon,<br />
 role::program, scope::utility, use::configuring<br />
Section: admin<br />
Priority: extra<br />
Filename: pool/main/u/usbmount/usbmount_0.0.22_all.deb<br />
Size: 17666<br />
MD5sum: 1d62c98011ac6452d1e9b3be7b56b272<br />
SHA1: 9a4d4d88ac7f609a27db15235bed605f3f6dadc1<br />
SHA256: 764462e65a544fc6a03ca4f90157898a4f289c3f3bea866c5b739ff9184d6c93<br />
<br />
Package: usbmount<br />
Status: deinstall ok config-files<br />
Priority: extra<br />
Section: admin<br />
Installed-Size: 112<br />
Maintainer: Rogério Brito &lt;rbrito@ime.usp.br&gt;<br />
Architecture: all<br />
Version: 0.0.21<br />
Config-Version: 0.0.21<br />
Depends: udev, lockfile-progs, util-linux (&gt;&gt; 2.16)<br />
Recommends: pmount<br />
Conffiles:<br />
 /etc/usbmount/umount.d/00_remove_model_symlink 06304855418cfe29f6cec46042bdd857<br />
 /etc/usbmount/mount.d/00_create_model_symlink 13ef81167c202627ca43b1fe6c7cd0bf<br />
 /etc/usbmount/usbmount.conf a78d1be4f28c20bdb0b88b23cc01cf5d<br />
Description-en: automatically mount and unmount USB mass storage devices<br />
 This package automatically mounts USB mass storage devices (typically<br />
 USB pens) when they are plugged in, and unmounts them when they are<br />
 removed. The mountpoints (/media/usb[0-7] by default), filesystem types<br />
 to consider, and mount options are configurable. When multiple devices<br />
 are plugged in, the first available mountpoint is automatically<br />
 selected. If the device provides a model name, a symbolic link<br />
 /var/run/usbmount/MODELNAME pointing to the mountpoint is automatically<br />
 created.<br />
 .<br />
 The script that does the mounting is called by the udev daemon.<br />
 Therefore, USBmount requires a 2.6 (or newer) Linux kernel.<br />
 .<br />
 Firewire devices are also supported by USBmount.<br />
 .<br />
 USBmount is intended as a lightweight solution which is independent of<br />
 a desktop environment. Users which would like an icon to appear when an<br />
 USB device is plugged in should use the pmount and hal packages<br />
 instead.<br />
Description-md5: 665bf065788bff1ada4b796e26321438<br />
Homepage: <a href="http://usbmount.alioth.debian.org/"  rel="nofollow">http://usbmount.alioth.debian.org/</a></div></blockquote>
<br />
To install<br />
<pre class="bbcode">
apt-get install usbmount</pre>
<br />
I&#039;d recommend trying the ready made solution usbmount first. udev rules takes a lot of time to troubleshoot when it does not work like you expect.]]></description>
            <dc:creator>bodhi</dc:creator>
            <category>Debian</category>
            <pubDate>Sun, 05 Jun 2016 16:09:43 -0500</pubDate>
        </item>
        <item>
            <guid>https://forum.doozan.com/read.php?2,24139,28388#msg-28388</guid>
            <title>Re: Automount USB drives with udev rules using disk label</title>
            <link>https://forum.doozan.com/read.php?2,24139,28388#msg-28388</link>
            <description><![CDATA[ I placed the first script where it should be. The results:<br />
I logged into xfce but did not find any mounted media.<br />
I clicked on &quot;media&quot; and &quot;mnt;&quot; nothing. <br />
<br />
I placed the second script where it should be by simply coping and pasting the entire thing. The results:<br />
The pogo started but without LED. <br />
I removed it and the Pogo starts with LED.<br />
<br />
Issuing &quot;mount&quot; gives:<br />
<pre class="bbcode">
root@debian:/media# mount  /media
mount: can&#039;t find /media in /etc/fstab</pre>
<br />
After removing the second script, and issued mount, I get:<br />
<br />
<pre class="bbcode">
root@debian:/media# mount
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
udev on /dev type devtmpfs (rw,relatime,size=10240k,nr_inodes=30447,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /run type tmpfs (rw,nosuid,noexec,relatime,size=25092k,mode=755)
/dev/sda1 on / type ext2 (rw,noatime,errors=remount-ro,user_xattr,acl)
tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k)
tmpfs on /run/shm type tmpfs (rw,nosuid,nodev,noexec,relatime,size=50160k)
tmpfs on /tmp type tmpfs (rw,relatime)
rpc_pipefs on /run/rpc_pipefs type rpc_pipefs (rw,relatime)</pre>
<br />
But even by this time, the drive, sda1 was not mounted in the file manager, even after issuing this:<br />
<br />
<pre class="bbcode">
root@debian:/media# mount /dev/sda1
mount: /dev/sda1 is already mounted or / busy
       /dev/sda1 is already mounted on /</pre>
<br />
All this was done using a USB stick, formatted in ext4 and plugged into the front usb port of the pogo. <br />
<br />
I&#039;m hoping to simply be able to plug in drives and have them automount and ready to serve files.<br />
<br />
Thanks, as always, for your kind help.]]></description>
            <dc:creator>notoneofmyseeds</dc:creator>
            <category>Debian</category>
            <pubDate>Sun, 05 Jun 2016 13:32:24 -0500</pubDate>
        </item>
        <item>
            <guid>https://forum.doozan.com/read.php?2,24139,24942#msg-24942</guid>
            <title>Re: Automount USB drives with udev rules using disk label</title>
            <link>https://forum.doozan.com/read.php?2,24139,24942#msg-24942</link>
            <description><![CDATA[ Bodhi,<br />
The new code work perfectly.  Thank you so much!!!  At one point, I decided to go back to 3.17 and reload everything from the 3.17 rootfs.  I couldn&#039;t not get udev working again as work prior to kernel upgrade.  I consider the issue is an intermittent.  I am very appreciate your continuing support for the community!]]></description>
            <dc:creator>Thang</dc:creator>
            <category>Debian</category>
            <pubDate>Sun, 20 Dec 2015 01:02:13 -0600</pubDate>
        </item>
        <item>
            <guid>https://forum.doozan.com/read.php?2,24139,24941#msg-24941</guid>
            <title>Re: Automount USB drives with udev rules using disk label</title>
            <link>https://forum.doozan.com/read.php?2,24139,24941#msg-24941</link>
            <description><![CDATA[ I&#039;ve updated the 1st post to provide the script for automounting USB.]]></description>
            <dc:creator>bodhi</dc:creator>
            <category>Debian</category>
            <pubDate>Sat, 19 Dec 2015 17:29:57 -0600</pubDate>
        </item>
        <item>
            <guid>https://forum.doozan.com/read.php?2,24139,24940#msg-24940</guid>
            <title>Re: Automount USB drives with udev rules using disk label</title>
            <link>https://forum.doozan.com/read.php?2,24139,24940#msg-24940</link>
            <description><![CDATA[ Nope, that is not the thread.  I applied the script and no boot. :-P  Good thing for usb rootfs!!!]]></description>
            <dc:creator>Thang</dc:creator>
            <category>Debian</category>
            <pubDate>Sat, 19 Dec 2015 16:46:05 -0600</pubDate>
        </item>
        <item>
            <guid>https://forum.doozan.com/read.php?2,24139,24939#msg-24939</guid>
            <title>Re: Automount USB drives with udev rules using disk label</title>
            <link>https://forum.doozan.com/read.php?2,24139,24939#msg-24939</link>
            <description><![CDATA[ Bodhi,<br />
This is the thread you are referring to?<br />
<a href="http://forum.doozan.com/read.php?2,6410,6417#msg-6417"  rel="nofollow">http://forum.doozan.com/read.php?2,6410,6417#msg-6417</a><br />
It is quite old. Not sure if it is still valid.<br />
<br />
The persistent network rule regenerate after each reboot even when I comment it out.  I will make note to delete this file when backing up rootfs.]]></description>
            <dc:creator>Thang</dc:creator>
            <category>Debian</category>
            <pubDate>Sat, 19 Dec 2015 16:21:04 -0600</pubDate>
        </item>
        <item>
            <guid>https://forum.doozan.com/read.php?2,24139,24938#msg-24938</guid>
            <title>Re: Automount USB drives with udev rules using disk label</title>
            <link>https://forum.doozan.com/read.php?2,24139,24938#msg-24938</link>
            <description><![CDATA[ Ah, I remember discussing a similar problem here with another forum member, and it might be it. We&#039;ll need to mount the USB drives using label in rc.local in some case. It&#039;s been a long time so I can&#039;t remember the details. The solution was to create a shell script and mount all USB drives with label when the system is running  rc.local.<br />
<br />
But first, slightly off topic, your persistent network rules should be commented out (everything). This is to avoid future problem in using the rootfs on anther box.<br />
<br />
<pre class="bbcode">
# Unknown net device (/devices/platform/40400000.ethernet/net/eth0) (stmmaceth) 
###SUBSYSTEM==&quot;net&quot;, ACTION==&quot;add&quot;, DRIVERS==&quot;?*&quot;, ATTR{address}==&quot;00:25:31:xx:xx:xx&quot;, ATTR{dev_id}==&quot;0x0&quot;, ATTR{type}==&quot;1&quot;, KERNEL==&quot;eth*&quot;, NAME=&quot;eth0&quot; 

# PCI device 0x1814:/sys/devices/platform/47c00000.pcie-controller/pci0000:00/0000:00:00.0 (rt2800pci) 
###SUBSYSTEM==&quot;net&quot;, ACTION==&quot;add&quot;, DRIVERS==&quot;?*&quot;, ATTR{address}==&quot;48:5d:60:xx:xx:xx&quot;, ATTR{dev_id}==&quot;0x0&quot;, ATTR{type}==&quot;1&quot;, KERNEL==&quot;wlan*&quot;, NAME=&quot;wlan0&quot;
</pre>]]></description>
            <dc:creator>bodhi</dc:creator>
            <category>Debian</category>
            <pubDate>Sat, 19 Dec 2015 15:39:20 -0600</pubDate>
        </item>
        <item>
            <guid>https://forum.doozan.com/read.php?2,24139,24937#msg-24937</guid>
            <title>Re: Automount USB drives with udev rules using disk label</title>
            <link>https://forum.doozan.com/read.php?2,24139,24937#msg-24937</link>
            <description><![CDATA[ The 70-automount.rules still remain the same.  I have tried to recopy and paste it.  70-persistent-net.rules is the auto generated one after each reboot.  A total of two files.<br />
<br />
This is the content of the 70-persistent-net.rules:<br />
# This file was automatically generated by the /lib/udev/write_net_rules<br />
# program, run by the persistent-net-generator.rules rules file.<br />
#<br />
# You can modify it, as long as you keep each rule on a single<br />
# line, and change only the value of the NAME= key.<br />
<br />
# Unknown net device (/devices/platform/40400000.ethernet/net/eth0) (stmmaceth)<br />
SUBSYSTEM==&quot;net&quot;, ACTION==&quot;add&quot;, DRIVERS==&quot;?*&quot;, ATTR{address}==&quot;00:25:31:xx:xx:xx&quot;, ATTR{dev_id}==&quot;0x0&quot;, ATTR{type}==&quot;1&quot;, KERNEL==&quot;eth*&quot;, NAME=&quot;eth0&quot;<br />
<br />
# PCI device 0x1814:/sys/devices/platform/47c00000.pcie-controller/pci0000:00/0000:00:00.0 (rt2800pci)<br />
SUBSYSTEM==&quot;net&quot;, ACTION==&quot;add&quot;, DRIVERS==&quot;?*&quot;, ATTR{address}==&quot;48:5d:60:xx:xx:xx&quot;, ATTR{dev_id}==&quot;0x0&quot;, ATTR{type}==&quot;1&quot;, KERNEL==&quot;wlan*&quot;, NAME=&quot;wlan0&quot;<br />
<br />
I ran udevadm monitor and see that the trigger command is working but it just won&#039;t mount.  I am mounting FAT32 at the moment.  FAT32 did not work with kernel 3.17.  I think someone forgot to include the module.  It didnot even mount manually.  I can manually mount with 4.1 but not working with udev and udev script.<br />
<br />
lsblk -o name,size,type,fstype,label,mountpoint<br />
NAME        SIZE TYPE FSTYPE LABEL    MOUNTPOINT<br />
sda         1.9G disk<br />
`-sda1      1.9G part vfat   USBFAT32<br />
sdb        14.5G disk<br />
`-sdb1     14.5G part ext3   rootfs   /<br />
mtdblock0    14M disk<br />
mtdblock1   114M disk]]></description>
            <dc:creator>Thang</dc:creator>
            <category>Debian</category>
            <pubDate>Sat, 19 Dec 2015 15:22:07 -0600</pubDate>
        </item>
        <item>
            <guid>https://forum.doozan.com/read.php?2,24139,24936#msg-24936</guid>
            <title>Re: Automount USB drives with udev rules using disk label</title>
            <link>https://forum.doozan.com/read.php?2,24139,24936#msg-24936</link>
            <description><![CDATA[ Thang,<br />
<br />
Upgrade should not break any of the custom rules that you have in the system. With the exception that sometime the new version could change the rules, e.g. persistent network rules are usually affected by kernel and package upgrade.<br />
<br />
 Is  /etc/udev/rules.d/70-automount.rules still there, the content is the same? is there any other automount rules file that were created in this directory  after the upgrade ?]]></description>
            <dc:creator>bodhi</dc:creator>
            <category>Debian</category>
            <pubDate>Sat, 19 Dec 2015 15:05:49 -0600</pubDate>
        </item>
        <item>
            <guid>https://forum.doozan.com/read.php?2,24139,24935#msg-24935</guid>
            <title>Re: Automount USB drives with udev rules using disk label</title>
            <link>https://forum.doozan.com/read.php?2,24139,24935#msg-24935</link>
            <description><![CDATA[ I forgot to mention I am using Pogo Pro with Debian.]]></description>
            <dc:creator>Thang</dc:creator>
            <category>Debian</category>
            <pubDate>Sat, 19 Dec 2015 14:38:59 -0600</pubDate>
        </item>
        <item>
            <guid>https://forum.doozan.com/read.php?2,24139,24934#msg-24934</guid>
            <title>Re: Automount USB drives with udev rules using disk label</title>
            <link>https://forum.doozan.com/read.php?2,24139,24934#msg-24934</link>
            <description><![CDATA[ Bodhi,<br />
It seems the latest 4.1 kernel breaks the udev rules.  Would you please confirm?  It works great for 3.17 kernel. After upgraded to 4.1 kernel automount script with udev no longer work.]]></description>
            <dc:creator>Thang</dc:creator>
            <category>Debian</category>
            <pubDate>Sat, 19 Dec 2015 14:37:04 -0600</pubDate>
        </item>
        <item>
            <guid>https://forum.doozan.com/read.php?2,24139,24244#msg-24244</guid>
            <title>Re: Automount USB drives with udev rules using disk label</title>
            <link>https://forum.doozan.com/read.php?2,24139,24244#msg-24244</link>
            <description><![CDATA[ cbalde04,<br />
<br />
Autofs is a convenient utility to automount NFS, USB, HDD, ... file systems, where you will set it up to automount certain file systems that you want. udev rules is a lower level kind of device handling. If you dont want to deal with udev, then use autofs. <br />
<br />
Or you can also use both. For example, if you use these rules here, then don&#039;t use autofs to automount USB drives.<br />
<br />
For automount NFS, autofs is pretty convenient. I use it so that the shares are mounted when I start typing the names at the command line. And they time out and disappear after a period of time.]]></description>
            <dc:creator>bodhi</dc:creator>
            <category>Debian</category>
            <pubDate>Wed, 28 Oct 2015 12:16:27 -0500</pubDate>
        </item>
        <item>
            <guid>https://forum.doozan.com/read.php?2,24139,24241#msg-24241</guid>
            <title>Re: Automount USB drives with udev rules using disk label</title>
            <link>https://forum.doozan.com/read.php?2,24139,24241#msg-24241</link>
            <description><![CDATA[ Bodhi,<br />
I noticed that one of the added capabilities of the 4.0.0 kernel for the Oxnas OX820 devises shows &quot;1. Automount (AUTOFS), pNFS, XFS&quot;. Does this kernel automatically locate and associate the rootfs, rendering this rule unnecessary for kernal 4.0.0 and above? Or am I just not quite understanding the Automount capability of 4.0.0?]]></description>
            <dc:creator>cbalde04</dc:creator>
            <category>Debian</category>
            <pubDate>Wed, 28 Oct 2015 06:03:41 -0500</pubDate>
        </item>
        <item>
            <guid>https://forum.doozan.com/read.php?2,24139,24139#msg-24139</guid>
            <title>Automount USB drives with udev rules using disk label</title>
            <link>https://forum.doozan.com/read.php?2,24139,24139#msg-24139</link>
            <description><![CDATA[ The following are my udev rules for automounting (hotplug) USB drives with the disk partition label. If you know what udev rules are and wish to use udev to automount USB drives, then this is for you. <span style="color:#3333FF">If you are not sure about udev rules, then I&#039;d suggest looking into <b>usbmount</b>, <b>autofs</b>,</span> ... to install one of these Debian packages to handle the automounting.<br />
<br />
<b>1. udev rules</b> <br />
<br />
The udev rules below will mount all USB drives, uncluding mounting USB drives format with HFSplus file system in Read/Write mode.<br />
<br />
<span style="color:#FF0000">Please be aware that HFSplus fie system driver is experimental and unsupported by mainline Linux (there is risk of data corruption by potential unknown bugs). If you don&#039;t use HFSplus file system then it is OK to use this rules file as is. To remove HFSplus Write capability, comment out the 3 rules lines in blue (it will mount Read-Only as usual).</span><br />
<br />
Create the automount rules file (or edit your current rules) /etc/udev/rules.d/70-automount.rules. Copy and paste the following rules below.<br />
<br />
<pre class="bbcode">
# NOTE: 
#       1. use pmount --sync if drive label ends with Sync/SYNC/sync in add action to allow removal without corruption
#       2. avoid mounting EFI partition for a HFS+ drive
#       3. force mount HFS+ partition as read-write
#       4. mount USB hardrive (which is identified as SSCI)

KERNEL!=&quot;sd*&quot;, GOTO=&quot;media_label_end&quot;
ENV{ID_TYPE}!=&quot;disk&quot;, GOTO=&quot;media_label_end&quot;

IMPORT{program}=&quot;/sbin/blkid -o udev -p %N&quot;, ENV{name}=&quot;%E{ID_FS_LABEL}&quot;
ENV{ID_FS_TYPE}==&quot;&quot;, GOTO=&quot;media_label_end&quot;

ENV{ID_FS_LABEL}!=&quot;EFI&quot;, GOTO=&quot;continue&quot;
ENV{ID_PART_TABLE_TYPE}==&quot;gpt&quot;, GOTO=&quot;media_label_end&quot;

LABEL=&quot;continue&quot;

ENV{name}==&quot;&quot;, ENV{name}=&quot;%k&quot;

KERNEL==&quot;sd*&quot;, SYMLINK+=&quot;usb-storage/%E{name}&quot;

ENV{name}==&quot;*SYNC&quot;, ENV{mode}=&quot;--sync&quot;
ENV{name}==&quot;*Sync&quot;, ENV{mode}=&quot;--sync&quot;
ENV{name}==&quot;*sync&quot;, ENV{mode}=&quot;--sync&quot;
ENV{name}!=&quot;*SYNC&quot;, ENV{mode}=&quot;&quot;

<span style="color:#3333FF">ENV{ID_FS_TYPE}==&quot;hfsplus&quot;, ENV{mode2}=&quot;--read-write&quot;
ENV{ID_FS_TYPE}==&quot;hfsplus&quot;, ENV{mode3}=&quot;/bin/mount -v -o remount,force,rw /media/%E{name}&quot;
ENV{ID_FS_TYPE}!=&quot;hfsplus&quot;, ENV{mode3}=&quot;/usr/bin/pmount&quot;</span>

ACTION==&quot;add&quot;, RUN+=&quot;/usr/bin/pmount -t %E{ID_FS_TYPE} %E{mode} %E{mode2} --noatime --umask 000 %k %E{name}&quot;
ACTION==&quot;add&quot;, RUN+=&quot;%E{mode3}&quot;
ACTION==&quot;remove&quot;, RUN+=&quot;/usr/bin/pumount --yes-I-really-want-lazy-unmount %E{name}&quot;

LABEL=&quot;media_label_end&quot;</pre>
<br />
<br />
<b>2. (DEPRECATED) Aumounting USB drives during system startup</b><br />
<br />
 <span style="color:#0033FF"><b>bodhi&#039;s Update</b>: this is not need anymore with my latest released kernels and rootfs. Keeping here for posterity.</span><br />
<br />
A long time ago, we&#039;ve found that udevs rules for automounting USB drives were not enough<br />
<br />
During system startup, the rules were not triggered, so the USB drives were not aumounted (except for the rootfs, which is always mounted by the kernel). Perhaps with recent udev versions there might be  a better way than using a script.<br />
<br />
The script below is to help automounting all USB drives that were not mounted by udev rules during system startup. This script should be executed in /etc/rc.local (preferably at the beginning). <br />
<br />
usb-storage.pmount<br />
<pre class="bbcode">
#!/bin/bash
 
logger -s -i &quot;Pmounting all unmounted USB drives&quot;

PMOUNT=`which pmount`
if [ -z &quot;$PMOUNT&quot; ]
then
  logger -s -i  &quot;Error: $0 cant find pmount!&quot; 1&gt;&amp;2
 exit 1
fi

ROOT=&quot;/dev/usb-storage&quot;
DEV_LIST=`ls -1 $ROOT`

logger -s -i &quot;Mounting all unmounted USB disks: $DEV_LIST (skip rootfs)&quot;

for DEV in $DEV_LIST; do
   
   if [ &quot;$DEV&quot; != &quot;rootfs&quot; ]; then
   
      if  ! /bin/mountpoint /media/$DEV -q ; then
         $PMOUNT --noatime --umask 000 --read-write $ROOT/$DEV $DEV
         
      fi
   fi

done

logger -s -i &quot;Done Pmounting USB drives&quot;

exit 0
</pre>]]></description>
            <dc:creator>bodhi</dc:creator>
            <category>Debian</category>
            <pubDate>Sun, 18 Oct 2015 23:11:49 -0500</pubDate>
        </item>
    </channel>
</rss>
