LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 06-11-2008, 09:19 PM   #1
huklBerry
LQ Newbie
 
Registered: Jun 2008
Posts: 4

Rep: Reputation: 0
chmod command fails with "Read-only file system"


Hi all,

I'm getting a "Read-only file system" error when I try to do the chmod, mkdir, touch, or rm commands. I suspect any file/directory manipulation command will fail with the "Read-only file system" message. I can still cd to any directory, 'ls' still works, I can vi files and view them but I can't modify them. Has anyone run into this problem before or have any ideas?

[root@localhost /> whoami
root
drwxrwxrwx 20 root root 4096 May 31 18:29 www
[root@localhost www> touch testing
touch: cannot touch `testing': Read-only file system

What I was doing when this problem started....
I telnet'd to my linux machine. I created a directory successfully in the root directory. I then did a 'cp -rf /MYDIRECTORY /DESTINATIONDIR' to copy all the contents of one directory to a new directory. This is a big directory and at some point if failed with the "Read-only file system" message. After that my chmod, mkdir and rm commands started failing. So, currently I cannot do any manipulation on any file on my machine or create any new file/directory. Ftp also fails with the error message....
500 OOPS: failed to open xferlog log file:/var/log/xferlog
[root@localhost log> ll xferlog
-rw------- 1 root root 0 Jun 8 04:02 xferlog

Telnet still works.
The 'fsck' command didn't change the behavior at all.

Any help would be greatly appreciated.

Some system info.....
Linux Fedora Core version: 2.6.11-1.1369_FC4

[root@localhost /> df -h -T
Filesystem Type Size Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
ext3 37G 9.6G 26G 28% /
/dev/hda1 ext3 99M 9.8M 84M 11% /boot
/dev/shm tmpfs 125M 0 125M 0% /dev/shm

[root@localhost cgi-bin> cat /proc/mounts
rootfs / rootfs rw 0 0
/dev /dev tmpfs rw 0 0
/dev/root / ext3 ro 0 0
none /selinux selinuxfs rw 0 0
/proc /proc proc rw,nodiratime 0 0
/proc/bus/usb /proc/bus/usb usbfs rw 0 0
/sys /sys sysfs rw 0 0
/dev/devpts /dev/pts devpts rw 0 0
/dev/hda1 /boot ext3 rw 0 0
/dev/shm /dev/shm tmpfs rw 0 0
none /proc/sys/fs/binfmt_misc binfmt_misc rw 0 0
sunrpc /var/lib/nfs/rpc_pipefs rpc_pipefs rw 0 0
automount(pid2169) /net autofs rw 0 0
automount(pid2133) /misc autofs rw 0 0

Last edited by huklBerry; 06-11-2008 at 09:26 PM.
 
Old 06-11-2008, 10:17 PM   #2
osor
HCL Maintainer
 
Registered: Jan 2006
Distribution: (H)LFS, Gentoo
Posts: 2,450

Rep: Reputation: 70
Quote:
Originally Posted by huklBerry View Post
/dev/root / ext3 ro 0 0
There’s your problem.

As root, try
Code:
# mount -o remount,rw /
As for how this happened to begin with, I think there is some other issue we are not seeing.
 
Old 06-12-2008, 07:54 PM   #3
huklBerry
LQ Newbie
 
Registered: Jun 2008
Posts: 4

Original Poster
Rep: Reputation: 0
Thanks for the suggestion OSOR but I must be doing something wrong. Here's what I get when I run the 'mount' command as root....

[root@localhost /> pwd
/
[root@localhost etc> mount -o remount,rw /
mount: block device /dev/VolGroup00/LogVol00 is write-protected, mounting read-only

I also did a 'fdisk -l' which gave me no output at all.

Any idea why I am getting that message?

A little more info....

[root@localhost etc> cat fstab
# This file is edited by fstab-sync - see 'man fstab-sync' for details
/dev/VolGroup00/LogVol00 / ext3 defaults 1 1
LABEL=/boot /boot ext3 defaults 1 2
/dev/devpts /dev/pts devpts gid=5,mode=620 0 0
/dev/shm /dev/shm tmpfs defaults 0 0
/dev/proc /proc proc defaults 0 0
/dev/sys /sys sysfs defaults 0 0
/dev/VolGroup00/LogVol01 swap swap defaults 0 0
/dev/fd0 /media/floppy auto pamconsole,exec,noauto,managed 0 0
/dev/hdc /media/cdrecorder auto pamconsole,exec,noauto,managed 0 0

Last edited by huklBerry; 06-12-2008 at 08:00 PM.
 
Old 06-12-2008, 10:29 PM   #4
osor
HCL Maintainer
 
Registered: Jan 2006
Distribution: (H)LFS, Gentoo
Posts: 2,450

Rep: Reputation: 70
Quote:
Originally Posted by huklBerry View Post
mount: block device /dev/VolGroup00/LogVol00 is write-protected, mounting read-only
What are the permissions on that block device? Specifically, what does
Code:
ls -l /dev/VolGroup00/LogVol00
output? They should be 0660 or similar (at the very least, writable by root). If not, try changing it manually with chmod. If that doesn’t work, you might have to use lvm.
 
Old 06-12-2008, 11:03 PM   #5
huklBerry
LQ Newbie
 
Registered: Jun 2008
Posts: 4

Original Poster
Rep: Reputation: 0
Here is the listing of the LogVol00...

[root@localhost etc> ls -l /dev/VolGroup00/LogVol00
lrwxrwxrwx 1 root root 31 May 12 18:59 /dev/VolGroup00/LogVol00 -> /dev/mapper/VolGroup00-LogVol00
 
Old 06-13-2008, 11:40 AM   #6
osor
HCL Maintainer
 
Registered: Jan 2006
Distribution: (H)LFS, Gentoo
Posts: 2,450

Rep: Reputation: 70
Quote:
Originally Posted by huklBerry View Post
[root@localhost etc> ls -l /dev/VolGroup00/LogVol00
lrwxrwxrwx 1 root root 31 May 12 18:59 /dev/VolGroup00/LogVol00 -> /dev/mapper/VolGroup00-LogVol00
I meant the actual block device, not the link to it. Try
Code:
ls -lL /dev/mapper/VolGroup00-LogVol00
 
Old 06-13-2008, 12:45 PM   #7
matthewg42
Senior Member
 
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 63
If it's not just a part of your normal configuration, check your system log. Filesystems are sometimes automatically re-mounted as read only if problems with the device are detected.
 
Old 06-13-2008, 04:13 PM   #8
huklBerry
LQ Newbie
 
Registered: Jun 2008
Posts: 4

Original Poster
Rep: Reputation: 0
Ya, the actual file might be more useful than the link. Sorry about that...

[redbird@localhost ~]$ ls -lL /dev/mapper/VolGroup00-LogVol00
brw-rw---- 1 root disk 253, 0 May 12 14:59 /dev/mapper/VolGroup00-LogVol00

I'm looking at the system logs in the /var/log/messages files. Is that what you mean? Anyway, the messages file hasn't been updated since this problem occurred on June 11. The last couple logs are below but they are just session open/close.

Jun 11 17:01:02 localhost crond(pam_unix)[4021]: session opened for user root by (uid=0)
Jun 11 17:01:02 localhost crond(pam_unix)[4021]: session closed for user root
Jun 11 18:01:02 localhost crond(pam_unix)[4505]: session opened for user root by (uid=0)
Jun 11 18:01:02 localhost crond(pam_unix)[4505]: session closed for user root
Jun 11 18:20:23 localhost su(pam_unix)[32543]: session closed for user root
Jun 11 18:21:50 localhost su(pam_unix)[32698]: session closed for user root
Jun 11 18:59:59 localhost su(pam_unix)[5008]: session opened for user root by (uid=500)
Jun 11 19:01:02 localhost crond(pam_unix)[5047]: session opened for user root by (uid=0)
Jun 11 19:01:02 localhost crond(pam_unix)[5047]: session closed for user root
Jun 11 19:09:14 localhost su(pam_unix)[393]: session closed for user root
 
Old 06-13-2008, 04:35 PM   #9
osor
HCL Maintainer
 
Registered: Jan 2006
Distribution: (H)LFS, Gentoo
Posts: 2,450

Rep: Reputation: 70
Quote:
Originally Posted by huklBerry View Post
Ya, the actual file might be more useful than the link. Sorry about that...

[redbird@localhost ~]$ ls -lL /dev/mapper/VolGroup00-LogVol00
brw-rw---- 1 root disk 253, 0 May 12 14:59 /dev/mapper/VolGroup00-LogVol00
Well, the device itself seems to be read-write. Perhaps the underlying physical volume has bad permissions. Why else would you get a write-protected message?

Do you know the physical volume(s) which comprise VolGroup00-LogVol00? If not, you should be able to figure it out with lvm. Once you do, check the permissions on those block devices.
 
  


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] which background file is read by "useradd" command ? vikas027 Solaris / OpenSolaris 1 05-09-2008 02:02 AM
list file system linux supports "please give the command or system call" varun_shrivastava Linux - General 4 01-09-2007 08:28 AM
System hangs on boot - "Mounting root file system" fails with Via VT6410 enabled Eagleorn Linux - Hardware 3 09-21-2006 01:58 PM
Can't boot Mandrake 10.0, "Cannot touch, Read-Only File System" RasutoIbuki Mandriva 5 07-23-2004 09:57 PM
"mkdir: cannot create directory `foo': Read-only file system" on FAT32 maddes Linux - Hardware 1 11-26-2003 07:19 PM


All times are GMT -5. The time now is 08:39 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration