PDA

View Full Version : fstab options for r/w fat32 partition



martinjh99
1st May 2004, 07:11 PM
I'm looking to make my fat32 partition r/w and I can't remember what the options are that does this!

Here is my fstab entry:

/dev/hda5 /mnt/win vfat auto,umask=022 0 0

Can someone give me a hand?

Thanks in advance.

ghaefb
1st May 2004, 08:34 PM
I use this and it works for me

/dev/hda5 /mnt/win vfat users 0 0

gonzalo76
2nd May 2004, 12:29 AM
Your line in the /etc/fstab should be:


/dev/hda5 /mnt/win vfat rw,umask=022,uid=youruid,gid=yourgroupname 0 0

(with this option you will not have to mount the partition manually everytime you start your system, this option just automount the windows partiton without your intervent)
(I imagine that you first created a folder called win in /mnt directory)

uid=yourUID
Your user number ID, mine is 500.

This is my windows 98 fstab line:
/dev/hda1 /mnt/windows_98 vfat rw,umask=022,uid=500,gid=fedora 0 0

This is my windows xp fstab line:
/dev/hda2 /mnt/windows_xp ntfs ro,umask=022,uid=500,gid=fedora 0 0

gid=fedora
Group ID, if you want to give permissions to your group you could add gid. I belong to fedora's group. You should check to which group you belong in Users and Groups option.

rw
Mount the file system read-write.

umask
Sets the permissions based on three octal numbers. The first number defines access for the user, the second for the group and the last for others. The octal number, n, is a number between 0 and 7. Each type of permission has an octal number associated with it.
The default permission mask is set by adding the octal numbers of file permission denied to each type of user. This provides seven unique numbers for every possible combination of read, write and execute permission. If a 0 is used then all access is granted.
It is important to grant execute permission to the user; otherwise, you will not be able to cd into new directories. It will not make all newly created files executable.
To put you clear, umask is what you, your group and others can't do:
umask 027:
0= you can do everything, read, write and execute.
2= your group can't write.
7= others can't do anything. (not you and your group) (7 = 1+2+4)

Permissions:
Execute = 1 (octal number)
Write = 2 (octal number)
Read = 4 (octal number)

Examples:

$ umask 027

For newly created files and directories, the user has read, write and execute permission, the group has read and execute permission (denied write permission = 2), others have no permissions (denied execute, write and read permission = 1 + 2 + 4 = 7)

Good Luck

gonzalo76
2nd May 2004, 12:34 AM
Originally posted by ghaefb
I use this and it works for me

/dev/hda5 /mnt/win vfat users 0 0

Normally, only the superuser can mount file systems. However, when fstab contains the users option on a line, then anybody can mount the corresponding system.

But with that option you don't give write access to it... :confused: and martinjh99 was looking to make his fat32 partition r/w.

Read my previous post where I explain how to do it.

Greetings
gonzalo

martinjh99
2nd May 2004, 05:16 AM
Gonzalo that works thanks! Printed your edit out so I can put it in my file of Linux documents so I don't forget it this time!!

gonzalo76
2nd May 2004, 06:15 AM
Good idea, greetings...

ghaefb
2nd May 2004, 09:19 AM
With my option I had read/write access to fat32..
Anyway, thanks for detailed explanation of fstab options. I learned something too.

gonzalo76
2nd May 2004, 07:05 PM
Originally posted by ghaefb
With my option I had read/write access to fat32..
Anyway, thanks for detailed explanation of fstab options. I learned something too.

I checked that option myself and I could not write or edit anything under the fat partition.
I'm really :confused:

gonzalo76
2nd May 2004, 07:10 PM
martinjh99:

I made a mistake:

uid=is your user ID number, for example, mine is 500.
You could check your UID at Users and Group menu.

This is my windows 98 fstab line:

/dev/hda1 /mnt/windows_98 vfat rw,umask=000,uid=500,gid=fedora 0 0

I just edited my first post.

Greetings

martinjh99
2nd May 2004, 07:57 PM
Works anyway - When you do mount on its own it reports the numerical gid and uid instead of the name...

ghaefb
2nd May 2004, 08:48 PM
I checked that option myself and I could not write or edit anything under the fat partition.
I'm really

sorry my bad... :rolleyes:

gonzalo76
3rd May 2004, 05:55 AM
Originally posted by martinjh99
Gonzalo that works thanks! Printed your edit out so I can put it in my file of Linux documents so I don't forget it this time!!

Another option you can use:


/dev/hda5 /mnt/win vfat defaults,umask=0022,uid=youruid,gid=yourgroupname 0 0

defaults
Use default options: rw, suid, dev, exec, auto, nouser, and async.

rw
Mount the file system read-write.

suid
Allow set-user-identifier or set-group-identifier bits to take effect.

dev
Interpret character or block special devices on the file system.

exec
Permit execution of binaries.

auto
Can be mounted with the -a option.

nouser
Forbid an ordinary (i.e., non-root) user to mount the file system. This is the default.

async
All I/O to the file system should be done asynchronously.