LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Can't write to Fat32 drive if I'm not root (https://www.linuxquestions.org/questions/linux-newbie-8/cant-write-to-fat32-drive-if-im-not-root-387408/)

alex1986 11-28-2005 07:23 PM

Can't write to Fat32 drive if I'm not root
 
I am an ULTRA-NEWB. so please don't give me answers like chmod 777 and expect that I know what it will mean. lol.

I know that if it's Microsoft related i should go post in General but i need some dumbied down help.

My friend set my system up for me, told me how to do basic stuff.

I have a dual-boot (Lilo) for XP pro, and linux26 (Slackware, Kernel 2.6.13)

My kernel has been recompiled a few times to accomadate my sound and my AMD 64 processor.

My first problem is: I can't write to the fat32 partition on my drive unless I am root. this wouldn't be a big deal if my vid card didn't suck (RADEON X800 XL, system crashes when I run 2 GUI's and go to switch between them). I need to know how to give my normal user "alex" permission to write to this partition which I have mounted apperantly as read only to /XP/C: it isn't my xp drive, don't worry i know NOT TO WRITE TO NTFS. my ntfs drive is /XP/F:

I plan to post a bunch more of my questions but baby-steps! lol

if you need to know anything about my system just ask.

Alex Chisholm

alex1986 11-28-2005 07:25 PM

i forgot to put this in, here is what my fstab looks like:

/dev/sda2 / ext3 defaults 1 1
/dev/sda1 /boot ext2 defaults 1 2
/dev/sda3 /XP/F: ntfs users,ro,umask=0 1 0
/dev/sda4 /XP/C: vfat defaults 1 0
/dev/dvd /mnt/dvd auto noauto,users,ro 0 0
/dev/fd0 /mnt/floppy auto noauto,users 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
proc /proc proc defaults 0 0

tkedwards 11-28-2005 07:30 PM

You have 2 options:
1) Enable access for your user only
2) Enable access for all users

For 1) you'd add
Code:

uid=alex,gid=alex
to the appropriate line in /etc/fstab or for 2) you'd add
Code:

umask=0000
to the line in fstab. You can then either reboot the machine or remount the partition manually with
Code:

mount -o remount /mnt/youfat32drive
.



Update:
Code:

/dev/sda4 /XP/C: vfat gid=alex,uid=alex,defaults 1 0
OR
/dev/sda4 /XP/C: vfat umask=0,defaults 1 0


sundialsvcs 11-28-2005 07:50 PM

Here's the problem: the FAT32 disk format does not have Unix permission-bits. This filesystem has no concept of a file "owner," no real security of any kind, and no place to save the information if you did want to set/change it. So, the filesystem driver in Unix has to "fake" something. And basically what it has to come up with is "either/or" ... either the guy who requested the mount is the only one who can use the drive, or everyone can use the drive. It's not a deficiency of Linux, but of a disk-format that is being pressed into a service for which it was never designed.

dogpatch 11-28-2005 07:53 PM

As root, change the line in fstab for the vfat partition, changing 'defaults' to 'users'. Then, logged in as the proper user, mount the partition. (This could be part of that user's login script).

Alternatively, as root, mount the partition, specifying the user to allow access:
Code:

mount /dev/sda4 -o uid=alex
(oops, too slow other replies got to you first):o

alex1986 11-28-2005 08:06 PM

thanks to all... I used the umask=0 in my fstab and that did the trick. I am the only user on the linux side of my system so I don't have to worry about another linux user getting in. although, would the umask=0 create any network security issues?

tkedwards 11-28-2005 08:44 PM

Quote:

although, would the umask=0 create any network security issues?
No. Not unless you shared that drive using samba, but if you did that you would restict it to only authorised users in the samba config anyway.


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