LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Mount fat32 partition? (https://www.linuxquestions.org/questions/slackware-14/mount-fat32-partition-129104/)

CletusJones 12-26-2003 04:22 PM

Mount fat32 partition?
 
Okay, I did a search of the forum and couldn't find anything to help me out...

I'm trying to edit my fstab file so that it'll automount a fat32 partition on my other hdd without any luck.

I'm trying to mount a partition that would be hda2 (linux runs on hdb) and i'm getting an invalid mount point error. Any suggestions?

I can post the fstab file and error messages if necessary.

Thanks!

Mara 12-26-2003 04:26 PM

The mount command should be
mount -t vfat /dev/hdb /mnt/win
where /mnt/win is an empty directory. /etc/fstab line would be
/dev/hda2 /mnt/win vfat defaults 0 0

dibblethewrecke 12-26-2003 05:33 PM

I'm actually using vector but i have what look like a few weird directories in my /mnt - i've got win, linux and a few others, would these be left over from the "compilation" of my vector ISO? Their not refered to in fstab so is it safe to delete them?

also my terminal says my slocate dbase needs updating and shows me files that don't exist in my hard disk, in /mnt/win for example...

oh, and another thing, i added user in the fstab entry for my windows partitions but i can't get into them as a regular user. should i be able to? or do i need to change the permissions....ah, hang on a sec, i created the directories as root, that'd stop me looking at them, right? bloody complicated business this! hang on i have to create the directories as root - so i have to set permissions for them?

ok. i don't get this at all. i've seen how i can use chmod and chown but i don't actually know what i should change the permissions to - should i have the same permissions as i do for the floppy and cdrom? i tried to use chown to change the owner to user but it said operation not permitted

i want my mp3s!

Skyline 12-26-2003 11:28 PM

Quote:

oh, and another thing, i added user in the fstab entry for my windows partitions but i can't get into them as a regular user. should i be able to? or do i need to change the permissions....ah, hang on a sec, i created the directories as root, that'd stop me looking at them, right? bloody complicated business this! hang on i have to create the directories as root - so i have to set permissions for them?
For FAT32 make sure you've got

umask=000

as one of the options in the relevant entry in the 4th field of /etc/fstab

For NTFS make sure youve got

umask=0222

as one of the options in the relevant entry in the 4th field of /etc/fstab

gnashley 12-27-2003 03:16 AM

You can use any of the existing unused mount points to mount the FAT partition. Or make a new mount point:
mkdir /mnt/newmountpoint
then try
mount /dev/hda2 /mnt/newmountpoint
to see if it works, then edit fstab accordingly. The thing is that you can't mount to a mount point hat doesn't exist.
About slocate, do
slocate -u
to 'update' the database. This will create data base that includes everything currently mounted. If you want to exclude a directory then do this:
slocate -u -e /somedir

dibblethewrecke 12-27-2003 05:27 AM

slocate -u and umask=000 both worked a treat, cheers for that.

What's the umask all about? I had a howto on mounting and it didn't mention it at all, glad i didn't mess around with the permission, thought i was something in fstab...:D

found a bit about it. it's about setting default file permissions when the files are mounted? i only found instructions for using it on the command line tho.

CletusJones 12-27-2003 09:04 AM

Thanks guys! All seems to be well.

I've learned more in the past 2 days (between reading online and in books) with slack, than i did in 6 months with RH. :D

CletusJones 12-27-2003 02:10 PM

Quote:

Originally posted by Skyline
For FAT32 make sure you've got

umask=000

as one of the options in the relevant entry in the 4th field of /etc/fstab

For NTFS make sure youve got

umask=0222

as one of the options in the relevant entry in the 4th field of /etc/fstab

So, using this umask=000 command in my fstab file so that other users can access the mounted vfat partition, the whole line would look like this, correct?

/dev/hda2 /mnt/win vfat umask=000 0 0

or did I add that statement in the wrong order?

thanks again...

jsmarshall85 12-27-2003 02:20 PM

i have the same setup, win xp on hda and slack on hdb. here is what is in my fstab to mount my fat32 partition hda5

/dev/hda5 /share vfat noauto,user,rw 1 0

with that i also logged in as root and changed the permissions for the /share directory to 777 and changed the owner and group to my username and the group to users (they are defaulted to root, root)

hope that helps

Skyline 12-27-2003 06:30 PM

Quote:

So, using this umask=000 command in my fstab file so that other users can access the mounted vfat partition, the whole line would look like this, correct?

/dev/hda2 /mnt/win vfat umask=000 0 0
also add

defaults

as another option in the 4th field - ie

/dev/hda2 /mnt/win vfat umask=000,defaults 0 0

CletusJones 12-28-2003 01:49 PM

Quote:

Originally posted by Skyline
also add

defaults

as another option in the 4th field - ie

/dev/hda2 /mnt/win vfat umask=000,defaults 0 0

I'll give it a try, thanks!

what do the last two numbers mean? (the 0 0 at the end) I noticed that i've got a few entries in there that have 1 0 instead....

Mara 12-28-2003 03:05 PM

Fifth field in /etc/fstab is used by dump (not many people use it now), sixth by fsck during boot - 0 means the filesystem is not checked, value different from 0 tells when it will be checked (order).

CletusJones 12-28-2003 03:48 PM

cool, thanks for the info. I must say that everyone here has been very helpful! thanks again everyone. :D

thegeekster 12-28-2003 06:29 PM

A note about the umask option
 
Setting a umask=000 on a vfat partition will effectively allow anyone to do anything to that partition. When mounting vfat from /etc/fstab, the owner and group for it is root (for both). If you have users that you may want to restrict to say reading files and subdirectories only and restrict write permissions, you can mount the vfat for a particular group id (gid= ) and set the umask to read 'umask=002'.

For example, if you want to allow the wheel group full permissions and restrict the normal user group to read only, find the group id number for the wheel group in /etc/group (in my slack box it is 10) and add something like this line in /etc/fstab:

/dev/hda1 /mnt/win vfat defaults,umask=002,gid=10 0 0

This will set the owner to root and the group to wheel with full permissions to both, and only allow the others' permission read and execute, like so:

drwxrwxr-x root wheel

Just be sure to replace the correct values for your partition, mount point and group id you want to use.

I do this as a security precaution in case of a compromised OS. My login id also belongs to the wheel group (to allow su'ing if needed) as well as belonging the regular user group (which can't su to root). Maybe a bit paranoid, but I see it as better safe than sorry. :)

CletusJones 12-28-2003 06:46 PM

Re: A note about the umask option
 
Quote:

Originally posted by thegeekster
Setting a umask=000 on a vfat partition will effectively allow anyone to do anything to that partition. When mounting vfat from /etc/fstab, the owner and group for it is root (for both). If you have users that you may want to restrict to say reading files and subdirectories only and restrict write permissions, you can mount the vfat for a particular group id (gid= ) and set the umask to read 'umask=002'.
I don't have any users except myself, but I could see where this could come in handy in a multi-user environment.

Quote:

Originally posted by thegeekster
I do this as a security precaution in case of a compromised OS. My login id also belongs to the wheel group (to allow su'ing if needed) as well as belonging the regular user group (which can't su to root). Maybe a bit paranoid, but I see it as better safe than sorry. :) [/B]
Compromised OS? I don't see that as being a huge problem, and if my pc is compromised, there's really nothing on it that would be of value to anyone. Besides, ATM, I'm connected to the web via dialup and when I move (in just about 4 months) I'll be behind a cisco pix firewall... I think I'll be pretty safe.


All times are GMT -5. The time now is 05:28 AM.