Welcome! Log In Create A New Profile

Advanced

Automount NTFS/HFS+ on Dockstar Debian

Posted by bodhi 
Re: Automount NTFS on Dockstar Debian
March 07, 2011 12:58PM
I have an idea how to address the boot up issue. I'm going to experiment with having that rule file also add some unique symlinks under /dev with the intention that a start up script can later go through them all and pmount them. It won't even matter if the script runs again because pmount will skip anything already mounted. I also need to verify if all mounted file systems are unmounted during a shutdown, or only those specified in /etc/fstab, and account for that as well if necessary.
Re: Automount NTFS on Dockstar Debian
March 07, 2011 02:12PM
The output of blkid command:

# blkid
/dev/sda1: UUID="2f55c61c-11c5-4bca-8ccf-50d2a2ffe970" TYPE="ext2"
/dev/sdb1: LABEL="USBTEST1" UUID="E20C879F0C876D7B" TYPE="ntfs"

I was thinking this could be piped to awk or regex to extract the sd devices and pmount them with either label or device name. Would that work? (I've only used awk occasionally)
Re: Automount NTFS on Dockstar Debian
March 07, 2011 02:24PM
Yes thats part of my plan as blkid provides all the information necessary to mount the filesystem. And by using very specific /dev symlinks for the usb found storage devices, I can generalize the script for use on some other linux boxes of mine. I'm also considering adding support for blacklist file that could be used to explicitly prevent a particular device from being mounted (by UUID or LABEL).
Re: Automount NTFS on Dockstar Debian
March 11, 2011 06:31PM
Done!

Below is my updated udev rule. It adds a device symlink of /dev/usb-storage/%E{name} where %E{name} is either the label or the device name if there's no label. (The SYMLINK directive is very particular. I found you can't just append it to any rule. I had to look at the base rules in /lib/udev/rules.d and compare. After wasting a lot of time on this, I decided it was just easiest to filter out anything that was not a usb attached storage device, and then simply match on the kernel device name "sd*". If anyone has seen anything else such hd*, please let me know.)

root@debian:~# cat /etc/udev/rules.d/90-automount.rules

KERNEL!="sd*", GOTO="media_label_end"
ENV{ID_USB_DRIVER}!="usb-storage", GOTO="media_label_end"

IMPORT{program}="/sbin/blkid -o udev -p %N", ENV{name}="%E{ID_FS_LABEL}"
ENV{ID_FS_TYPE}=="", GOTO="media_label_end"
ENV{name}=="", ENV{name}="%k"

KERNEL=="sd*", SYMLINK+="usb-storage/%E{name}"

ACTION=="add", RUN+="/usr/bin/pmount -t %E{ID_FS_TYPE} --sync --noatime --umask 000 %k %E{name}"
ACTION=="remove", RUN+="/usr/bin/pumount %E{name}"

LABEL="media_label_end"

The script below will attempt to pmount all devices found under /dev/usb-storage. It runs blkid against them to get the filesystem type. I made it skip any swap partitions. Pmount will complain if a device is already mounted (such as the root partition) but there's no harm done. Again, I decided it was just easier to let pmount try them all than bother checking against the output of mount, one reason being that mount always displays the native kernel device name, not the symlink'ed name. And yes, its a bash script. I know bash. I didn't feel like wrestling with the sh shell.

root@debian:~# cat /root/usb-storage.pmount
#!/bin/bash

PMOUNT=`which pmount`
if [ -z "$PMOUNT" ]
then
 echo "Error: $0 cant find pmount!" 1>&2
 exit 1
fi
OPTIONS="--sync --noatime --umask 000"

