LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Problems with chmod and chgrp (https://www.linuxquestions.org/questions/linux-newbie-8/problems-with-chmod-and-chgrp-190780/)

OC_eobard 06-07-2004 02:46 PM

Problems with chmod and chgrp
 
I'm having trouble changing permissions for a partition I have. I'm using Slackware 9.1 and the partition is a FAT32 data partition mounted at "/win_d". The problem is it's only accessible by root. I've tried to change the permissions with "chgrp users win_d" which gives me a "Operation not permitted" error and "chmod 777 win_d" which give no error but doesn't work. What am I missing? I have gone over the tutorial but I'm still uncertain as to what I'm doing wrong.

brentos 06-07-2004 02:50 PM

You probably have to change the way the partition is mounted in fstab to let other users access it.
I am not too sure all my auto mounted partition are accessable to everyone, can you show me the fstab entry for that mount?

leonscape 06-07-2004 02:52 PM

Windows paritions don't actually have permissions. Its actually controlled by the moust command and the /etc/fstab file for Linux. Try setting the umask. see the man page for mount or fstab.

OC_eobard 06-07-2004 03:02 PM

Quote:

Originally posted by brentos
You probably have to change the way the partition is mounted in fstab to let other users access it.
I am not too sure all my auto mounted partition are accessable to everyone, can you show me the fstab entry for that mount?

Here's my etc/fstab file:
/dev/hda7 swap swap defaults 0 0
/dev/hda6 / reiserfs defaults 1 1
/dev/hda8 /usr/local reiserfs defaults 1 2
/dev/hda1 /win_c vfat defaults 1 0
/dev/hda5 /win_d vfat defaults 1 0
/dev/cdrom /mnt/cdrom iso9660 noauto,owner,ro 0 0
/dev/fd0 /mnt/floppy auto noauto,owner 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
proc /proc proc defaults 0 0

I find that man pages are confusing to interpert clearly, is there a link to a tutorial on these forums that explains fstab and umount with the same clarity that the chmod tutorial I linked to above does?

addendum: Thanks for the quick replies. :)

brentos 06-07-2004 03:09 PM

What do you mean that its only accessable by root? Can the other users see it but just can't change anything on it??

leonscape 06-07-2004 03:18 PM

/dev/hda1 /win_c vfat defaults 1 0
/dev/hda5 /win_d vfat defaults 1 0

The important thing here is the options. defaults is good for linux but not for windows. try

/dev/hda1 /win_c vfat rw,user,noauto,mode=777 0 0
/dev/hda5 /win_d vfat rw,user,noauto,mode=777 0 0

This will mount the drives as read-write, allow normal users to mount the file system, don't mount this at boot, and make it appear all the files have a mode of 0777.

OC_eobard 06-07-2004 03:24 PM

Quote:

Originally posted by brentos
What do you mean that its only accessable by root? Can the other users see it but just can't change anything on it??
Outside of root I have read only access.

OC_eobard 06-07-2004 03:26 PM

Quote:

Originally posted by leonscape
/dev/hda1 /win_c vfat defaults 1 0
/dev/hda5 /win_d vfat defaults 1 0

The important thing here is the options. defaults is good for linux but not for windows. try

/dev/hda1 /win_c vfat rw,user,noauto,mode=777 0 0
/dev/hda5 /win_d vfat rw,user,noauto,mode=777 0 0

This will mount the drives as read-write, allow normal users to mount the file system, don't mount this at boot, and make it appear all the files have a mode of 0777.

I read the man pages for umount and fstab and soaked a lot of it in, I get the meaning of "rw,user,noauto,mode=777" but the last two zeros escape me. Can you expalin that part for me please?

leonscape 06-07-2004 03:35 PM

The first of thoose zeros is for the dump command, its a backup program, and this zero marks whether this patition needs to be dumped.Only the linux partitions should have a 1, all others get a 0.

The second zero is for fsck, and marks whether this partition should be checked at startup. ( the root partition should be marked 1, all others should be 2, apart from the ones that don't need checking which get a 0 ).

OC_eobard 06-07-2004 03:44 PM

Thanks again. Is there a listing in a man page I can look for that shows what the defaults for the various partition formats are? I'd like to see what vfat gets set at automatically other than knowing it's "default". The umount man page tells me what my options are, but not the predefined defaults.

leonscape 06-07-2004 04:03 PM

The default options for every filesystem is:

rw,suid,dev,exec,auto,nouser,async

Other options for vfat are give in the manpage for mount.

OC_eobard 06-07-2004 04:13 PM

Thanks. I made the changes as you suggested and got read and execute permissions only, no write outside of root. So as SuperUser I "chmod 777 win_d" -ed and got write access. But now that I have permission to access the partition nothing appears in it. I'm thinking I have read access to the partition but none of the files or subdirectories in it. Aren't they supposed to come along by default? I tried to fix it with "chgrp users win_d" as root and it now shows the group ownership as "users" but that didn't solve it.

leonscape 06-07-2004 04:27 PM

mount it as the user, this should give you write permissions, or try the option suid.

OC_eobard 06-08-2004 12:36 AM

edit: I had another question but I think I've already got the answer. Feel free to delete this post moderators.


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