From nobody@FreeBSD.org  Sun Oct 23 16:53:28 2005
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 88A7B16A41F
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 23 Oct 2005 16:53:28 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 45A9443D45
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 23 Oct 2005 16:53:28 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.13.1/8.13.1) with ESMTP id j9NGrRJm088473
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 23 Oct 2005 16:53:27 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id j9NGrRTJ088472;
	Sun, 23 Oct 2005 16:53:27 GMT
	(envelope-from nobody)
Message-Id: <200510231653.j9NGrRTJ088472@www.freebsd.org>
Date: Sun, 23 Oct 2005 16:53:27 GMT
From: Andrew Jema <jema@sendmail.ru>
To: freebsd-gnats-submit@FreeBSD.org
Subject: non-root mount operation fails
X-Send-Pr-Version: www-2.3

>Number:         87877
>Category:       i386
>Synopsis:       non-root mount operation fails
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-i386
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Oct 23 17:00:29 GMT 2005
>Closed-Date:    Fri Apr 14 15:07:05 GMT 2006
>Last-Modified:  Fri Apr 14 15:07:05 GMT 2006
>Originator:     Andrew Jema
>Release:        7.0-CURRENT
>Organization:
OT
>Environment:
FreeBSD jema 7.0-CURRENT FreeBSD 7.0-CURRENT #36: Tue Oct 11 16:21:12 MSD 2005     root@jema:/usr/obj/usr/src/sys/jema  i386
>Description:
sysctled parameter vfs.usermount=1 doesn't permit user mount at all. under root it works fine.

>How-To-Repeat:
set the kernel parameter vfs.usermount=1 ant try to mount any slice or msdos/ntfs partition under any user
jema@jema$ mount_ntfs /dev/ad0s2 /mnt
mount_ntfs: /dev/ad0s2: Operation not permitted

>Fix:
unknown
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: maxim 
State-Changed-When: Fri Apr 14 14:47:49 UTC 2006 
State-Changed-Why:  
Non-root mount works OK on several desktop system I have.  Please 
ask questions in the appropriate maillists. 

Basically you need (this is actually FAQ http://tinyurl.com/ns9p7): 

1. As root load all filesystem specific kernel code (compiled in 
the kernel, loaded as module at startup etc). 

2. Put vfs.usermount=1 in /etc/sysctl.conf. 

3. Make sure you are an owner of the mount point. 

4. Make sure you have an approriate permissions for the device you mount. 

E.g. for iPod partition I have: 

/boot/loader.conf 
... 
msdosfs_load="YES" 
/etc/sysctl.conf 
... 
vfs.usermount=1 
/etc/fstab: 
... 
/dev/da0s2 /ipod msdos rw,noauto 0 0 
/etc/devfs.rules 
... 
add path da0s* mode 660 
add path da0s* user maxim 
$ ls -ld /ipod 
drwxr-xr-x  3 maxim  wheel  512 Apr  1 17:52 /ipod 

http://www.freebsd.org/cgi/query-pr.cgi?pr=87877 
>Unformatted:
