Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 11-09-2008, 11:46 AM   #1
LQ Newbie
Registered: Nov 2008
Posts: 10

Rep: Reputation: 0
File permissions on mounted FAT drive

Hi, I'm running Debian on a Linksys NSLU2. All working great except I can't seem to get write permissions for anyone other than root on my second USB drive, which is FAT. The hardware is mounting fine and root can read and write.

The entry in fstab is this:
/dev/sdb1 /media/usb500 auto rw,users,auto 0 0

When the device is NOT mounted, the perms are as follows:
drwxrwxrwx 2 darren root 4096 Nov 5 23:32 usb500

As soon as it's mounted, they change to this:
drwxr-xr-x 11 root root 32768 Jan 1 1970 usb500

I think I understand why the perms defaut back to this (system is making assumptions in the absence of file data on the FAT drive?), but I can't figure out how to get those all-important w's back.

Attempting to chmod after mounting has no effect on the usb500 directory and throws errors on everything inside.

I've tried changing auto to vfat in fstab and that didn't help. I've also attempted to mount manually using -0 gid=darren, and that almost works in that the owner remains darren, but it still doesn't give me the write perms I need.

If anyone can help me I'd be very grateful.

Old 11-09-2008, 12:11 PM   #2
LQ Guru
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Hi -

Look here:

You can't change the ownership of files or folders on a FAT drive because FAT doesn't store ownership attributes. The ownership of everything on the drive is emulated, and is set by the way it is mounted. So you need to fix up the way the drive gets mounted when it is first plugged in.

A quick experiment shows that the drive gets automounted as being owned by the owner of the desktop when it's plugged in. I can't try to see what happens when no-one is logged in without losing this post I'm halfway through. Anyway, I think you need to unmount the drive and re-mount it by hand. Like this (in my tests, my USB stick was /dev/sdc1 - use the command mount to see where it's currently mounted and what device it is:
steve@StevesPC:~$ mount
----- all my other mount points deldted for clarity -------
/dev/sdc1 on /media/UDISK 2.0 type vfat (rw,nosuid,nodev,quiet,shortname=mixed,uid=1000,gid=1000,umask=077,iocharset=utf
steve@StevesPC:~$ sudo umount /dev/sdc1
steve@StevesPC:~$ sudo mount -o umask=0 /dev/sdc1 /media/UDISK\ 2.0/
Note that if the media is writable, then you should be able to set write permissions. You should also be able to set write permissions for whatever user you prefer.

Last edited by paulsm4; 11-09-2008 at 12:15 PM.
Old 11-09-2008, 01:03 PM   #3
LQ Newbie
Registered: Nov 2008
Posts: 10

Original Poster
Rep: Reputation: 0
No that didn't get it. Tried a umount followed by a manual mount with -o umask=0. it mounted ok but the write permission is still missing.
Old 11-09-2008, 03:27 PM   #4
LQ Guru
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Hi -

You're either missing something in the "mount" command, or Debian doesn't recognize it as a "read-write" device. A couple of suggestions:

1. Forget about fstab and focus on "mount" (at least for debugging)

2. Focus on "vfat" filesystem type (at least for debugging)

3. Check output from "lsusb" and /proc/usb/NNN

4. Check for errors/diagnostic info in the system logs, e.g.
dmesg | less
less /var/log/syslog

Here are another couple of links that might help:
Old 11-09-2008, 05:24 PM   #5
Gentoo support team
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,074

Rep: Reputation: 386Reputation: 386Reputation: 386Reputation: 386
The vfat umask option should really work. As someone said above, vfat doesn't store the linux permissions info because it simply lacks the support to do so.

Mount it and double check the output of "mount" without arguments to see that all the options have been applied correctly. We assume that the drive has not some kind of physical write protection mechanism, that can be easily checked using root and trying a write.
Old 11-10-2008, 02:20 AM   #6
LQ Newbie
Registered: Nov 2008
Posts: 10

Original Poster
Rep: Reputation: 0
Thanks for all your suggestions. I've got to get to work now but I'll try again this evening.
(in the meantime I'm seriously considering a re-format to ext3 and am copying data off in preparation!)
Old 11-10-2008, 05:54 AM   #7
Registered: Oct 2008
Posts: 100

Rep: Reputation: 15
FAT file systems do not have UNIX-style permissions. If your device is mounted correctly in a way that every user has read-write access, then any user will be able to read-write.

The fact that only root can write to the device means that your way of mounting is faulty.

Check the /etc/fstab file to see the current settings.

If you do mount by hand as root, then explicitly give an option to give write permission to anyone. Otherwise only root can write.

Last edited by Tinkster; 10-30-2010 at 05:17 PM.
Old 11-10-2008, 09:03 AM   #8
LQ Guru
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 8,455
Blog Entries: 4

Rep: Reputation: 2918Reputation: 2918Reputation: 2918Reputation: 2918Reputation: 2918Reputation: 2918Reputation: 2918Reputation: 2918Reputation: 2918Reputation: 2918Reputation: 2918
It's worth mentioning that FAT really isn't suitable for Windows anymore, either!

Why not re-format the drive to a more suitable format... one that does recognize permissions. It may take a little digging, but both Windows and Linux support the idea of "installable file systems" and they both support quite a few.

Realistically, most shared-storage these days is network attached anyway. They are specialized devices that consist of storage controllers, network interfaces and lots of disk-drives. And they're cheap. Apple sells one (and it looks "way cool!") but they didn't really plow any new ground to do it.
Old 11-10-2008, 03:54 PM   #9
LQ Newbie
Registered: Nov 2008
Posts: 10

Original Poster
Rep: Reputation: 0
Well, that one is going to have to remain a mystery. I've been through every link posted, every combination of mount commands I could think of, and I still could only get write permissions as root.

So I now have a shiny new ext3 file system that's sharing everything with correct permissions via Samba.

I could go off Windows you know...

thanks for the help anyway.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Creation of symbolic link not permitted in fat mounted drive stelmed Slackware 11 02-19-2012 01:18 AM
Problem with file permissions on mounted fat drives kizersouzay Linux - Newbie 1 07-08-2006 10:34 AM
permissions on FAT drive Trio3b Mandriva 1 12-08-2005 04:30 PM
cant modify a file on mounted FAT partition dwarf007 Linux - Newbie 7 09-24-2004 08:02 AM
fat drive permissions problem llimllib Linux - General 2 07-18-2003 07:51 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:04 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration