From owner-freebsd-stable@freebsd.org Mon Jan 25 20:10:26 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 93758A45270 for ; Mon, 25 Jan 2016 20:10:26 +0000 (UTC) (envelope-from kob6558@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 5D704EC8 for ; Mon, 25 Jan 2016 20:10:26 +0000 (UTC) (envelope-from kob6558@gmail.com) Received: by mailman.ysv.freebsd.org (Postfix) id 52D5BA4526E; Mon, 25 Jan 2016 20:10:26 +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 4FA00A4526C for ; Mon, 25 Jan 2016 20:10:26 +0000 (UTC) (envelope-from kob6558@gmail.com) Received: from mail-oi0-x22a.google.com (mail-oi0-x22a.google.com [IPv6:2607:f8b0:4003:c06::22a]) (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 E62B2E91; Mon, 25 Jan 2016 20:10:25 +0000 (UTC) (envelope-from kob6558@gmail.com) Received: by mail-oi0-x22a.google.com with SMTP id w75so94700446oie.0; Mon, 25 Jan 2016 12:10:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=c4XOoFvWEwEBzXzKRFecU1pFAsleiO44lzD6hirIPWw=; b=FA2M/YhiEZ1Ftm6mXjVlEcBLsuMdmd3tVluT7XWfbQa7YnAsDmw4UTmpkfLrK0vT3M qPRALIIY73ILtDjoKMGaIBV2LTSlVarAMd/8GOWQccvrZDuEIdkqm0Go81wm9mcTBQQ7 dIYkCYcShYkL1y7nv35LZvDw+hymiuGd4ker8MC7OJZvvBflfK5rwqz211DMqVgzvHy2 KXKXPPX1Bpjxxf5J5TuODKBD4GOlwTSVeQR4NQNoVn1ffLjD0fXlrDODiiyNAC/eK1K2 85TcxsRf77Gg1IvbReQWFXgPCZ5msghrudvODIFCLScSTenS8PEHgDa5uUXYpgrOTuN0 cy+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=c4XOoFvWEwEBzXzKRFecU1pFAsleiO44lzD6hirIPWw=; b=DTND9gDfeL1ha7Aig77kneZ1O9ZM93XMkIqnsrhgaZ/ZXcVgeE3qRgq8C4a4GKBIer /dwmZD9Y+vfjFvXqj6TYCuVvbFkx2WM5X3b4orTeRO+24AYX+sUtbr+6qRUygKvnPuEl F5A7I59ZRyW89wMgLu+qxhEVy5UriivJxMDWfpxyXISeMP/UDkRK2uQ70C+EOWF0niCl SMHvD3rnFf0Aj3fUTTmUzTSRfQjE3BUaNub7m3m8bNwI2FZ7ggsXy12TqRqblbXKE9m3 qGWACHGLbx767hY4CjtmVcssOj25goQuPPZ9v3TP6nIjIssV6RBmJ3uNj+jbs6e2Eom4 CEtQ== X-Gm-Message-State: AG10YORsTporbjc/YkVfgBWbyhvSNuDyRIh+1d4iCoI9k1EmYDE7nFBj3z4P26JKiBp6ZhxXLDBLji9XAucWKQ== MIME-Version: 1.0 X-Received: by 10.202.79.4 with SMTP id d4mr14075604oib.121.1453752625176; Mon, 25 Jan 2016 12:10:25 -0800 (PST) Sender: kob6558@gmail.com Received: by 10.202.89.130 with HTTP; Mon, 25 Jan 2016 12:10:25 -0800 (PST) In-Reply-To: <20160125073722.GL18976@e-new.0x20.net> References: <20160125073722.GL18976@e-new.0x20.net> Date: Mon, 25 Jan 2016 12:10:25 -0800 X-Google-Sender-Auth: DKN60BssecKX8G2V-gqrmrvPtdQ Message-ID: Subject: Re: Auto-mounting USB NTFS formatted devices on FreeBSD 10.2 and HEAD From: Kevin Oberman To: Lars Engels Cc: FreeBSD Stable ML , =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 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: Mon, 25 Jan 2016 20:10:26 -0000 Thanks, all! Especially to Lars and Edward Tomasz who actually understood my request (which was probably less clear than it should have been) and provided the exact incantation required! Kevin Oberman, Part time kid herder and retired Network Engineer E-mail: rkoberman@gmail.com PGP Fingerprint: D03FB98AFA78E3B78C1694B318AB39EF1B055683 On Sun, Jan 24, 2016 at 11:37 PM, Lars Engels wrote: > On Sun, Jan 24, 2016 at 04:50:13PM -0800, 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. > > It's pretty easy: > > > - Install fusefs-ntfs > - Enable autofs: > # sysrc autofs_enable=YES > # sysrc autounmountd_flags="-t 10" # unmount after 10s of inactivity > - Make sure to add this to /etc/auto_master: > /media -media -nosuid > - Then you need this little patch for /etc/autofs/special_master: > > --- special_media.bak 2016-01-19 11:00:55.766975000 +0100 > +++ special_media 2016-01-20 11:29:56.205575000 +0100 > @@ -59,7 +59,16 @@ > continue > fi > > - echo "-fstype=${_fstype},nosuid :/dev/${_p}" > + if [ ${_fstype} = "ntfs" ]; then > + if [ -f "/usr/local/bin/ntfs-3g" ]; then > + echo > "-mountprog=/usr/local/bin/ntfs-3g,fstype=${_fstype},nosuid > :/dev/${_p}" > + else > + /usr/bin/logger -p info \ > + "Cannot mount ${_fstype} formatted > device /dev/${_p}: Install sysutils/fusefs-ntfs first" > + fi > + else > + echo "-fstype=${_fstype},nosuid :/dev/${_p}" > + fi > done > > # No matching device - don't print anything, autofs will handle it. > > - Start auto$foo: > # service automountd start > # service automounter start > # service automountd start > > - Insert the NTFS device > - Look for a new directory in /media > - Access it > > It's working for me on HEAD, but I guess you should be also successful on > STABLE > > > -- > Lars >