LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora
User Name
Password
Fedora This forum is for the discussion of the Fedora Project.

Notices


Reply
  Search this Thread
Old 07-13-2004, 05:22 PM   #1
sford232
LQ Newbie
 
Registered: Mar 2004
Posts: 26

Rep: Reputation: 15
Help with file permissions


I'm having a problem with file permissions on FC 2. I have a Fat32 partition that I use for sharing files between Linux and Windows. I can read the files on Linux, and when logged in as root, I can also write. I used the chmod command:
chmod -R 777 /Fat32
Still can't write to this partition unless logged in as root. Same deal with the ntfs windows partition (separate hd). I would like to be able to read from this partition, I can do it as root. Don't need to write to this partition so:
chmod -R 444 /mnt/ntfs
Right?
What am I doing wrong?

Scott
 
Old 07-13-2004, 05:40 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
you can't change rights on a fat32 partition, as within the fat32 definition, there is simply nowhere for this information to be held. you need to set the permissions for the entire partition when you mount it, specifiying a umask=022 optino for example
 
Old 07-13-2004, 07:31 PM   #3
sford232
LQ Newbie
 
Registered: Mar 2004
Posts: 26

Original Poster
Rep: Reputation: 15
How exactly would I go about changing the umask value? And I'm not sure what the values even mean. I've got a basic grasp of the chmod commands and values, but I'm not quite getting the umask thing. Can I just modify my /etc/fstab? If so, what values would I use?

Scott
 
Old 07-13-2004, 07:54 PM   #4
Bruce Hill
HCL Maintainer
 
Registered: Jun 2003
Location: McCalla, AL, USA
Distribution: Arch, Gentoo
Posts: 6,940

Rep: Reputation: 129Reputation: 129
Though my Linux knowledge is far short of Chris', this is how I have my
/etc/fstab setup so that I can read NTFS and read/write FAT32
Code:
/dev/hda6        /DATA_NTFS       ntfs        ro               1   0
/dev/hda7        /DATA_FAT32      vfat        user,umask=1000,rw,auto 0 0
/dev/hda8        /TEMP_FAT32      vfat        user,umask=1000,rw,auto 0 0
Perhaps if there's a flaw in this, someone like Chris will point it out. In this
scheme I have the 2 FAT32 drives automounting as user, but not the NTFS
drive - it can only be mounted as root and is read-only (ro).

Hope this helps.
 
Old 07-13-2004, 09:12 PM   #5
sford232
LQ Newbie
 
Registered: Mar 2004
Posts: 26

Original Poster
Rep: Reputation: 15
Thats a good start, I'll give it a try....

Scott
 
Old 07-14-2004, 12:51 PM   #6
sford232
LQ Newbie
 
Registered: Mar 2004
Posts: 26

Original Poster
Rep: Reputation: 15
user,umask=1000,rw,auto 0 0
didn't work, it wouldn't mount at all.
 
Old 07-14-2004, 02:54 PM   #7
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
you're typing somethign in wrong then. that will work correctly without problems. please *tell us* what the errors actually are, we'er not psychic.
 
Old 07-14-2004, 06:38 PM   #8
Bruce Hill
HCL Maintainer
 
Registered: Jun 2003
Location: McCalla, AL, USA
Distribution: Arch, Gentoo
Posts: 6,940

Rep: Reputation: 129Reputation: 129
It might help if you post the output of
bash-2.05b# fdisk -l
and
bash-2.05b$ cat /etc/fstab
and let us have a look.
 
Old 07-14-2004, 07:31 PM   #9
sford232
LQ Newbie
 
Registered: Mar 2004
Posts: 26

Original Poster
Rep: Reputation: 15
I apologize if I'm leaving relevant information out, I'm still new to this. After I modified the fstab file, on boot I got a:
mount: mount: fs type auto not supported by kernel
netfs: Mounting other filesystems: failed
that I didn't notice before. Changed it back and it mounts fine.
My etc/fstab=
LABEL=/ / ext3 defaults 1 1
LABEL=/boot /boot ext3 defaults 1 2
none /dev/pts devpts gid=5,mode=620 0 0
none /dev/shm tmpfs defaults 0 0
/dev/hdb2 /fat32 vfat defaults 0 0
none /proc proc defaults 0 0
none /sys sysfs defaults 0 0
/dev/hdb5 swap swap defaults 0 0
/dev/cdrom /mnt/cdrom udf,iso9660 noauto,owner,kudzu,ro 0 0
/dev/cdrom1 /mnt/cdrom1 udf,iso9660 noauto,owner,kudzu,ro 0 0
/dev/fd0 /mnt/floppy auto noauto,owner,kudzu 0 0
/dev/hda1 /mnt/ntfs ntfs defaults 0 0

This is the result of typing cat /etc/fstab in a terminal window, I got nothing with fdisk -l. (bash: fdisk: command not found)
Where am I supposed to type this? Again, sorry for my general newbyness, and thank you both for your patience.

Scott
 
Old 07-14-2004, 08:02 PM   #10
Bruce Hill
HCL Maintainer
 
Registered: Jun 2003
Location: McCalla, AL, USA
Distribution: Arch, Gentoo
Posts: 6,940

