Date: Thu, 28 Jan 2016 20:32:07 +0100 From: Edward Tomasz =?utf-8?Q?Napiera=C5=82a?= <trasz@freebsd.org> To: "Julian H. Stacey" <jhs@berklix.com> Cc: Kevin Oberman <rkoberman@gmail.com>, FreeBSD Stable ML <stable@freebsd.org> Subject: Re: Auto-mounting USB NTFS formatted devices on FreeBSD 10.2 and HEAD Message-ID: <20160128193207.GA35896@brick.home> In-Reply-To: <201601251657.u0PGum6r008353@fire.js.berklix.net> References: <CAN6yY1vS9e9NKQm0ezQVtcHxuSZjCz7XyuK2XeRGU8xneJ0=KQ@mail.gmail.com> <201601251657.u0PGum6r008353@fire.js.berklix.net>
next in thread | previous in thread | raw e-mail | index | archive | help
On 0125T1756, Julian H. Stacey wrote: > Kevin Oberman wrote: > > Since the removal of NTFS support, it is unclear how to get USB drives > > formatted as NTFS (or ExFAT) to automatically mount. Prior to FreeBSD 10 it > > was possible to replace /sbin/mount_ntfs with a script that would generate > > appropriate options and exec /usr/local/sbin/ntfs-3g and let HAL fire up > > mount_ntfs, but that no longer works as mount_ntfs is no longer used and > > mount(8) no longer treats '-t ntfs' as special. > > > > It would appear that automount(8) would be the right magic, but it's not > > obvious to me how to configure it to recognize that an NTFS device has been > > connected to a USB port (as opposed to msdosfs) and to use ntfs-3g to do > > the actual mount. I assume that the same issue exists for ExFAT. > > > > Does anyone have an idea of what magic is required in the auto_master or > > elsewhere to make this work in conjunction with devd? I'd really like to > > avid using hald, if possible. > > I use devd to auto mount USB NTFS, I just it works with 10.2-RELEASE > & an NTFS USB connected drive, here's a chunk from my > > http://www.berklix.com/~jhs/src/bsd/fixes/FreeBSD/src/jhs/etc/devd/berklix.conf > > action "sleep 10; \ > rm -f /devusb/acer300; \ > ln -s /dev/`echo $device-name|sed -e s/umass/da/`s1 \ > /devusb/acer300.1; \ > ln -s /dev/`echo $device-name|sed -e s/umass/da/`s2 \ > /devusb/acer300.2; \ > ln -s /dev/`echo $device-name|sed -e s/umass/da/`s3 \ > /devusb/acer300.3; \ > mkdir -p /media/acer300.2; mkdir -p /media/acer300.3; \ > chmod 777 /media/acer300.*; \ > chown jhs:staff /media/acer300.*; \ > ntfsfix /devusb/acer300.2 ; \ > ntfs-3g -o ro /devusb/acer300.2 /media/acer300.2; \ > ntfsfix /devusb/acer300.3 ; \ > ntfs-3g -o ro /devusb/acer300.3 /media/acer300.3" ; > > Now I'll read man 8 automount & other people's alternate solutions > on the thread :-) Leaving aside the autofs as such, you might want to take a look at the /etc/autofs/special_media shell script. It contains code to obtain a list of devices available for mounting, which works with all kinds of devices, without any special cases, and properly handles problems like "should I mount the whole device, like da0, or is it partitioned and I should attempt to mount partitions instead, like da0p1". You can just run it by hand and see what output it produces.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20160128193207.GA35896>