LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-07-2004, 03:46 PM   #1
OC_eobard
Member
 
Registered: May 2004
Distribution: Slackware 10.2, Ubuntu 6.10
Posts: 94

Rep: Reputation: 15
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.
 
Old 06-07-2004, 03:50 PM   #2
brentos
Member
 
Registered: Nov 2003
Distribution: Fedora Core3, RHEL3,4
Posts: 92

Rep: Reputation: 15
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?
 
Old 06-07-2004, 03:52 PM   #3
leonscape
Senior Member
 
Registered: Aug 2003
Location: UK
Distribution: Debian SID / KDE 3.5
Posts: 2,313

Rep: Reputation: 47
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.
 
Old 06-07-2004, 04:02 PM   #4
OC_eobard
Member
 
Registered: May 2004
Distribution: Slackware 10.2, Ubuntu 6.10
Posts: 94

Original Poster
Rep: Reputation: 15
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.

Last edited by OC_eobard; 06-07-2004 at 04:04 PM.
 
Old 06-07-2004, 04:09 PM   #5
brentos
Member
 
Registered: Nov 2003
Distribution: Fedora Core3, RHEL3,4
Posts: 92

Rep: Reputation: 15
What do you mean that its only accessable by root? Can the other users see it but just can't change anything on it??
 
Old 06-07-2004, 04:18 PM   #6
leonscape
Senior Member
 
Registered: Aug 2003
Location: UK
Distribution: Debian SID / KDE 3.5
Posts: 2,313

Rep: Reputation: 47
/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.
 
Old 06-07-2004, 04:24 PM   #7
OC_eobard
Member
 
Registered: May 2004
Distribution: Slackware 10.2, Ubuntu 6.10
Posts: 94

Original Poster
Rep: Reputation: 15
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.
 
Old 06-07-2004, 04:26 PM   #8
OC_eobard
Member
 
Registered: May 2004
Distribution: Slackware 10.2, Ubuntu 6.10
Posts: 94

Original Poster
Rep: Reputation: 15
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?
 
Old 06-07-2004, 04:35 PM   #9
leonscape
Senior Member
 
Registered: Aug 2003
Location: UK
Distribution: Debian SID / KDE 3.5
Posts: 2,313

Rep: Reputation: 47
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 ).

Last edited by leonscape; 06-07-2004 at 04:36 PM.
 
Old 06-07-2004, 04:44 PM   #10
OC_eobard
Member
 
Registered: May 2004
Distribution: Slackware 10.2, Ubuntu 6.10
Posts: 94

Original Poster
Rep: Reputation: 15
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.
 
Old 06-07-2004, 05:03 PM   #11
leonscape
Senior Member
 
Registered: Aug 2003
Location: UK
Distribution: Debian SID / KDE 3.5
Posts: 2,313

Rep: Reputation: 47
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.
 
Old 06-07-2004, 05:13 PM   #12
OC_eobard
Member
 
Registered: May 2004
Distribution: Slackware 10.2, Ubuntu 6.10
Posts: 94

Original Poster
Rep: Reputation: 15
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.
 
Old 06-07-2004, 05:27 PM   #13
leonscape
Senior Member
 
Registered: Aug 2003
Location: UK
Distribution: Debian SID / KDE 3.5
Posts: 2,313

Rep: Reputation: 47
mount it as the user, this should give you write permissions, or try the option suid.
 
Old 06-08-2004, 01:36 AM   #14
OC_eobard
Member
 
Registered: May 2004
Distribution: Slackware 10.2, Ubuntu 6.10
Posts: 94

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

Last edited by OC_eobard; 06-08-2004 at 02:11 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Using chown, chgrp, chmod on a vfat partition? Rodolfo Medina Linux - General 7 08-17-2005 09:17 AM
Chmod ,chown ,chgrp commands not working proper---------------- pal Linux - Newbie 12 03-07-2005 10:55 AM
chmod ,chown ,chgrp------------ pal Linux - Newbie 1 02-27-2005 03:49 PM
problems with chown and chgrp apax Linux - Software 6 11-03-2003 04:44 PM
file perm, chgrp, chmod, and umask Martini Linux - Newbie 2 08-06-2002 09:04 PM


All times are GMT -5. The time now is 10:21 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration