LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   chmod wont work (https://www.linuxquestions.org/questions/linux-newbie-8/chmod-wont-work-806780/)

cspearsall 05-09-2010 08:53 AM

chmod wont work
 
I am trying to change the /storage to 777. I am logged in as root and the owner of the directory is root, but no matter what I do it will only give me -drwx-xr-x and will not let me write or transfer files to this directory. Any suggestions.

cspearsall 05-09-2010 08:54 AM

Also this is Centos if that makes a difference

colucix 05-09-2010 09:07 AM

Hi and welcome to LinuxQuestions!

There is a chance the filesystem is mounted readonly, for some reason. Try the following to look at the current mount options:
Code:

mount | grep storage
Moreover, is this an external hard disk? What is the filesystem type?
Code:

df -T /storage

rjlee 05-09-2010 10:34 AM

Quote:

Originally Posted by cspearsall (Post 3962119)
I am trying to change the /storage to 777. I am logged in as root and the owner of the directory is root, but no matter what I do it will only give me -drwx-xr-x and will not let me write or transfer files to this directory. Any suggestions.

I'm guessing that /storage is a mountpoint.

It may be that the mount options for the /storage filesystem don't allow other users to write to the filesystem, in which case the permissions displayed are correct and you won't be able to change them with chmod (which will only change the underlying directory in the / filesystem).

You can run the mount command (no arguments) to see the filesystem's current mount options, and you should be able to edit them in /etc/fstab. You need to add the "users" option to be able to write it for everyone, or the "user=name" option to limit to a specific user.

Hope that helps,

—Robert J Lee

cspearsall 05-09-2010 07:08 PM

Mount command
 
/dev/sda1 on /storage type ext3 (rw)
/dev/sdb1 on /storage1 type ext3 (rw)
/dev/sdc1 on /storage2 type ext3 (rw)
/dev/sdd1 on /storage3 type vfat (rw)


results of the mount command

cspearsall 05-09-2010 07:16 PM

chown
 
It would let me change the permissions when i changed the group and owner to nobody (not a very secure system but no biggie). But I would still like to know why that happened

rjlee 05-10-2010 01:02 AM

Quote:

Originally Posted by cspearsall (Post 3962651)
It would let me change the permissions when i changed the group and owner to nobody (not a very secure system but no biggie). But I would still like to know why that happened

What are the permissions of the / directory?
Code:

ls -l /

cspearsall 05-11-2010 06:26 AM

Changed a lot of stuff
 
The difference between this mount point and the others that I wasn't having problems with was the file system type. The others were ext3 and this one was auto. Maybe that had something to do with it?

alli_yas 05-11-2010 07:15 AM

CentOS 5.4 should default to ext3 if I'm not mistaken (so setting to auto will result in an ext3 filesystem anyway)

Run the following command:

Code:

#df -T
This will show all your filesystem types - I'm pretty sure the filesystem has nothing to do with it.

Please post the output of:

Code:

#ls -la /
and

Code:

#ls -la /storage
Cheers
Yas

cspearsall 05-12-2010 08:25 PM

ls -la
drwxr-xr-x 18 root root 4096 May 10 19:45 .
drwxr-xr-x 28 root root 4096 May 10 19:44 ..
-rwxr-xr-x 1 root root 1513 Nov 4 2009 anaconda-ks.cfg
-rwxr-xr-x 1 root root 11504 May 10 22:00 .bash_history
-rwxr-xr-x 1 root root 24 Jan 6 2007 .bash_logout
-rwxr-xr-x 1 root root 191 Jan 6 2007 .bash_profile
-rwxr-xr-x 1 root root 176 Jan 6 2007 .bashrc
-rwxr-xr-x 1 root root 100 Jan 6 2007 .cshrc
drwxr-xr-x 2 root root 4096 Nov 13 08:33 Desktop
drwxr-xr-x 2 root root 4096 Nov 13 08:33 .eggcups
drwxr-xr-x 4 root root 4096 May 10 19:45 .gconf
drwxr-xr-x 2 root root 4096 May 10 20:05 .gconfd
drwxr-xr-x 3 root root 4096 Nov 13 08:33 .gnome
drwxr-xr-x 6 root root 4096 Jan 7 13:48 .gnome2
drwxr-xr-x 2 root root 4096 Nov 7 2009 .gnome2_private
drwxr-xr-x 2 root root 4096 Nov 13 08:33 .gstreamer-0.10
-rwxr-xr-x 1 root root 81 Nov 13 08:33 .gtkrc-1.2-gnome2
-rwxr-xr-x 1 root root 4725 May 10 19:45 .ICEauthority
-rwxr-xr-x 1 root root 42756 Nov 4 2009 install.log
-rwxr-xr-x 1 root root 5904 Nov 4 2009 install.log.syslog
-rwxr-xr-x 1 root root 0 Nov 12 20:33 .lesshst
drwxr-xr-x 3 root root 4096 Nov 13 08:33 .metacity
drwxr-xr-x 4 root root 4096 Nov 13 08:34 .mozilla
drwxr-xr-x 3 root root 4096 Nov 13 08:33 .nautilus
drwxr-xr-x 3 root root 4096 Nov 14 19:43 .openoffice.org2.0
-rwxr-xr-x 1 root root 651 Jan 7 13:48 .recently-used
-rwxr-xr-x 1 root root 2639 Apr 10 17:00 .recently-used.xbel
drwxr-xr-x 3 root root 4096 Nov 13 08:33 .redhat
-rwxr-xr-x 1 root root 195 Nov 4 2009 scsrun.log
-rwxr-xr-x 1 root root 198 Nov 26 00:28 .serverauth.5101
-rwxr-xr-x 1 root root 129 Jan 6 2007 .tcshrc
drwxr-xr-x 4 root root 4096 Nov 29 18:43 .thumbnails
drwxr-xr-x 2 root root 4096 Nov 13 08:33 .Trash
drwxr-xr-x 2 root root 4096 May 10 19:45 .vnc
-rwxr-xr-x 1 root root 345 May 10 19:45 .Xauthority

ls -la /storage 3

total 60
drwxrwxrwx 7 nobody nobody 4096 May 10 19:56 .
drwxr-xr-x 28 root root 4096 May 10 19:44 ..
drwxrwxrwx 24 root root 4096 May 11 00:29 Applications
drwxrwxrwx 9 root root 4096 May 11 00:00 Books
drwxrwxrwx 2 root root 16384 May 10 19:52 lost+found
drwxrwxrwx 7 root root 4096 May 11 05:03 Personal Files
drwxrwxrwx 64 root root 4096 May 10 23:09 Pictures

alli_yas 05-13-2010 02:21 AM

Hi

Quote:

ls -la
drwxr-xr-x 18 root root 4096 May 10 19:45 .
drwxr-xr-x 28 root root 4096 May 10 19:44 ..
-rwxr-xr-x 1 root root 1513 Nov 4 2009 anaconda-ks.cfg
-rwxr-xr-x 1 root root 11504 May 10 22:00 .bash_history
-rwxr-xr-x 1 root root 24 Jan 6 2007 .bash_logout
-rwxr-xr-x 1 root root 191 Jan 6 2007 .bash_profile
-rwxr-xr-x 1 root root 176 Jan 6 2007 .bashrc
-rwxr-xr-x 1 root root 100 Jan 6 2007 .cshrc
drwxr-xr-x 2 root root 4096 Nov 13 08:33 Desktop
drwxr-xr-x 2 root root 4096 Nov 13 08:33 .eggcups
drwxr-xr-x 4 root root 4096 May 10 19:45 .gconf
drwxr-xr-x 2 root root 4096 May 10 20:05 .gconfd
drwxr-xr-x 3 root root 4096 Nov 13 08:33 .gnome
drwxr-xr-x 6 root root 4096 Jan 7 13:48 .gnome2
drwxr-xr-x 2 root root 4096 Nov 7 2009 .gnome2_private
drwxr-xr-x 2 root root 4096 Nov 13 08:33 .gstreamer-0.10
-rwxr-xr-x 1 root root 81 Nov 13 08:33 .gtkrc-1.2-gnome2
-rwxr-xr-x 1 root root 4725 May 10 19:45 .ICEauthority
-rwxr-xr-x 1 root root 42756 Nov 4 2009 install.log
-rwxr-xr-x 1 root root 5904 Nov 4 2009 install.log.syslog
-rwxr-xr-x 1 root root 0 Nov 12 20:33 .lesshst
drwxr-xr-x 3 root root 4096 Nov 13 08:33 .metacity
drwxr-xr-x 4 root root 4096 Nov 13 08:34 .mozilla
drwxr-xr-x 3 root root 4096 Nov 13 08:33 .nautilus
drwxr-xr-x 3 root root 4096 Nov 14 19:43 .openoffice.org2.0
-rwxr-xr-x 1 root root 651 Jan 7 13:48 .recently-used
-rwxr-xr-x 1 root root 2639 Apr 10 17:00 .recently-used.xbel
drwxr-xr-x 3 root root 4096 Nov 13 08:33 .redhat
-rwxr-xr-x 1 root root 195 Nov 4 2009 scsrun.log
-rwxr-xr-x 1 root root 198 Nov 26 00:28 .serverauth.5101
-rwxr-xr-x 1 root root 129 Jan 6 2007 .tcshrc
drwxr-xr-x 4 root root 4096 Nov 29 18:43 .thumbnails
drwxr-xr-x 2 root root 4096 Nov 13 08:33 .Trash
drwxr-xr-x 2 root root 4096 May 10 19:45 .vnc
-rwxr-xr-x 1 root root 345 May 10 19:45 .Xauthority
The above is ls -la of the root home dir (/root) - please post the output of:

Code:

#ls -la /
Which is the root directory itself.

Thanks,
Yas

cspearsall 05-13-2010 06:22 AM

ls -la /
 
total 182
drwxr-xr-x 28 root root 4096 May 10 19:44 .
drwxr-xr-x 28 root root 4096 May 10 19:44 ..
-rw-r--r-- 1 root root 0 May 10 19:44 .autofsck
drwxr-xr-x 3 root root 4096 Nov 11 22:05 bin
drwxr-xr-x 4 root root 1024 Nov 4 2009 boot
drwxr-xr-x 13 root root 3880 May 10 19:45 dev
drwxr-xr-x 108 root root 12288 May 10 19:54 etc
drwxr-xr-x 4 root root 4096 Nov 10 2009 home
drwxr-xr-x 11 root root 4096 Nov 4 2009 lib
drwxr-xr-x 7 root root 4096 Nov 4 2009 lib64
drwx------ 2 root root 16384 Nov 4 2009 lost+found
drwxr-xr-x 2 root root 4096 Mar 11 2009 media
drwxr-xr-x 2 root root 0 May 10 19:44 misc
drwxr-xr-x 2 root root 4096 Mar 11 2009 mnt
drwxr-xr-x 2 root root 0 May 10 19:44 net
drwxr-xr-x 2 root root 4096 Mar 11 2009 opt
dr-xr-xr-x 162 root root 0 May 10 19:43 proc
drwxr-xr-x 18 root root 4096 May 10 19:45 root
drwxr-xr-x 2 root root 12288 Nov 4 2009 sbin
drwxr-xr-x 4 root root 0 May 10 19:43 selinux
drwxr-xr-x 2 root root 4096 Mar 11 2009 srv
drwxrwxrwx 6 nobody nobody 4096 Nov 30 11:13 storage
drwxrwxrwx 7 nobody nobody 4096 Nov 30 00:43 storage1
drwxrwxrwx 5 nobody nobody 4096 Dec 1 13:06 storage2
drwxrwxrwx 7 nobody nobody 4096 May 10 19:56 storage3
drwxr-xr-x 11 root root 0 May 10 19:43 sys
drwxrwxrwt 17 root root 4096 May 13 04:02 tmp
drwxr-xr-x 15 root root 4096 Nov 4 2009 usr
drwxr-xr-x 25 root root 4096 Nov 4 2009 var

cspearsall 05-13-2010 06:24 AM

this is after I changed the file system to ext3. It seemed to work, but I don't know why it wouldn't work before


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