ROOT="/dev/usb-storage"
for DEV in $( ls -1 $ROOT )
do
  BLKID=( `/sbin/blkid $ROOT/$DEV` )
  for ITEM in ${BLKID[@]}
  do
    TEMP=`expr match "$ITEM" 'TYPE=\"\(.*\)\"'`
    TYPE=${TEMP//\"/}
    if [ -n "$TYPE" ] && [ "$TYPE" != "swap" ]
    then
      echo "$ROOT/$DEV"
      echo `$PMOUNT -t $TYPE $OPTIONS $ROOT/$DEV $DEV`
      break
    fi
  done
done

exit 0

The final piece of the puzzle is that /etc/rc.local calls this script so that it's run at the very end of the boot up process, mounting all the attached file systems for you. And just like before, the udev rule alone will handle any additions or removals from then on.

root@debian:~# cat /etc/rc.local
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

/root/usb-storage.pmount

exit 0

If anyone wants to take this a step further, it could be converted to a proper startup script. The script should be converted to /bin/sh, an INIT section added, moved into /etc/init.d, and then symlinked into the run-level directories with update-rc.d like any other startup script.



Edited 1 time(s). Last edit at 03/12/2011 10:58AM by kraqh3d.
Re: Automount NTFS on Dockstar Debian
March 12, 2011 01:42AM
kraqh3d,

Thanks for this restart automount mod! fantastic! It is as flexible as it can be. Especially when using a swap file on the boot USB thumb drive (my boot drive has a single partition). I can now connect the boot drive to any of 4 USB ports. No need for hard coded fstab entry :-)

I've also defined /media as samba share, so all automounted USB drives are visible to other PCs in the network whenever they are plugged in or after restarted, and go away when they are unplugged.

bodhi
Re: Automount NTFS on Dockstar Debian
March 12, 2011 10:57AM
How's the swap file working?

I've noticed that swap is mounted by /etc/fstab from a direct device path, in my case /dev/sda2. The root partition is loaded from a symlink /dev/root that points to the boot device, which is not always /dev/sda1. (I'm not sure where this symlink is created. I think possibly by the uboot scripts.) The problem with this is that swap is only loaded when my root device is enumerated as /dev/sda. I discovered this because I've been keeping an eye on memory usage with htop. I found I barely exceed 80MB peak and that swap was unused and showing 0MB.

So, I've been considering deleting my swap partition, and extending the ext2 boot partition to fill the entire device since its only a 1GB thumb drive. I could then use no swap, which is what I noticed I'm mostly doing now, or use a 64MB swap file, strictly as a precaution.

My next thing is to better address my samba sharing. I have a unique config using aliased NetBIOS names so that all my pre-existing Xbmc media paths in the database continue to work using fake names of "music" and "video" which were two other systems I've retired. They are shared read-only. I also have a master, unbrowseable share that's authenticated and provides read-write access. My problem is that I have multiple media discs.

I'm considering using unionfs or aufs to provide consolidation points of /mnt/music and /mnt/video which will link up different disks. Most of my USB disks only contain a single media type so I would simply give them labels of MUSIC_#, and VIDEO_#. The plan being to try and group them together under a common mount point, so that /mnt/music collapses /media/MUSIC_* and /mnt/video collapses /media/VIDEO_*. I haven't tried yet so I'm not sure if this will work with the on the fly mounting, given than not all /media/VIDEO_* may exist.



Edited 1 time(s). Last edit at 03/12/2011 11:01AM by kraqh3d.
Re: Automount NTFS on Dockstar Debian
March 12, 2011 04:37PM
Swap file is great. I created the swapfile at the root of the boot drive. So if the boot drive designation was moved around by other drive such as the Seagate GO drive connected to the small USB port, then it's still correct in fstab because it is simply stated as a file at root directory. I've barely used up memory, unless running a lot of video streaming while also using webmin to monitor the box (maximum swap I've used so far was 4-10KB). So far so good.

With a single partition for boot drive, I also created a /localdisk as samba share so I have some temporary space to copy stuff in and out in if needed. I found this is the most convenient set up. Since the swap file, the debian sysem, and the /localdisk can use the remaining free space on this 4GB thumb drive to grow/shrink as needed. Currently my swap file is 1GB :-), just because it's can be shrunk any time.