Rep: Reputation: 129Reputation: 129
Quote:
Originally posted by sford232
After I modified the fstab file, on boot I got a:
mount: mount: fs type auto not supported by kernel
netfs: Mounting other filesystems: failed
that I didn't notice before. Changed it back and it mounts fine.

/dev/hdb2 /fat32 vfat defaults 0 0

/dev/hda1 /mnt/ntfs ntfs defaults 0 0

This is the result of typing cat /etc/fstab in a terminal window, I got nothing with fdisk -l. (bash: fdisk: command not found)
Where am I supposed to type this? Again, sorry for my general newbyness, and thank you both for your patience.

Scott
I'm assuming here that your FAT32 partition mounts fine - looks like
your ntfs part should be okay, too. If you'll change your lines to
Code:
/dev/hda1        /mnt/ntfs       ntfs        user,umask=1000,ro,noauto 0 0
/dev/hdb2        /fat32          vfat        user,umask=1000,rw,noauto 0 0
then you can mount them both as a normal user and not as superuser (root).
In case you didn't know, you should never run your system as root - just su
to root for work that a normal user can't do.

As for the problem with fdisk -l that command has to be run as root. If for some
reason it doesn't work as root, try /sbin/fdisk -l and if that doesn't work then it's
not installed in Fedora (but I doubt that). We don't need that output now.

Nothing wrong with being a newbie. That's why LQ exists. The name used to say
LinuxQuestions.org Forums - Where Linux newbies come for help.

And when you post output from a terminal window, you can put [_code_] without the
underscores before it, and [_/code_] without the underscores after it, and that will
retain the formatting. Or you can use the Code button at the top of a Post Reply window.

Chris isn't, but I'm still a Linux newbie...
 
Old 07-14-2004, 09:10 PM   #11
sford232
LQ Newbie
 
Registered: Mar 2004
Posts: 26

Original Poster
Rep: Reputation: 15
That did it. I just copied and pasted the info into fstab before, this time I manually edited it, works as advertised. Thank you very much guys.

Scott
 
Old 07-14-2004, 10:19 PM   #12
sford232
LQ Newbie
 
Registered: Mar 2004
Posts: 26

Original Poster
Rep: Reputation: 15
By the way, the /sbin/fdisk -l worked

Code:
Disk /dev/hda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
 
   Device Boot      Start         End      Blocks   Id  System
/dev/hda1   *           1        9729    78148161    7  HPFS/NTFS
 
Disk /dev/hdb: 41.1 GB, 41174138880 bytes
16 heads, 63 sectors/track, 79780 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes
 
   Device Boot      Start         End      Blocks   Id  System
/dev/hdb1   *       30680       30882      102312   83  Linux
/dev/hdb2             204       30679    15359904    c  W95 FAT32 (LBA)
/dev/hdb3           30883       77700    23596272   83  Linux
/dev/hdb4           77701       79780     1048320    f  W95 Ext'd (LBA)
/dev/hdb5           77701       79780     1048288+  82  Linux swap
 
Partition table entries are not in disk order
Whats the deal with hdb4 and 5? Does that seem odd?

Scott
 
Old 07-14-2004, 10:34 PM   #13
Bruce Hill
HCL Maintainer
 
Registered: Jun 2003
Location: McCalla, AL, USA
Distribution: Arch, Gentoo
Posts: 6,940

Rep: Reputation: 129Reputation: 129
Quote:
Originally posted by sford232
By the way, the /sbin/fdisk -l worked

Code:
Disk /dev/hda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
 
   Device Boot      Start         End      Blocks   Id  System
/dev/hda1   *           1        9729    78148161    7  HPFS/NTFS
 
Disk /dev/hdb: 41.1 GB, 41174138880 bytes
16 heads, 63 sectors/track, 79780 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes
 
   Device Boot      Start         End      Blocks   Id  System
/dev/hdb1   *       30680       30882      102312   83  Linux
/dev/hdb2             204       30679    15359904    c  W95 FAT32 (LBA)
/dev/hdb3           30883       77700    23596272   83  Linux
/dev/hdb4           77701       79780     1048320    f  W95 Ext'd (LBA)
/dev/hdb5           77701       79780     1048288+  82  Linux swap
 
Partition table entries are not in disk order
Whats the deal with hdb4 and 5? Does that seem odd?

Scott
Not at all. You can only have 4 primary partitions per hard disk. So if you're
creating more than 4 after the third primary, the fourth because an extended
partition that contains all the logical partitions after those 3 primaries.

Therefore, /dev/hdb4 is the extended partition that contains your Linux swap
partition. Linux swap is what Linux uses for memory paging after your RAM
is consumed.

You did a great job of posting it with code - don't you think that looks better?

The reasons it didn't work for you with /sbin is because that's not in your path.
Search for path and you'll find out about it. I gotta run...
 
  


Reply



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
file permissions OK, but command permissions? stabu Linux - General 2 10-05-2005 12:00 PM
locking a usage policy file/ftp file permissions gbow Linux - Newbie 0 02-16-2004 05:35 AM
CVS - file permissions and file ownership Osten Linux - Software 3 01-18-2004 04:08 PM
file permissions and file owner won't change Nadim Slackware 5 11-29-2003 06:03 PM
Changing file permissions on a SAMBA file share apenney Linux - Software 0 02-11-2002 04:42 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora

All times are GMT -5. The time now is 03:12 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
Open Source Consulting | Domain Registration