LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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 08-10-2004, 07:35 PM   #1
Kanaflloric
Member
 
Registered: Jun 2004
Location: Canada
Distribution: Slackware 10.0
Posts: 80

Rep: Reputation: 15
can't chmod under root


Hi

here is what i tried (under root) :

# chmod o+w /DataDos

and here is what I got :

chmod: changing permissions of `/DataDos' (requested: 0757, actual: 0755): Opération non permise

why can't I change this file mode ?
Is it because it is a Fat32 directory ?
 
Old 08-10-2004, 07:41 PM   #2
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,339

Rep: Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550
"why can't I change this file mode ?
Is it because it is a Fat32 directory ? "

If this directory is a mountpoint then you cannot change the file mode while a file system is mounted on the directory. If this is the case then umount the file system with:
umount /DataDos

Then do your chmod command and remount the file system on /DataDos.


------------------
Steve Stites
 
Old 08-11-2004, 07:31 PM   #3
Kanaflloric
Member
 
Registered: Jun 2004
Location: Canada
Distribution: Slackware 10.0
Posts: 80

Original Poster
Rep: Reputation: 15
Ok.

As you said, /DataDos is a mounting point.
chmod was successful after I umount it.

But how can I chmod on sub-directories and files under /DataDos ?

I can't see them when it is not mounted, and I still have the same message if I try chmod on any subdirectories under /DataDos.

Is there something in fstab I should add ?
 
Old 08-11-2004, 07:50 PM   #4
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,339

Rep: Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550
"I can't see them when it is not mounted, and I still have the same message if I try chmod on any subdirectories under /DataDos."

The Fat32 file system does not have any fields available to keep track of permissions and ownership. So Linux fakes it by giving every file and directory in a Fat32 file system the same permissions and ownership as the mount point directory. You cannot change the permissions or ownership of just some directories or files in the Fat32 file system mounted on /DataDos.

-----------------------------
Steve Stites
 
Old 08-12-2004, 07:26 PM   #5
Kanaflloric
Member
 
Registered: Jun 2004
Location: Canada
Distribution: Slackware 10.0
Posts: 80

Original Poster
Rep: Reputation: 15
I understand.

But I still can't do anything.

Each time I try :

# chmod o+w /DataDos

it seems to works, but as soon as I mount the directory, my change is lost, and permissions come back to 755.

It seems that only root can write inside a Fat32 directory. I tried with another Fat32 hard drive, and this is the same thing : I can make chmod 757, but after having mounted the drive, it comes back to 755.
 
Old 08-12-2004, 08:05 PM   #6
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,339

Rep: Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550
"it seems to works, but as soon as I mount the directory, my change is lost, and permissions come back to 755."

mount also looks for information in /etc/fstab. See if there is an entry in /etc/fstab for the Fat32 partition and if there is check the entry for a conflict with what you are trying to do.

-----------------------------
Steve Stites
 
Old 08-12-2004, 10:15 PM   #7
Kanaflloric
Member
 
Registered: Jun 2004
Location: Canada
Distribution: Slackware 10.0
Posts: 80

Original Poster
Rep: Reputation: 15
The first device on wich i tried chmod (hdb1) has an entry in /etc/fstab.
But the second one (hda1) has not, so it can't be in conflict with something in fstab.

Both of them are fat32, and both lost my permissions changes as soon I mount them...

It seems to be a hard problem ? Is there a doc anywhere I should read ?
 
Old 08-12-2004, 10:20 PM   #8
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Quote:
Originally posted by Kanaflloric
The first device on wich i tried chmod (hdb1) has an entry in /etc/fstab.
But the second one (hda1) has not, so it can't be in conflict with something in fstab.

Both of them are fat32, and both lost my permissions changes as soon I mount them...

It seems to be a hard problem ? Is there a doc anywhere I should read ?
Quote:
The Fat32 file system does not have any fields available to keep track of permissions and ownership. So Linux fakes it by giving every file and directory in a Fat32 file system the same permissions and ownership as the mount point directory. You cannot change the permissions or ownership of just some directories or files in the Fat32 file system mounted on /DataDos.


Cheers,
Tink
 
Old 08-12-2004, 10:26 PM   #9
cantonboy
LQ Newbie
 
Registered: Mar 2004
Posts: 6

Rep: Reputation: 0
Kanaflloric:

I'm a newbie too but I guess I know your problem.

Look at the line that describes your hdb1 in your fstab. I'll bet it has an "ro" specified somewhere, which means "readonly". Change it to "rw" -- read/write -- and see if it helps.

Beware that all the files in your fat32 partition will share the same permission setting.
 
Old 08-12-2004, 10:36 PM   #10
tim1235
Member
 
Registered: Aug 2004
Location: Melbourne, Australia
Distribution: fc5/Gentoo
Posts: 57

Rep: Reputation: 15
I agree with CantonBoy

Your fstab should read somthing like:
/dev/hda1 /DataDos vfat auto,rw 0 0

Which will enable you to have write permissions to you /DataDos partition.
You cannot set directories under this partion with different permissions they are either
ro = read only or rw = read/write

te
 
Old 08-13-2004, 11:06 PM   #11
Kanaflloric
Member
 
Registered: Jun 2004
Location: Canada
Distribution: Slackware 10.0
Posts: 80

Original Poster
Rep: Reputation: 15
You are right : the file system is read only.

I understood that all fat32 files and subdirectories can't be changed, and share the same permissions as the mounting point. What I didn't know, is that you do not apply new permissions on the mountpoint by using chmod !

This have to be made by using the mount command with two options :
For those who'll read this thread with a similary problem, here is an example :

# mount /dev/hda1 /mnt/Fat32HD/ -t vfat -o rw,umask=020

umask is really important, because it is the permissions mask. Without it, you stay read only, wich is what happend to me.

Thank you for your help.

Last edited by Kanaflloric; 08-14-2004 at 04:19 PM.
 
  


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
Root user unable to rm, mv or chmod Zoar Linux - Newbie 3 10-10-2019 03:12 PM
need to chmod lots o files, without logging in a root Seribicus Linux - Software 6 02-18-2005 12:29 PM
I'm an idiot: chmod -R * in / as root. Fix? fez Linux - General 9 11-23-2003 01:19 AM
chmod vs chown on some root files and yes apps ergo_sum Linux - Newbie 3 11-12-2003 10:49 AM
Cant access /dev/dsp as anything but root. What do I chmod? JoeLinux Linux - Hardware 4 10-07-2002 09:59 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:56 PM.

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