Your configuration is way more complicated than mine. I'm still moving some media files that are on an attached USB to the XBMC HTPC to the Dockstar drive. BTW, in case you're not aware of the XBMC setting for cleaning library automatically, if the media drive is a network drive then don't use that setting. Because whenever the drive is offline, and you start XBMC, it will erase all library files like thumbnails and fan-arts for files on that source. I always set this to "not cleaning automatically" and then clean it once in a while when all media sources are online.



Edited 1 time(s). Last edit at 03/12/2011 04:42PM by bodhi.
Re: Automount NTFS on Dockstar Debian
March 13, 2011 01:40PM
Thanks for the info. I'm going to wipe the swap partition and replace it with a swap file.

And I am intimately aware of the autoclean issue... As it turned out, I was an Xbmc developer back from it's inception, when it only ran on the Xbox. If you look through the old svn commit logs, you'll find that I made change that defaulted the "cleanonupdate" option to false because Xbmc can't tell the difference between a deleted item or an inaccessible item ;)

(Ironically, before I "retired' I had a plan to address that problem by marking the paths in the database as inaccessible. These items could then be hidden from the library, but without actually being deleted. At the next scan, if they were accessible again, the flag would be removed and they would be seen. A option to show inaccessible items was discussed, as was a manual "clean database" action which would purge all the inaccessible items from the database. Now that I have more time on my hands, maybe I will implement it.)



Edited 3 time(s). Last edit at 03/13/2011 01:57PM by kraqh3d.
Re: Automount NTFS on Dockstar Debian
March 13, 2011 04:54PM
kraqh3d,

That would be great! And thanks for your work on XBMC early days. It's the best media player software I've ever used. I've learned a lot about how to build user interface with XML since I've started using it. Just like I've learned a lot about Linux system admin here in this forum. Many thanks to Jeff for his works and hosting this.

bodhi
Re: Automount NTFS on Dockstar Debian
July 18, 2011 09:50PM
In light of recent posting about auto-mounting, just want to update my experience using these udev rules and pmount script. Working great :-) This setup takes any USB drives I've swap in and out flawlessly, to the point I've stopped being aware about it.

I've since modified the rules and the mouting script to perform auto-mounting for USB drives that need write-optimized performance. For example, instead of unplugging the drive and move it to a PC to copy large video files, or when using USB HDD drive for transmission torrents. Basically, if the drive label name ends with "Async" then the rules for mounting it is without the "--sync" option. This way, if the USB drive is rarely unplugged from the dockstar, then we can achieve maximum I/O performance. The only precaution needed is we should use webmin or ssh/telnet command line to un-mount it before unplugging.

Change for /etc/udev/rules.d/90-automount.rules

ENV{name}!="*Async", ENV{mode}="--sync"
ENV{name}=="*Async", ENV{mode}=""

ACTION=="add", RUN+="/usr/bin/pmount -t %E{ID_FS_TYPE} %E{mode} --noatime --umask 000 %k %E{name}"

Change for /root/usb-storage.pmount

if [ -n "$TYPE" ] && [ "$TYPE" != "swap" ]
    then
      echo "$ROOT/$DEV"
      if [ `expr $DEV : '.*Async'` ]
      then
        OPTIONS="--noatime --umask 000"
      fi
      echo `$PMOUNT -t $TYPE $OPTIONS $ROOT/$DEV $DEV`
      break
    fi
Re: Automount NTFS on Dockstar Debian
July 19, 2011 05:50AM
Nice enhancement. I may borrow this.
Re: Automount NTFS on Dockstar Debian
July 19, 2011 12:16PM
Thanks! I'm glad you like it :-) and by all mean, I've only extended your works a little bit.
Re: Automount NTFS on Dockstar Debian
July 19, 2011 01:22PM
I'm kind of glad that you bumped this thread back up. I never did get around to experimenting with aufs to merge my filesystems together for easier export through samba. I also want to do some testing to time file copies. I'm currently not running anything on my dockstar other than nfs and samba to export filesystems. I can mount a disk with sync and async and copy a large file over the network to it (probably the Big Buck Bunny video file) using both samba and nfs and see what the difference is. I can then try copying the same file locally, from another disk. The funny thing is I'm getting torrents and nzb's but writing to the dockstar using a samba mount. I may need to work up a simple system to dump torrent and nzb files to a directory that's monitored to auto-fetch.
Re: Automount NTFS on Dockstar Debian
July 20, 2011 01:27PM
I believe the performance gained with samba using async mount will be substantial. I did not measure it, but it was visible enough when I looked.
Re: Automount NTFS on Dockstar Debian
November 09, 2011 11:07AM
Hey Bodhi, I thought you would find this interesting... I was more than happy with the performance with the sync option so I never looked at async mode. Until very recently, I'd only had USB attached discs. This time I was using a flash media (ie conforming to the USB Mass Storage spec) and they are apparently very different from USB attached hard drives. They have absolutely dreadful performance with the sync option. I tried a PSP, a USB to MicroSD card reader, and some USB flash sticks. In all cases I was lucky to get 100KB/s write speeds. First I assumed they were being mounted as USB1.1. I added the uhci driver to the blacklist to prevent it from being loaded but the problem persisted. I remounted with async and voila, I got write speeds around 8MB/s. (Still less than the hard drives with sync, but a hell of a lot better then 100KB/s.) I need to rework the udev rule to check for them and to force them into async mode. I found the key attribute to distinguish them from USB hard drives is ATTR{removable}=="1". I'll probably be experimenting with something like this, assume I can reference %E{options} in the second rule.

ACTION=="add", ATTR{removable}!="1", ENV{options}="--sync"
ACTION=="add", ENV{options}=="%E{options} --noatime --umask 000"
ACTION=="add", RUN+="/usr/bin/pmount -t %E{ID_FS_TYPE} %E{options} %E{name}"
Re: Automount NTFS on Dockstar Debian
November 09, 2011 01:54PM
kraqh3d Wrote:
-------------------------------------------------------
> Hey Bodhi, I thought you would find this
> interesting... I was more than happy with the
> performance with the sync option so I never looked
> at async mode. Until very recently, I'd only had
> USB attached discs. This time I was using a flash
> media (ie conforming to the USB Mass Storage spec)
> and they are apparently very different from USB
> attached hard drives. They have absolutely
> dreadful performance with the sync option. I
> tried a PSP, a USB to MicroSD card reader, and
> some USB flash sticks. In all cases I was lucky
> to get 100KB/s write speeds. First I assumed they
> were being mounted as USB1.1. I added the uhci
> driver to the blacklist to prevent it from being
> loaded but the problem persisted. I remounted
> with async and voila, I got write speeds around
> 8MB/s. (Still less than the hard drives with
> sync, but a hell of a lot better then 100KB/s.) I
> need to rework the udev rule to check for them and
> to force them into async mode. I found the key
> attribute to distinguish them from USB hard drives
> is ATTR{removable}=="1". I'll probably be
> experimenting with something like this, assume I
> can reference %E{options} in the second rule.
>
> ACTION=="add", ATTR{removable}!="1",
> ENV{options}="--sync"
> ACTION=="add", ENV{options}=="%E{options}
> --noatime --umask 000"
> ACTION=="add", RUN+="/usr/bin/pmount -t
> %E{ID_FS_TYPE} %E{options} %E{name}"

Indeed! it's really nice to have this as default setting for sync/async. And I think we can combine with the label name rule, too.That will recognize USB flash/HDD drives for special purpose.



Edited 2 time(s). Last edit at 11/09/2011 01:55PM by bodhi.
Re: Automount NTFS on Dockstar Debian
March 05, 2012 11:59PM
kraqh3d,

I thought you might find this problem interesting and could give me some help. I've changed the automount rules to do these:
- async/sync (we took care of this)
- mount Mac OSX HFS+ partitions as read/write and ignore the EFI boot partition on those HFS+ drives.

