Permissions on mounted filesystems

  • rtm223
  • Mastermind
  • Mastermind
  • User avatar
  • Posts: 1855
  • Loc: Uk

Post 3+ Months Ago

I have two fat32 partitions that I am using for sharing files between Red Hat nine and win2k. I can mount them fine, but can only get write access if I am signed in as root. The only solution I saw anywhere to this was to change the permissions of the directory before you mount the filesystem on it, but this gets changed back as soon as I mount the partition (see below).
I have tried to change permissions like this for the partition after it is mounted (and changed back to 755)

Code: [ Select ]
[root@localhost mnt]# ls
total 20
drwxrwxrwx  2 root   root     4096 Apr 3 11:59 cdrom
drwxrwxrwx  2 root   root     4096 Apr 3 11:59 cdrom1
drwxrwxrwx  2 root   root     4096 Apr 5 18:38 common
drwxrwxrwx  2 root   root     4096 Apr 3 11:59 floppy
drwxrwxrwx  2 root   root     4096 Apr 5 18:32 sysinf

[root@localhost mnt]# mntsysinf
/dev/hda5 on /mnt/sysinf type vfat (rw)

[root@localhost mnt]# ls
total 48
drwxrwxrwx  2 root   root     4096 Apr 3 11:59 cdrom
drwxrwxrwx  2 root   root     4096 Apr 3 11:59 cdrom1
drwxrwxrwx  2 root   root     4096 Apr 5 18:38 common
drwxrwxrwx  2 root   root     4096 Apr 3 11:59 floppy
drwxr-xr-x  6 root   root    32768 Jan 1 1970 sysinf

[root@localhost mnt]# chmod -R 777 sysinf
  1. [root@localhost mnt]# ls
  2. total 20
  3. drwxrwxrwx  2 root   root     4096 Apr 3 11:59 cdrom
  4. drwxrwxrwx  2 root   root     4096 Apr 3 11:59 cdrom1
  5. drwxrwxrwx  2 root   root     4096 Apr 5 18:38 common
  6. drwxrwxrwx  2 root   root     4096 Apr 3 11:59 floppy
  7. drwxrwxrwx  2 root   root     4096 Apr 5 18:32 sysinf
  8. [root@localhost mnt]# mntsysinf
  9. /dev/hda5 on /mnt/sysinf type vfat (rw)
  10. [root@localhost mnt]# ls
  11. total 48
  12. drwxrwxrwx  2 root   root     4096 Apr 3 11:59 cdrom
  13. drwxrwxrwx  2 root   root     4096 Apr 3 11:59 cdrom1
  14. drwxrwxrwx  2 root   root     4096 Apr 5 18:38 common
  15. drwxrwxrwx  2 root   root     4096 Apr 3 11:59 floppy
  16. drwxr-xr-x  6 root   root    32768 Jan 1 1970 sysinf
  17. [root@localhost mnt]# chmod -R 777 sysinf


This gives a long long long list of errors lol :lol: basically saying that it has tried to change every file within sysinf to 777, the actual value is 755, and the operation cannot be completed.

This is really doing my head in as it means I cannot work with my files unless I am signed in as root all the time I am using them - which is not good!
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • b_heyer
  • Web Master
  • Web Master
  • User avatar
  • Posts: 4581
  • Loc: Maryland

Post 3+ Months Ago

If you edit /etc/fstab and you change your fat32 to something like this:

Code: [ Select ]
/dev/hda1    /fat-c      vfat    noauto,owner,user   1  0


The noauto stops it from being mounted at boot (which then defaults to root ownership). The next two will set up permissions properly then.
  • rtm223
  • Mastermind
  • Mastermind
  • User avatar
  • Posts: 1855
  • Loc: Uk

Post 3+ Months Ago

ahhhh. I was going to do a little research on the fstab and then I got lazy and posted here :oops:
Thank you again for your help b_heyer :D
  • b_heyer
  • Web Master
  • Web Master
  • User avatar
  • Posts: 4581
  • Loc: Maryland

Post 3+ Months Ago

Yup, I had the same problem a while ago :-)
  • fmadero
  • Born
  • Born
  • fmadero
  • Posts: 1

Post 3+ Months Ago

Got this from this link and it works flawless
http://lists.ssc.com/pipermail/linux-li ... 13032.html

I usually use a fstab line like the following:
/dev/hda1 /dosc vfat uid=0,gid=4,umask=007

Then all users in adm group (gid=4) have r/w access. You could use something
like this to give all users access:
/dev/hda1 /dosc vfat uid=0,gid=4,umask=000

Matt

> -----Original Message-----
> From: linux-list-admin at ssc.com [mailto:linux-list-admin at ssc.com]On
> Behalf Of K. David Prince
> Sent: Thursday, July 25, 2002 10:47 AM
> To: Linux List
> Subject: [SLL] mount permissions
>
>
> I'm setting up a dual boot machine. One side: Debian/Linux. The other
> WinXP. I've setup a vfat partition so that files can be written/exchanged
> between the to OSs. As root, I can mount this partition and write to it,
> but not as a regular user. I've tried a number of fstab options but can't
> get the right ones set so that normal users can write to this partition.
> I need to have this partition mounted at boot time.
>
> What are the options that will allow normal users to write to a vfat
> partition that will be mounted at boot time?
>
> Thanks,
> Dave

Post Information

  • Total Posts in this topic: 5 posts
  • Users browsing this forum: No registered users and 59 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.