LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 05-05-2005, 04:01 PM   #1
Lleb_KCir
Senior Member
 
Registered: Nov 2003
Location: Orlando FL
Distribution: Debian
Posts: 1,765

Rep: Reputation: 45
help with access to local FAT32 partition???


i have a dual boot winXP and debian-sarge system. i have some data on my FAT32 partition i want to copy over to one of my linux partitions.

problem is if i moutn it via root my user can not get access to the mount point.

how do i set the permissions from :

mount /dev/hda2 /home/ray/wind

so my user ray can get access to it?
 
Old 05-05-2005, 04:17 PM   #2
Brian1
LQ Guru
 
Registered: Jan 2003
Location: Seymour, Indiana
Distribution: Distribution: RHEL 5 with Pieces of this and that. Kernel 2.6.23.1, KDE 3.5.8 and KDE 4.0 beta, Plu
Posts: 5,700

Rep: Reputation: 65
Add a line similiar to this to /etc/fstab.
Code:
/dev/hda2            /home/ray/wind              vfat    umask=000,users,noauto,owner,rw   0 0
umask is the key to letting users access to the partition.
Then mount as ' mount /dev/hda2 '

Brian1
Google the Linux way at ' http://www.google.com/linux '

Last edited by Brian1; 05-05-2005 at 04:18 PM.
 
Old 05-05-2005, 04:32 PM   #3
Lleb_KCir
Senior Member
 
Registered: Nov 2003
Location: Orlando FL
Distribution: Debian
Posts: 1,765

Original Poster
Rep: Reputation: 45
ok with that, i ran man umask and found the following:

Code:
DESCRIPTION
       umask sets the umask to mask & 0777.

       The  umask  is  used  by  open(2)  to set initial file permissions on a
       newly-created file.  Specifically, permissions in the umask are  turned
       off  from  the  mode  argument  to open(2) (so, for example, the common
       umask default value of 022 results in new files being created with per-
       missions  0666  &  ~022  = 0644 = rw-r--r-- in the usual case where the
       mode is specified as 0666).
so a umask of 022 sets things to 644, if i want 777 is that what the 000 will set it to?
 
Old 05-05-2005, 05:44 PM   #4
Lleb_KCir
Senior Member
 
Registered: Nov 2003
Location: Orlando FL
Distribution: Debian
Posts: 1,765

Original Poster
Rep: Reputation: 45
still getting permissions denied...

Code:
ray@ssmadebian:~$ cd wind
bash: cd: wind: Permission denied
this is my fstab:

Code:
# /etc/fstab: static file system information.
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
proc            /proc           proc    defaults        0       0
/dev/hda3       /               ext3    defaults,errors=remount-ro 0       1
/dev/hda4       /home           ext3    defaults        0       2
/dev/hdc        /media/cdrom0   iso9660 ro,user  0       0
/dev/fd0        /media/floppy0  auto    rw,user,noauto  0       0
//192.168.10.5/c$ /home/ray/sc smbfs auto,rw,credentials=/home/ray/.XXXXX,uid=ray 0 0

//192.168.10.5/d$ /home/ray/sd smbfs auto,rw,credentials=/home/ray/.XXXXX,uid=ray 0 0

//192.168.10.5/e$ /home/ray/se smbfs auto,rw,credentials=/home/ray/.XXXXX,uid=ray 0 0

/dev/hda2 /home/ray/wind vfat umask=000,users,noauto,owner,rw 0 0


i can semi look at it so i know it is mounted, yet again i had to manually mount it as root though:

Code:
ray@ssmadebian:~$ ls wind
Acrobat 5.0           PageMaker 7.0              UltraEdit-32       firefox
Ad-Aware SE Personal  Spybot - Search & Destroy  Winamp             i386
Azureus               SpywareBlaster             World of Warcraft  thunderbird
OpenOffice.org1.1.4   System Volume Information  downloads
ray@ssmadebian:~$ ls -l wind
ls: wind/System Volume Information: Permission denied
ls: wind/firefox: Permission denied
ls: wind/thunderbird: Permission denied
ls: wind/SpywareBlaster: Permission denied
ls: wind/Spybot - Search & Destroy: Permission denied
ls: wind/Ad-Aware SE Personal: Permission denied
ls: wind/OpenOffice.org1.1.4: Permission denied
ls: wind/PageMaker 7.0: Permission denied
ls: wind/Acrobat 5.0: Permission denied
ls: wind/i386: Permission denied
ls: wind/World of Warcraft: Permission denied
ls: wind/downloads: Permission denied
ls: wind/UltraEdit-32: Permission denied
ls: wind/Winamp: Permission denied
ls: wind/Azureus: Permission denied
total 0
ray@ssmadebian:~$
help... please.
 
Old 05-05-2005, 05:57 PM   #5
Lleb_KCir
Senior Member
 
