From owner-freebsd-stable@freebsd.org Mon Jan 25 15:11:20 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 E8AB7A456C0 for ; Mon, 25 Jan 2016 15:11:20 +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 C688B640 for ; Mon, 25 Jan 2016 15:11:20 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: by mailman.ysv.freebsd.org (Postfix) id C3AFBA456BF; Mon, 25 Jan 2016 15:11:20 +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 A9661A456BE for ; Mon, 25 Jan 2016 15:11:20 +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 4FE2B63F for ; Mon, 25 Jan 2016 15:11:20 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: by mail-wm0-x235.google.com with SMTP id n5so84798971wmn.0 for ; Mon, 25 Jan 2016 07:11:20 -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=oZtUy8U291NwDvgh7ClbaHFCz+vnFprK5ov7iAf0kZU=; b=0zaIx6hEFCDQB7HTS4bqtk7NfQwGeWRkM+1ha8+GGd3qBxV4lMK3wmBmRg6jXmM66z 83SUejX1yKyYq4Rf9DHYiWNmxW0spj4g8pmF0vEOh3YbuB1lQSccSzVVByi68PFSxT09 uCiQAzsvwgHPgVXaNXW+a8/hJqC6iGCFMTlGyCdNoJ2Z0A9ndF1QSRYaEfoj7u7efDux cS0p7JhsiCEmLjGthrUiA8sdiuDXA3Z1l0kseOgHmj3iwSN1ioiERrqBjpDxJOFlMwPo e8+qY/I1uLu9MCHqv0k02sW1/PyosjevY8wVHNa+3S2FxyXlezxB9IEEsZoFMs1uOUq4 hqtA== 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=oZtUy8U291NwDvgh7ClbaHFCz+vnFprK5ov7iAf0kZU=; b=eUWxmo/51WbqwN1/pEmmstLmbD2CqQUTuXkfBXa0HEq51QQCZLU0c3LD2IWXeY8EWt gRvbnrVF+E7WTzyi/iU7EPEODv4kn1I/zszHEQ4+XgQJ9P81Ui2U3VnoAGOCsTTlF7nD Qz3BRNz1hhfBTbgkp/hAxZZNJndMnJTvEDRRJyF7Pa9MQ7iq/wYPiQ669yZmY01wO7pA yp2m8SXkB2xHq4iXeQ/gVOWXqABdo20MDU42d5s25BfACKOcIE6bcrp9wbeL8j4rkvfr XJXFSb4RYHj7y0B0ZSY2p7TPESczuhtP/N1izy4sDRQiEQLM/O3UnM6+N6/R1VimOccp NCTQ== X-Gm-Message-State: AG10YOSLo9/ylPQuk2wjhvYbi7QgGMlzjBDT4ytBAQfIlzWviiineA04DtpV/ELEipcV1g== X-Received: by 10.194.87.201 with SMTP id ba9mr17676982wjb.128.1453734678696; Mon, 25 Jan 2016 07:11:18 -0800 (PST) Received: from brick.home (acyt121.neoplus.adsl.tpnet.pl. [83.11.203.121]) by smtp.gmail.com with ESMTPSA id t9sm19604294wjf.33.2016.01.25.07.11.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Jan 2016 07:11:17 -0800 (PST) Sender: =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= Date: Mon, 25 Jan 2016 16:11:14 +0100 From: Edward Tomasz =?utf-8?Q?Napiera=C5=82a?= To: Kevin Oberman Cc: FreeBSD Stable ML Subject: Re: Auto-mounting USB NTFS formatted devices on FreeBSD 10.2 and HEAD Message-ID: <20160125151114.GA2516@brick.home> Mail-Followup-To: Kevin Oberman , FreeBSD Stable ML References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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: Mon, 25 Jan 2016 15:11:21 -0000 On 0124T1650, 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. Try to apply the following diff in /etc/autofs/: Index: special_media =================================================================== --- special_media (revision 294670) +++ special_media (working copy) @@ -35,7 +35,11 @@ print_one() { _fstype="$(fstyp "/dev/${_key}" 2> /dev/null)" if [ $? -eq 0 ]; then - echo "-fstype=${_fstype},nosuid :/dev/${_key}" + if [ ${_fstype} = "ntfs" ]; then + echo "-fstype=${_fstype},nosuid,mountprog=/usr/local/bin/ntfs-3g :/dev/${_key}" + else + echo "-fstype=${_fstype},nosuid :/dev/${_key}" + fi return fi @@ -59,7 +63,11 @@ print_one() { continue fi - echo "-fstype=${_fstype},nosuid :/dev/${_p}" + if [ ${_fstype} = "ntfs" ]; then + echo "-fstype=${_fstype},nosuid,mountprog=/usr/local/bin/ntfs-3g :/dev/${_p}" + else + echo "-fstype=${_fstype},nosuid :/dev/${_p}" + fi done # No matching device - don't print anything, autofs will handle it.