From owner-freebsd-stable@freebsd.org Thu Jan 28 19:32:14 2016 Return-Path: Delivered-To: freebsd-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 915ABA71982 for ; Thu, 28 Jan 2016 19:32:14 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id 6E82C1C38 for ; Thu, 28 Jan 2016 19:32:14 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: by mailman.ysv.freebsd.org (Postfix) id 6DBE8A71981; Thu, 28 Jan 2016 19:32:14 +0000 (UTC) Delivered-To: stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6D4B4A71980 for ; Thu, 28 Jan 2016 19:32:14 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: from mail-wm0-x235.google.com (mail-wm0-x235.google.com [IPv6:2a00:1450:400c:c09::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 02E2D1C36 for ; Thu, 28 Jan 2016 19:32:14 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: by mail-wm0-x235.google.com with SMTP id p63so39230238wmp.1 for ; Thu, 28 Jan 2016 11:32:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:mail-followup-to :references:mime-version:content-type:content-disposition :in-reply-to:user-agent; bh=uJpUAEMc0HqaYJybAoTuMIWkbJKA2GDrwxPuPDvtuOU=; b=pJcG+9qUBPg0kPMGCKwmxSEMEVYdo01/50eLfS2zQNL+mbKN7qWR2qiGHEobTBvPSi xIErk8+AyeM0ZEbOHsykBXt0Aq3gunhE33M5p6xoX/lMjUxWCJXRYH1UbF3OwhU4aykk f797jraS/FV5A/eqs45rEuTR9OVz2p6KeNSPr/d0QxmY1NER4Auu7bDYUvrB/07ZMIpu GbIfWFtKlk2oP0lVQUgxrfpgE8fPK1y5dbEapjfxDhSZxexmhAnKiC0MeqE1dcrfcRgv DiwQsCWTTLddsBcThiwT7H+pykRvnKJ2L7jUPcyvzXlM1a20WwjNAOb7LraHbMuheYLl p9bQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-type :content-disposition:in-reply-to:user-agent; bh=uJpUAEMc0HqaYJybAoTuMIWkbJKA2GDrwxPuPDvtuOU=; b=kwYwNHr0Z/wuu3pxWg30QAUKXCsNjeUSr5EKQAsmWYPRBXCuagcQxQtV3ceEy1uc+u iFR76hmNMz2to1NRQDpxaefi+abcZ1BoCBHBsJEDotF1pOFpGqGxtxtupTpb+tynXKYN AxJrDbFEltLkU5l0LEOmzKdaMYpfmkypteYF2BzLJV+QlLC0pi6OjyX0262bEvDvkQVU tGquDvWAcSf+UUvu7bv2fKI1yj651FR8K1RxgtTOUgomaN0n5rd2wfhgjStdas1jgi2s dHwMWWvLGa3USEERcADmlqviSHr9QO81i5f+pTx7IFuK6AFk1vMWZyzzc3QuGRzqa2a7 SnTg== X-Gm-Message-State: AG10YORAB/8LWlIraWgMJH3JM2TCeBG6Zkl2tl/DYjjbwu2fJ5D69mXTIWgDRtkjeY0nvA== X-Received: by 10.194.78.175 with SMTP id c15mr4942864wjx.16.1454009531354; Thu, 28 Jan 2016 11:32:11 -0800 (PST) Received: from brick.home (aegm221.neoplus.adsl.tpnet.pl. [79.186.168.221]) by smtp.gmail.com with ESMTPSA id w80sm4230331wme.17.2016.01.28.11.32.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 Jan 2016 11:32:10 -0800 (PST) Sender: =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= Date: Thu, 28 Jan 2016 20:32:07 +0100 From: Edward Tomasz =?utf-8?Q?Napiera=C5=82a?= To: "Julian H. Stacey" Cc: Kevin Oberman , FreeBSD Stable ML Subject: Re: Auto-mounting USB NTFS formatted devices on FreeBSD 10.2 and HEAD Message-ID: <20160128193207.GA35896@brick.home> Mail-Followup-To: "Julian H. Stacey" , Kevin Oberman , FreeBSD Stable ML References: <201601251657.u0PGum6r008353@fire.js.berklix.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201601251657.u0PGum6r008353@fire.js.berklix.net> User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jan 2016 19:32:14 -0000 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.