Can I mount vfat partition using non root ?

In linux, i using the following options to mount a VFAT partition.
Code:
%cat /etc/fstab|grep vfat
/dev/sda7	/media/F	vfat	 rw,defaults,utf8,uid=1000,gid=1000,dmask=022,fmask=133		0	0

It seems i can not use the same options in FreeBSD.

Sincerely!
 
Yes, you are right.
Code:
>cat /etc/fstab|grep -i msdos
/dev/ad4s7		/media/F	msdosfs	rw		0	0

>ls -l /media/F
-rwxr-xr-x  1 root  wheel   44738560  1 20 11:21 8.0-RELEASE-i386-bootonly.iso*
drwxr-xr-x  1 root  wheel      16384  3 31  2008 Recycled/
drwxr-xr-x  1 root  wheel      16384  6 15  2008 System Volume Information/
-rwxr-xr-x  1 root  wheel  229402624  6 27  2008 WinXp.iso*

In freebsd /media/F belongs to root.
 
In /etc/sysctl.conf

Code:
vfs.usermount=1

In /etc/devfs.rules:

Code:
[localrules=10]
 add path ad* mode 0660 group operator

In /etc/rc.conf:

Code:
devfs_system_ruleset="localrules"

Then run:

Code:
chown uid:gid /media/F
/etc/rc.d/sysctl restart
/etc/rc.d/devfs restart

Make sure your user account is a member of the "operator" group.
 
Only vfs.usermount is needed. And the user must own the mountpoint. No need to change devfs rules.
 
It works without changing devfs rules.

Code:
>sysctl -a | grep -i usermount
vfs.usermount: 1

>ls -ld /media/F
drwxr-xr-x  1 sw2wolf  wheel  16384 12 31  1979 /media/F/

>cat /etc/fstab |grep -i msdos
/dev/ad4s7		/media/F	msdosfs	rw		0	0

>sudo mount -a
>>ls -l /media/F
-rwxr-xr-x  1 sw2wolf  wheel   44738560  1 20 11:21 8.0-RELEASE-i386-bootonly.iso*
drwxr-xr-x  1 sw2wolf  wheel      16384  3 31  2008 Recycled/
drwxr-xr-x  1 sw2wolf  wheel      16384  6 15  2008 System Volume Information/
-rwxr-xr-x  1 sw2wolf  wheel  229402624  6 27  2008 WinXp.iso*
......

thanks!
 
Back
Top