The part that I can't make it work is forcing the HFS+ partition to be mounted as read-write, using pmount. Here is the rules file:

root@Ds1:/etc/udev/rules.d# cat 70-automount.rules
# 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

KERNEL!="sd*", GOTO="media_label_end"
ENV{ID_USB_DRIVER}!="usb-storage", GOTO="media_label_end"

IMPORT{program}="/sbin/blkid -o udev -p %N", ENV{name}="%E{ID_FS_LABEL}"
ENV{ID_FS_TYPE}=="", GOTO="media_label_end"

ENV{ID_FS_LABEL}!="EFI", GOTO="continue"
ENV{ID_PART_TABLE_TYPE}=="gpt", GOTO="media_label_end"

LABEL="continue"

ENV{name}=="", ENV{name}="%k"

KERNEL=="sd*", SYMLINK+="usb-storage/%E{name}"

ENV{name}=="*SYNC", ENV{mode}="--sync"
ENV{name}=="*Sync", ENV{mode}="--sync"
ENV{name}=="*sync", ENV{mode}="--sync"
ENV{name}!="*SYNC", ENV{mode}=""

ENV{ID_FS_TYPE}=="hfsplus", ENV{mode2}="--read-write"

ACTION=="add", RUN+="/usr/bin/pmount -t %E{ID_FS_TYPE} %E{mode} %E{mode2} --noatime --umask 000 %k %E{name}"
ACTION=="remove", RUN+="/usr/bin/pumount --yes-I-really-want-lazy-unmount %E{name}"

LABEL="media_label_end"

Now this always results in the usual warning for mounting a HFS+ partition as read-only, and it was mounted as "ro". And when I tried to pmount it at command line, I got the same result:

root@Ds1:/etc/udev/rules.d# pmount -t hfsplus --noatime --umask 000 --read-write /dev/sdb2 HFSpDrive
mount: warning: /media/HFSpDrive seems to be mounted read-only.

If I use "mount" to mount this drive with "force read-write" option, then it is mount as read-write correctly without complaining.

But not possible with pmount! Strange?

Anybody knows why, please post.
Re: Automount NTFS on Dockstar Debian
March 15, 2012 11:06PM
Here is the work around I came up for aumounting HFSplus drive as Read/Write. It seems to work fine. I've only tested by transferring a few small and few large files. So far no problem with Writes.

IMPORTANT: it is explicitly stated in the man page for Debian HFSplus package that Write capability is still experimental and unsupported. So my intention is to use the HFSplus formatted drive mostly in Read-only mode, and only writing to it occasionally. Probably best with a disk/file system error check whenever it's plugged back into a Mac.


root@Ds1:/etc/udev/rules.d# cat 70-automount.rules

# 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

KERNEL!="sd*", GOTO="media_label_end"
ENV{ID_USB_DRIVER}!="usb-storage", GOTO="media_label_end"

IMPORT{program}="/sbin/blkid -o udev -p %N", ENV{name}="%E{ID_FS_LABEL}"
ENV{ID_FS_TYPE}=="", GOTO="media_label_end"

ENV{ID_FS_LABEL}!="EFI", GOTO="continue"
ENV{ID_PART_TABLE_TYPE}=="gpt", GOTO="media_label_end"

LABEL="continue"

ENV{name}=="", ENV{name}="%k"

KERNEL=="sd*", SYMLINK+="usb-storage/%E{name}"

ENV{name}=="*SYNC", ENV{mode}="--sync"
ENV{name}=="*Sync", ENV{mode}="--sync"
ENV{name}=="*sync", ENV{mode}="--sync"
ENV{name}!="*SYNC", ENV{mode}=""

ENV{ID_FS_TYPE}=="hfsplus", ENV{mode2}="--read-write"
ENV{ID_FS_TYPE}=="hfsplus", ENV{mode3}="/bin/mount -v -o remount,force,rw /media/%E{name}"
ENV{ID_FS_TYPE}!="hfsplus", ENV{mode3}="/usr/bin/pmount"