Registered: Nov 2003
Location: Orlando FL
Distribution: Debian
Posts: 1,765

Original Poster
Rep: Reputation: 45
fix it. i had to change the /etc/fstab to look like the following:

Code:
/dev/hda2 /home/ray/wind vfat rw,user,auto,uid=ray 0 0
that did the trick. my question now is why did that work, when the umask=000 did not? did i need the uid=ray in order to make it work before?
 
Old 05-05-2005, 06:19 PM   #6
Brian1
LQ Guru
 
Registered: Jan 2003
Location: Seymour, Indiana
Distribution: Distribution: RHEL 5 with Pieces of this and that. Kernel 2.6.23.1, KDE 3.5.8 and KDE 4.0 beta, Plu
Posts: 5,700

Rep: Reputation: 65
Seems odd that you could not use it. Is the directory owned by you and not root. This is exactly the way I use to mount a vfat partition. Maybe if you mount it as a user it might make a difference. Try the following ideas to do that. I perfer option 2.

'edit'
The above uid option just turns over the mount to a username. I believe if you used the mount command as a user then the umask=000 would work. There are so many ways to do things in linux.

Also the mount command is own by root.
1. There are a several options to allow users to use mount and umount. One is to add yourselve to the wheel group.
usermod -G wheel username

Then using the command ' visudo ' to edit /etc/sudoers file add the following to it.
wheel ALL=(ALL) ALL
or
wheel ALL=(ALL) NOPASSWD: ALL
The second one is if you do not wish to use a password to execute a command. Both allow anyone in the wheel group to use any command as root. Not the best setup. Can easily make a big mistake in very short time.
DO NOT EDIT /etc/sudoers file without using the visudo editor.

2. If you wish to lessen the threat you can infect on a system by using any command at root privileges use something similiar to this.
username ALL=NOPASSWD: /sbin/mount, /sbin/umount
This only yets you use the two commands there in /sbin. The rest still require root access. There are usually other samples to try there.

3. Another way is change the permissions on the mount and umount commands.
chmod +s /sbin/mount. this sets the sticky bit but also allows every user to use the mount command.

4. You can even change group and ownership of the mount command. This lets you use mount but not others.
chown username /sbin/mount
chgrp username /sbin/mount

All the above require root to do.

Now so as not to have to type /sbin/mount add /sbin to your path. Add the line to your ~/.bashrc file or to ~/.profile
export PATH=$PATH:/sbin

Just open a terminal screen to re-initilize the new path without reboot.

Brian1
Google the Linux way at ' http://www.google.com/linux '

Last edited by Brian1; 05-05-2005 at 06:22 PM.
 
Old 05-05-2005, 06:30 PM   #7
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
I use the 'uid=' and 'gid=' options. The umask has a different meaning in mounting a VFAT partition then the umask shell command. Also, because the 'x' permission bit has a different meaning for directories than for files, I think using the 'fmask=' and 'dmask=' options should be used instead. This is because you need the 'x' bit set to enter directories, but you don't want to allow programs or scripts to be run on world writable partitions.

Also, If i remember correctly, the 'users' options allows any user to mount a device manually. That means not using the "auto" option, and instead manually mounting it instead. But I prefer the "uid" and "gid" options instead. In this case the "auto" options is fine.
 
Old 05-05-2005, 08:21 PM   #8
Lleb_KCir
Senior Member
 
Registered: Nov 2003
Location: Orlando FL
Distribution: Debian
Posts: 1,765

Original Poster
Rep: Reputation: 45
brian1, why not just use vim or vi to edit the sudo file?
 
Old 05-08-2005, 06:09 PM   #9
Brian1
LQ Guru
 
Registered: Jan 2003
Location: Seymour, Indiana
Distribution: Distribution: RHEL 5 with Pieces of this and that. Kernel 2.6.23.1, KDE 3.5.8 and KDE 4.0 beta, Plu
Posts: 5,700

Rep: Reputation: 65
Actually visudo uses the vi editor unless you change it. Reason you use is it is when you exit it confirms correct structure of the /etc/sudoers file. If incorrect it will tell you the line with the problem.

Brian1
Google the Linux way at ' http://www.google.com/linux '
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Access FAT32 Partition brig Linux - Software 3 04-02-2005 09:22 AM
cannot access FAT32 partition pafrica Linux - Newbie 3 09-04-2004 03:43 PM
Users can't access FAT32-Partition thorax Linux - Software 3 07-23-2004 02:32 PM
Access files on a fat32 partition? warrant6767 Linux - Hardware 2 06-30-2004 05:25 PM
How to access Windows FAT32 Partition ? d_kote23 Linux - Newbie 5 05-12-2004 06:18 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 08:55 PM.

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
Open Source Consulting | Domain Registration