LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   vfat permissions problem (https://www.linuxquestions.org/questions/linux-newbie-8/vfat-permissions-problem-297178/)

JBB 03-03-2005 10:08 AM

vfat permissions problem
 
Debian Sarge, xterm, bash, KDE
Linux version 2.4.27-2-686

I am having trouble mounting my Windows hard drive as a user. No problems as root. <mount -t vfat /dev/hda1 /mnt/Win98>

<cd /mnt/Win98> gets me: "bash: cd: /mnt/Win98: Permission denied"

When I enter <ls -l /mnt/Win98> as a normal user I get bunch of permission denied.

If I enter <ls -l> from /mnt as normal user I can then view the directory's attributes which are:
"drwxr--r-- 43 root root 4096 2005-02-23 12:25 Win98"

When I enter <ls -l /bin/mount> the attributes displayed are:
"-rwsr-xr-x 1 root root 76888 2004-09-23 23:34 /bin/mount"

When I enter the command as normal user <mount -t vfat /dev/hda1 /mnt/Win98> I get: "mount: only root can do that". Looking at the attributes for mount I don't understand why I can't use it. Also, <type mount> = "mount is hashed (/bin/mount)".

Now I am going to <su>...done.

Enter <mount -t vfat /dev/hda1 /mnt/Win98> I get the message:
"mount: according to mtab, /dev/hda1 is already mounted on /mnt/Win98". So it seems to be mounted at bootup.

Exit su (Ctrl-d).

As root I have tried:
<chmod ugo=xrw /mnt/Win98>
<chmod 777 /mnt/Win98>
<find /mnt/Win98 -type d exec chmod 777 {} \;>

Know matter what I do, I can view /mnt/Win98 as root only. I have searched and searched, but nothing seems to work. This is driving me crazy. Is there a text file I can manually enter the permissions into?

A cry for help!

Thanks
JBB

rylan76 03-03-2005 10:15 AM

Have you tried putting this in you /etc/fstab:

/dev/hda1 /mnt/win vfat user,exec,dev,suid,rw,umask=000,auto 0 0

after of course ensuring that you have created a "win" directory in the "mnt" directory?

This works fine on Rh9 - I can read/write my windows partition as any user. Take note though that Linux cannot as yet write NTFS - so if your XP partition is NTFS formatted, you're outta luck. I specifically installed XP so that it was forces to use FAT32, since I wanted Linux compatibility with the the XP partition.

JBB 03-03-2005 10:27 AM

This is my /etc/fstab file

# /etc/fstab: static file system information.
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
/dev/hdb1 / ext3 defaults,errors=remount-ro 0 1
/dev/hdb9 /home ext3 defaults 0 2
/dev/hdb8 /tmp ext3 defaults 0 2
/dev/hdb5 /usr ext3 defaults 0 2
/dev/hdb6 /var ext3 defaults 0 2
/dev/hdb7 none swap sw 0 0
/dev/hdc /media/cdrom0 iso9660 ro,user,noauto 0 0
/dev/fd0 /media/floppy0 auto rw,user,noauto 0 0
/dev/hda1 /mnt/Win98 vfat ro,user,auto 0 0

aeichner 03-03-2005 10:30 AM

Hi there,

the problem is VFAT does not support owner/group/others-permissions, so all files and directories are owned by only one user - the mounting user by default. I have a line like this in my /etc/fstab:

/dev/hdb1 /mnt/wine vfat codepage=850,user,noauto 0 2

and if I do the command:

mount /mnt/wine

as user the mtab shows:

/dev/hdb1 on /mnt/wine type vfat (rw,noexec,nosuid,nodev,codepage=850,user=aeichner)

wich means, all files are owned by the mounting user (the user= entry). If you set the option "auto" in the fstab, the mounting user at system startup is a root-process and all files will be owned by root.
A good solution for using the auto-option would be to explicitly set owner-, user-id and/or umask/dmask as mount-option in fstab.
So if you want to use the auto-option in fstab, use other options (fat and vfat-sections in "man mount") to modify the default behaviour.

JBB 03-03-2005 12:07 PM

aeichner

I wonder why I had no problems viewing vfat as a normal user with Mandrake 9.2.

JBB 03-03-2005 12:38 PM

rylan76
 
rylan76 Thanks, that let me enter the /mnt/Win98 directory as a normal user, but I can't "see" anything in there as a normal user.

Edit: I can't "see" anything as root either.


All times are GMT -5. The time now is 12:23 PM.