ACTION=="add", RUN+="/usr/bin/pmount -t %E{ID_FS_TYPE} %E{mode} %E{mode2} --noatime --umask 000 %k %E{name}"
ACTION=="add", RUN+="%E{mode3}"
ACTION=="remove", RUN+="/usr/bin/pumount --yes-I-really-want-lazy-unmount %E{name}"

LABEL="media_label_end"
Re: Automount NTFS/HFS+ on Dockstar Debian
April 11, 2012 02:35PM
any idea how to get this to mount exfat automatically with udev? i have the fuse exfat module installed and can mount them with the regular mount command.

mount -t exfat-fuse /dev/sdb1 /media/mountpoint

ext, ntfs-3g and fat32 work great with the udev configuration kraqh3d posted.
Re: Automount NTFS/HFS+ on Dockstar Debian
April 12, 2012 01:42AM
Please post the output of

udevadmin info --query=all --name=/dev/sdxx

where sdxx is the drive letter for your exfat drive.
Re: Automount NTFS/HFS+ on Dockstar Debian
April 13, 2012 10:28AM
i have a udevadm command, it gives a ton of info about the drive. it shows "ID_FS_TYPE=exfat" but the mount command i tell it that its type "exfat-fuse"... is there a way to map exfat to use exfat-fuse?

thanks!

udevadm info --query=all --name=/dev/sdb1
P: /devices/platform/orion-ehci.0/usb1/1-1/1-1.3/1-1.3:1.0/host7/target7:0:0/7:0:0:0/block/sdb/sdb1
N: sdb1
S: disk/by-id/usb-Kingston_DataTraveler_109_00187D1174F1EC10E0003168-0:0-part1
S: disk/by-label/Kingston
S: disk/by-path/platform-orion-ehci.0-usb-0:1.3:1.0-scsi-0:0:0:0-part1
S: disk/by-uuid/4F75-E6B4
E: DEVLINKS=/dev/disk/by-id/usb-Kingston_DataTraveler_109_00187D1174F1EC10E0003168-0:0-part1 /dev/disk/by-label/Kingston /dev/disk/by-path/platform-orion-ehci.0-usb-0:1.3:1.0-scsi-0:0:0:0-part1 /dev/disk/by-uuid/4F75-E6B4
E: DEVNAME=/dev/sdb1
E: DEVPATH=/devices/platform/orion-ehci.0/usb1/1-1/1-1.3/1-1.3:1.0/host7/target7:0:0/7:0:0:0/block/sdb/sdb1
E: DEVTYPE=partition
E: ID_BUS=usb
E: ID_FS_LABEL=Kingston
E: ID_FS_LABEL_ENC=Kingston
E: ID_FS_TYPE=exfat
E: ID_FS_USAGE=filesystem
E: ID_FS_UUID=4F75-E6B4
E: ID_FS_UUID_ENC=4F75-E6B4
E: ID_FS_VERSION=1.0
E: ID_INSTANCE=0:0
E: ID_MODEL=DataTraveler_109
E: ID_MODEL_ENC=DataTraveler\x20109
E: ID_MODEL_ID=6545
E: ID_PART_ENTRY_DISK=8:16
E: ID_PART_ENTRY_NUMBER=1
E: ID_PART_ENTRY_OFFSET=2
E: ID_PART_ENTRY_SCHEME=dos
E: ID_PART_ENTRY_SIZE=30481150
E: ID_PART_ENTRY_TYPE=0x7
E: ID_PART_TABLE_TYPE=dos
E: ID_PATH=platform-orion-ehci.0-usb-0:1.3:1.0-scsi-0:0:0:0
E: ID_PATH_TAG=platform-orion-ehci_0-usb-0_1_3_1_0-scsi-0_0_0_0
E: ID_REVISION=PMAP
E: ID_SERIAL=Kingston_DataTraveler_109_00187D1174F1EC10E0003168-0:0
E: ID_SERIAL_SHORT=00187D1174F1EC10E0003168
E: ID_TYPE=disk
E: ID_USB_DRIVER=usb-storage
E: ID_USB_INTERFACES=:080650:
E: ID_USB_INTERFACE_NUM=00
E: ID_VENDOR=Kingston
E: ID_VENDOR_ENC=Kingston
E: ID_VENDOR_ID=0930
E: MAJOR=8
E: MINOR=17
E: SUBSYSTEM=block
E: UDEV_LOG=3
E: USEC_INITIALIZED=3969473999
E: name=Kingston
Re: Automount NTFS/HFS+ on Dockstar Debian
April 13, 2012 06:56PM
Right! sorry about the typo, I meant udevadm. The out put of udevadm shows that ID_FS_TYPE=exfat. So that's what pmount uses in kraqh3d's udev automount rules.

