Linux - NewbieThis 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!
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
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.
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:
----- 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.
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.
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.