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 12-31-2003, 01:52 PM   #1
redkazan
Member
 
Registered: Dec 2003
Location: Maine, US
Distribution: Slack 9.1
Posts: 55

Rep: Reputation: 15
Setting perms for a newly mounted partition?


Hi All:

I've just recently installed Fedora Core 1 on my brand new laptop (it's dual-booted with XP Pro SP1 and FC1). I haven't booted into XP since installing Fedora . However, I'm having a problem getting write access to a FAT32 partition that I just mounted. It mounts without a problem:

Filesystem 1K-blocks Used Available Use% Mounted on
/dev/hda5 10080488 2569548 6998872 27% /
none 257052 0 257052 0% /dev/shm
/dev/hda6 27867136 144 27866992 1% /media

Oh, PS: does anybody know what the 'none' is there? Odd.

At any rate, I can access the partition fine, and even write to it as root, but when I try to change the permissions, I get an error message:

chmod: changing permissions of `/media' (requested: 0777, actual: 0755): Operation not permitted

(It repeats that for every file in the directory)

I want to use this as an all-purpose partition to store backups of programs, mp3s, pictures, etc, so that I can freely format the Linux and XP partitions without worry of losing anything valuable. Thus, I was just going to give everybody access to it (chmod -R a+rwx, right?).

Can anybody help me out? I'm a Linux n00b, but slowly learning, so be gentle.

rk

PS ahh, shoot, right after posting I stumbled on a few threads that deal with the same subject. Sorry for spamming. However, if you can offer any succinct advice, please feel free .

Last edited by redkazan; 12-31-2003 at 01:57 PM.
 
Old 12-31-2003, 02:06 PM   #2
aaa
LQ Guru
 
Registered: Jul 2003
Location: VA
Distribution: Slack 10.1
Posts: 2,194

Rep: Reputation: 46
Well, you probably already saw the other threads with the umask stuff in them for the FAT permmissions.
Quote:
Oh, PS: does anybody know what the 'none' is there? Odd.
'shm' is a virtual filesystem with no device, hence the 'none'. You'll get that for the proc and sys filesystems too.
 
Old 12-31-2003, 02:20 PM   #3
redkazan
Member
 
Registered: Dec 2003
Location: Maine, US
Distribution: Slack 9.1
Posts: 55

Original Poster
Rep: Reputation: 15
Hmmm

aaa -

Thanks for the quick response. I did indeed read about umask. However, if you're bored, would you mind explaining just what those three digits represent (000 in this case, right?). Are they octals? If so, how do they relate to file permissions?

Thanks!

rk

EDIT: I wrote the following line into my fstab file:

/dev/hda6 /media vfat defaults 0000

However, when I reboot, the permissions for /media are still the same (drwxr-xr-x). What am I doing wrong?

Last edited by redkazan; 12-31-2003 at 02:54 PM.
 
Old 12-31-2003, 02:59 PM   #4
aaa
LQ Guru
 
Registered: Jul 2003
Location: VA
Distribution: Slack 10.1
Posts: 2,194

Rep: Reputation: 46
They are octal (it could be 0000). They work opposite of the way they work in chmod:
chmod 777 is the same as umask=000
So if wanted to do the equivalent of 'chmod 755' (rwxrw-rw-), it would be 'umask=022'. The chmod numbers work like this:
r+w+x r+w+x r+w+x
4+2+1 4+2+1 4+2+1
__7__ __7__ __7__
777
rw-rw-rw would be 666 (4+2+0 4+2+0 4+2+0)
Umask is the oppostie: rwxrwxrwx would be 000, rw-rw-rw would be 111.
 
Old 12-31-2003, 03:15 PM   #5
Mathieu
Senior Member
 
Registered: Feb 2001
Location: Montreal, Quebec, Canada
Distribution: RedHat, Fedora, CentOS, SUSE
Posts: 1,403

Rep: Reputation: 46
If you want all users to have read, write and execute on a non-Linux file system (in this case, FAT32),
you will need to use the umask (permissions), uid (owner) and gid (group) options.
In the /etc/fstab file:
Code:
/dev/hda6            /media           vfat       defaults,users,uid=owner,gid=users,umask=0111,nls=iso8859-1   0 0
Also, you do not need to reboot your computer in order to apply the changes.
For example, to mount the partiton:
Code:
mount -t vfat -o defaults,users,uid=owner,gid=users,umask=0111 /dev/hda6 /media
To un-mount the partition:
Code:
umount /media
Since you are using a FAT32 partition, instead of umask, you can use dmask (directory permissions) and fmask (file permissions).
 
Old 12-31-2003, 03:44 PM   #6
redkazan
Member
 
Registered: Dec 2003
Location: Maine, US
Distribution: Slack 9.1
Posts: 55

Original Poster
Rep: Reputation: 15
Gah

Thanks for the explanation of octal aaa. I think I pretty much get it.

Mathieu:

I tried to mount the filesystem using your code (in a terminal, as root), and it gave me the following message:

mount: wrong fs type, bad option, bad superblock on /dev/hda6,
or too many mounted file systems

Any ideas? I typed in the code exactly as you laid it out.

Also, can I have some explanation as to what each piece of the code means? /dev/hda6 is pointing to the device node, /media assigns a directory for the mount point, -t vfat is the filesystem, but what does -o mean? I understand uid and gid, but I don't understand defaults, users, or, in the case of the fstab entry, nls=iso8859-1 0 0.

Heh, I realize that's a good bundle of questions, so if you just wanna concentrate on fixing the problem I understand .

Thanks,

rk

edit: Oh, sorry, I get that -o specifies options, and the proceding are the options themselves. I guess I just need an explanation of what users does, and what dfaults does, as well as the ISO stuff.

Last edited by redkazan; 12-31-2003 at 03:49 PM.
 
Old 12-31-2003, 04:02 PM   #7
Mathieu
Senior Member
 
Registered: Feb 2001
Location: Montreal, Quebec, Canada
Distribution: RedHat, Fedora, CentOS, SUSE
Posts: 1,403

Rep: Reputation: 46
users specifies that every user can mount and unmount the file system.
defaults specifies that the default options should be used.
Forget about nls=iso8859-1. I should have written iocharset=iso8859-1. This is the default, so it is not needed.

To learn more about mount, take a look at the MAN page.
Code:
man mount
 
Old 12-31-2003, 04:15 PM   #8
redkazan
Member
 
Registered: Dec 2003
Location: Maine, US
Distribution: Slack 9.1
Posts: 55

Original Poster
Rep: Reputation: 15
*sigh*

Mathieu:

Thanks for the explanation. I studied the man page for mount (I had read it over before, but I took a closer look this time).

If I mount the filsystem using:

mount -t vfat -o umask=000 /dev/hda6 /media

It works fine. The question is, what is the difference between mounting it your way (assuming it had worked) and my way?

Thanks,

rk
 
Old 12-31-2003, 04:59 PM   #9
Mathieu
Senior Member
 
Registered: Feb 2001
Location: Montreal, Quebec, Canada
Distribution: RedHat, Fedora, CentOS, SUSE
Posts: 1,403

Rep: Reputation: 46
The permissions are set to rw-rw-rw-
The owner of the files and directories is owner and the group is set to users.
All users are able to mount and un-mount the partition.
The defaults are applied.

Quote:
I tried to mount the filesystem using your code (in a terminal, as root), and it gave me the following message:

mount: wrong fs type, bad option, bad superblock on /dev/hda6,
or too many mounted file systems

Any ideas? I typed in the code exactly as you laid it out.
Make sure that the uid and gid are set to an existing Unix user and group.
If the user or the group does not exist on your system, then you will get an error.
 
  


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
Setting permissions for games to run off of mounted partition in cedega insacred Ubuntu 1 11-16-2005 11:04 PM
trouble mounting a newly created partition tauceti38 Linux - Hardware 6 03-16-2005 03:40 AM
Problem in creating filesystem for newly created partition. appas Linux - Software 2 08-21-2004 03:39 AM
Linux can't see newly created partition Dswissmiss Linux - Software 5 05-17-2004 08:05 AM
trouble setting perms for USB drive (Lacie databank) MadCactus Linux - Hardware 0 10-26-2003 08:02 AM


All times are GMT -5. The time now is 02:16 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