LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
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 07-24-2008, 07:48 AM   #1
Virtual Circuit
Member
 
Registered: Feb 2008
Distribution: Slackware
Posts: 66

Rep: Reputation: 15
File System permissions


I spent a hour trying to save a file from the web. I kept getting permission errors. So I opened a console window as root. I tried to change permissions with 'chmod' to a+rwx' ; no warning or error messages and the write (w) permission to group(g) and all(a) were not affected. The user and group were 'root', so I decided to change that too. Again no success.
Then it occurred to me that the entire partion might be write protected. so I looked at my
Code:
root@VirtualCircuit:~# cat /etc/fstab
/dev/sda8        swap             swap        defaults         0   0
/dev/sda6        /                ext3        defaults         1   1
/dev/sda5        /mnt/win         vfat        defaults         1   0
#/dev/cdrom      /mnt/cdrom       auto        noauto,owner,ro  0   0
/dev/fd0         /mnt/floppy      auto        noauto,owner     0   0
devpts           /dev/pts         devpts      gid=5,mode=620   0   0
proc             /proc            proc        defaults         0   0
root@VirtualCircuit:~#
note /mnt/win is the problem. i checked the man for fstab and the slack book, they says to use 'defauts' not ro, and that is how it is setup, so why is this not working.

By the way, I logged out of KDE and back in as root, and no problemo.
 
Old 07-24-2008, 08:26 AM   #2
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Debian sid + kde 3.5 & 4.4
Posts: 6,823

Rep: Reputation: 1958Reputation: 1958Reputation: 1958Reputation: 1958Reputation: 1958Reputation: 1958Reputation: 1958Reputation: 1958Reputation: 1958Reputation: 1958Reputation: 1958
The FAT filesystem cannot support *nix-style permissions, so no amount of chmodding or chowning will ever do you any good on a FAT partition. The permissions must be simulated at mount time, and can be changed with the umask, uid, and gid mount options.

When you use "defaults", the permissions and ownership are set for root, which is why it works when you are logged in as root. So instead of using "defaults", set uid=username, gid=groupname, and umask to equal the inverse of the permissions you want (e.g. umask=000 gives the drive full 777 permissions).

Last edited by David the H.; 07-24-2008 at 08:37 AM.
 
Old 07-25-2008, 04:11 AM   #3
Virtual Circuit
Member
 
Registered: Feb 2008
Distribution: Slackware
Posts: 66

Original Poster
Rep: Reputation: 15
/etc/fstab

I've read a few similar posts, I just have 2 more questions.
(1) why can't I change some permissions and not others on vfat?
(2) please tell me how to modify my fstab file?

Quote:
You can't use the 'chmod' command on a mounted vfat partition. You need to use the umask= option instead. As an alternative, you can use the fmask= and dmask= options to give different permissions for files and directories. You probably don't want files on this drive to be executable, so you could mask out the 'x' execution bit using fmask. However, the 'x' bit serves a different function for directories, so you would want it set.

Read through the 'man mount' man-page for all of the gory details!

There are other options you can use. For example, instead of the users option you can use 'uid=' and 'gid=' option. So if your username is 'guy24x' you could have 'uid=guy24x' as one of the options. This will make you the owner of the partition, and give you full access. If there is a 'guy24x' group also, you could use 'gid=guy24x'.

so I replace 'defaults' with 'umask 000'
 
Old 07-25-2008, 07:33 AM   #4
FranDango
Member
 
Registered: Jun 2008
Posts: 101

Rep: Reputation: 15
(1) Windows VFAT file systems have different attributes stored for files. No UNIX-style users and groups, though it is possible to make a distinction between read-only and write-enabled.

(2) You can modify the fstab file with any editor that you like, but you must have root privileges to do that. Other than that, your settings for /mnt/win are OK - the problem has nothing to do with mounting, but with the the mounted filesystem.

Linux Archive

Last edited by FranDango; 09-20-2008 at 07:16 AM.
 
Old 11-18-2008, 10:33 AM   #5
IsharaComix
Member
 
Registered: Sep 2008
Location: Raleigh
Distribution: Ubuntu 8.10
Posts: 88
Blog Entries: 1

Rep: Reputation: 15
So this is why...

Sorry to revive an old post like this, but I've got a couple of related questions:

1.) Does NTFS not support Unix-style permissions either (just out of curiosity)?

2.) When I extract files from a tar archive, the file permissions are preserved, even when the tar is saved on another file system. Would this hold true in all cases?
 
Old 11-18-2008, 11:25 AM   #6
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,063

Rep: Reputation: 381Reputation: 381Reputation: 381Reputation: 381
Quote:
Originally Posted by IsharaComix View Post
Sorry to revive an old post like this, but I've got a couple of related questions:

1.) Does NTFS not support Unix-style permissions either (just out of curiosity)?
At low levels, linux file systems and ntfs has nothing to do with each other, and there's no exact match for everything. However, at driver level it's possible to approximate the behavior of both to a certain degree. How deep that approximation goes is something that I never bothered to research. It ultimately depends on the driver. If you use ntfs-3g you might find this useful:

http://pagesperso-orange.fr/b.andre/permissions.html

If you use the in-kernel driver you don't have to bother because the write support is "limited" (non-existant if you ask me). Still anything that you need to know should be described on the relevant docs under the Documents subdirectory in your kernel source dir.

Quote:
2.) When I extract files from a tar archive, the file permissions are preserved, even when the tar is saved on another file system. Would this hold true in all cases?
Permissions are stored inside the tarball when you create it. Whether these will be restored when uncompressing depend on two things: the usage (or not) of -p (preserve) and the support of the file system (or better said, the implementation of your concrete driver) to do something useful with that metainfo.

If your fs driver doesn't understand the permissions, then they are ignored.
 
  


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
Permissions problem on different file system locust100473 Linux - Newbie 4 05-22-2007 05:15 PM
permissions on ntfs file system mikeotieno Linux - Newbie 7 06-24-2006 10:48 AM
how to restore the default file permissions (whole system) ? bbbb Linux - General 2 11-05-2005 05:10 AM
file system permissions problem guy24x Linux - Security 8 04-07-2005 07:09 PM
Problems with system-wide file permissions hexadevil Linux - Newbie 2 05-30-2004 08:54 AM


All times are GMT -5. The time now is 07:47 AM.

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