LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (https://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   How to mount FAT partitions under Linux automatically (https://www.linuxquestions.org/questions/linux-hardware-18/how-to-mount-fat-partitions-under-linux-automatically-303066/)

cquedugdylp 03-18-2005 02:28 AM

How to mount FAT partitions under Linux automatically
 
Dear everyone,

I installed two OS on my PC, Win2000 and RH8.0, and want to share files between these two OS. As I know, I can mount a FAT32 partition under linux using the following command:
mount -t vfat /dev/hda... /mnt/... -o charset=cp936

But, to do so, I have to login using 'root' account first.
I want to know, are there any method let the PC mount FAT32 partitions automatically when linux is booting?
Thank you

linmix 03-18-2005 02:38 AM

by adding the entries to fstab

dom_lochet 03-18-2005 03:49 AM

To be a little more explicit, what you have to do is to add a line like:

/dev/hda4 /mnt/windows vfat defaults,rw,user,uid=0,gid=6,umask=002 0 0

in /etc/fstab.

For more info on the options, just type "man fstab" on the command line.

linmix 03-18-2005 04:37 PM

yeah, just didn't have mine available then. Anyway there a couple of hundred posts on this matter to learn from as well.

Also, 'rw' is included in 'defaults' (man mount!) so it isn't necessary.

BTW my fstab entry is: /dev/hda7 /mnt/windows/f vfat uid=500,gid=500,umask=000,exec,dev,suid,rw 0 0

cquedugdylp 03-18-2005 10:47 PM

Thanks! I have confirmed this problem.

penguinlnx 03-19-2005 01:07 AM

Regarding mounting drives...
 
probably another dumb question, but do you have to mount the drives 1st,
and then say, format them and add a file-system like 'reiser',
or do you have to use some partition utility outside of your Linux OS/GUI...
THEN mount the drives?

I have an extra partition I was going to use for Windows till I found I couldn't install it
after installing Gentoo. (I am not going to install Gentoo over again without a damn good reason)
I tried partitioning it NTFS using Win2000 floppies but It's just wasted space right now.

How should I proceed?

linmix 03-19-2005 03:44 AM

You can only resize partitions if they're not mounted, and I suppose it would be better not to have them mounted when you make a filesystem change. Try a prog like qtparted for both.

As for windows. if you really need it there's no reason why you shouldn't be able to install it after linux. You'll simply have to reinstall the bootloader when you complete the installation (would be a good idea to create a boot floppy for linux to make things easier)

I'd go with a fat32 partitioning and if you wish to use ntfs later windows should be able to do that for you either during or after installation.

bonito 03-23-2005 08:29 AM

Read/Write Windows Partition (fat32)
 
Quote:

Originally posted by linmix
BTW my fstab entry is: /dev/hda7 /mnt/windows/f vfat uid=500,gid=500,umask=000,exec,dev,suid,rw 0 0 [/B]

Wow, whats up with all those options??

Im trying to get Linux to Mount the windows (fat32) partition was read/write.
Right now, All my Linux Users can see the Windows partition, but only the Root can write to it.

Any Thoughts?

linmix 03-23-2005 04:12 PM

The short answer to that would be "read the man page", but I'll be a little more specific:

"defaults" will do if you only want to be able to 'see' the partition. umask=000 sets file and folder permissions to 777 (umask numbers are the inverse of permission numbers)

By adding "uid=500,gid=500" I ensure that I am the only user (except for root of course) who has read-write access.

According to man mount, defaults = rw, suid, dev, exec, auto, nouser, and async. Since I have specified a user I don't need nouser anymore so it's no longer specified.

bonito 03-23-2005 10:14 PM

duh!!!
 
Quote:

Originally posted by linmix
"defaults" will do if you only want to be able to 'see' the partition. umask=000 sets file and folder permissions to 777 (umask numbers are the inverse of permission numbers)

lol

now how was i supposed to figure that umask option out???
Did you really figure that out all by yourself?? or did someone tell you? = ]

but thank you for the Best Explanation i've come across yet.

but actually, after letting your explanation soak in, ive realized its all about the "umask" option.

"gid=100,umask=003,exec,dev,suid,rw"
works just as well.
The Owner (has read/Write),
and everyone in the 100 group has read/Write as well.
Everyone else, gets Read only.

You see? Quite Simple.

Thank You for Enlightening me.


All times are GMT -5. The time now is 04:56 PM.