LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 11-09-2008, 12:46 PM   #1
dp_miller
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.

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

Rep: Reputation: Disabled
Hi -

Look here:
http://ubuntuforums.org/showthread.php?t=402813

Quote:
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:
Quote:
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 01:15 PM.
 
Old 11-09-2008, 02:03 PM   #3
dp_miller
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, 04:27 PM   #4
paulsm4
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
http://linux.die.net/man/8/lsusb

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

Here are another couple of links that might help:
http://ubuntuforums.org/showthread.php?t=803881
http://www.mepis.org/node/2105
 
Old 11-09-2008, 06:24 PM   #5
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,063

Rep: Reputation: 381Reputation: 381Reputation: 381Reputation: 381
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, 03:20 AM   #6
dp_miller
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, 06:54 AM   #7
salter
Member
 
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 06:17 PM.
 
Old 11-10-2008, 10:03 AM   #8
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 7,183

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
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, 04:54 PM   #9
dp_miller
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.
 
  


Reply


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 02:18 AM
Problem with file permissions on mounted fat drives kizersouzay Linux - Newbie 1 07-08-2006 11:34 AM
permissions on FAT drive Trio3b Mandriva 1 12-08-2005 05:30 PM
cant modify a file on mounted FAT partition dwarf007 Linux - Newbie 7 09-24-2004 09:02 AM
fat drive permissions problem llimllib Linux - General 2 07-18-2003 08:51 PM


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

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