fe84 [Solved] Can I mount vfat partition using non root ? - The FreeBSD Forums
The FreeBSD Forums  

Go Back   The FreeBSD Forums > Base System > General

General General questions about the FreeBSD operating system. Ask here if your question does not fit elsewhere.

Reply
 
Thread Tools Display Modes
  #1  
Old June 19th, 2010, 03:14
sw2wolf sw2wolf is offline
Member
 
Join Date: Feb 2010
Location: China
Posts: 212
Thanks: 1
Thanked 1 Time in 1 Post
Default 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!
__________________
e^(π.i) + 1 = 0
Reply With Quote
  #2  
Old June 19th, 2010, 03:28
wblock@'s Avatar
wblock@ wblock@ is offline
Moderator
 
Join Date: Sep 2009
Location: Milky Way galaxy
Posts: 7,850
Thanks: 444
Thanked 1,828 Times in 1,494 Posts
Default

It's not called vfat in FreeBSD, see msdosfs(5).
Reply With Quote
  #3  
Old June 19th, 2010, 04:58
sw2wolf sw2wolf is offline
Member
 
Join Date: Feb 2010
Location: China
Posts: 212
Thanks: 1
Thanked 1 Time in 1 Post
Default

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.
__________________
e^(π.i) + 1 = 0
Reply With Quote
  #4  
Old June 19th, 2010, 07:21
aragon aragon is offline
Giant Locked
 
Join Date: Nov 2008
Location: Cape Town, South Africa
Posts: 2,031
Thanks: 68
Thanked 253 Times in 203 Posts
Default

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.
Reply With Quote
  #5  
Old June 19th, 2010, 14:16
SirDice's Avatar
SirDice SirDice is offline
Moderator
 
Join Date: Nov 2008
Location: Rotterdam, Netherlands
Posts: 13,852
Thanks: 48
Thanked 2,061 Times in 1,890 Posts
Default

Only vfs.usermount is needed. And the user must own the mountpoint. No need to change devfs rules.
__________________
Senior UNIX Engineer at Unix Support Nederland
Experience is something you don't get until just after you need it.
Reply With Quote
  #6  
Old June 19th, 2010, 18:08
aragon aragon is offline
Giant Locked
 
Join Date: Nov 2008
Location: Cape Town, South Africa
Posts: 2,031
Thanks: 68
Thanked 253 Times in 203 Posts
Default

Quote:
Originally Posted by SirDice View Post
No need to change devfs rules.
Strange. Over here my disk dev entries default to 640 so custom devfs rules are definitely needed for user mount.
Reply With Quote
  #7  
Old June 20th, 2010, 03:35
sw2wolf sw2wolf is offline
Member
 
Join Date: Feb 2010
Location: China
Posts: 212
Thanks: 1
Thanked 1 Time in 1 Post
Default

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!
__________________
e^(π.i) + 1 = 0
Reply With Quote
  #8  
Old June 20th, 2010, 13:29
aragon aragon is offline
Giant Locked
 
Join Date: Nov 2008
Location: Cape Town, South Africa
Posts: 2,031
Thanks: 68
Thanked 253 Times in 203 Posts
Default

Quote:
Originally Posted by sw2wolf View Post
Code:
>sudo mount -a
In that case you won't need vfs.usermount enabled...
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
VFAT partition cannot display Chinese normally sw2wolf General 2 September 4th, 2010 14:55
Inconsistency in root partition size jaymax General 7 September 9th, 2009 05:06
mount ntfs windows partition ccc General 4 August 3rd, 2009 10:05
How does loader find root partition? jtl Installing & Upgrading 2 April 22nd, 2009 20:51
How to mount shared ZFS partition jwhendy General 3 January 20th, 2009 04:01


All times are GMT +1. The time now is 17:44.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.
The mark FreeBSD is a registered trademark of The FreeBSD Foundation and is used by The FreeBSD Project with the permission of The FreeBSD Foundation.
Web protection and acceleration provided by CloudFlare
0