How about trying both mount and pmount at the command line to verify :

pmount -t exfat /dev/sdb1 /media/mountpoint
mount -t exfat /dev/sdb1 /media/mountpoint


If they fail, then I think the exfat module is not in the system (lib/modules/x.x.x-kirwood/kernel/fs). Then try
pmount -t exfat-fuse /dev/sdb1 /media/mountpoint

if this pmount works then you can add to the udev rules so that it's automounted with exfat-fuse as file system type. Something like this:

ENV{ID_FS_TYPE}=="exfat", ENV{mode3}="exfat-fuse"
ENV{ID_FS_TYPE}!="exfat", ENV{mode3}=%E{ID_FS_TYPE}"


ACTION=="add", RUN+="/usr/bin/pmount -t %E{mode3} %E{mode} %E{mode2} --noatime --umask 000 %k %E{name}"


I don't use exfat so can't test this. But that's what I would try. Note that my add Action is slightly different from kraqh3d's original rule.
Re: Automount NTFS/HFS+ on Dockstar Debian
April 13, 2012 09:59PM
pmount gives me this

pmount -t exfat-fuse /dev/sdb1 /media/test 
Error: invalid file system name 'exfat-fuse'

pmount's man page sounds like this might not work because it doesn't support exfat. small shame since i keep some of my thumbdrives in exfat to go back and forth between windows and mac. at least it mounts my FAT32 and NTFS ones. it even mounted an HFS+ one in read only.

SUPPORTED FILESYSTEMS
       For now, pmount supports the following filesystems: udf, iso9660, vfat, ntfs, hfsplus, hfs, ext3, ext2, ext4, reis-
       erfs, reiser4, xfs, jfs and omfs.  They are tried sequentially in that exact order when the filesystem is not spec-
       ified.

       Additionally, pmount supports the filesystem types ntfs-fuse and ntfs-3g to mount NTFS  volumes  respectively  with
       ntfsmount  (1)  or  ntfs-3g (1). If the file /sbin/mount.ntfs-3g is found, then pmount will mount NTFS filestystems
       with type ntfs-3g rather than plain ntfs.  To disable this behavior, just specify -t ntfs on the  command-line,  as
       this happens only for autodetection.
Re: Automount NTFS/HFS+ on Dockstar Debian
April 14, 2012 04:21AM
In that case, you need something like

ENV{ID_FS_TYPE}=="exfat", ENV{cmd1}="/bin/mount"
ENV{ID_FS_TYPE}!="exfat", ENV{cmd1}="/usr/bin/pmount"

ENV{ID_FS_TYPE}=="exfat", ENV{fs1}="exfat-fuse"
ENV{ID_FS_TYPE}!="exfat", ENV{fs1}=%E{ID_FS_TYPE}"

ACTION=="add", RUN+="%E{cmd1} -t %E{fs1} %E{mode} --noatime --umask 000 %k %E{name}"

The idea is to substitute the variables with correct keywords in the Add rules.
Author:

Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: