LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 02-08-2006, 02:01 AM   #1
Swakoo
Member
 
Registered: Apr 2005
Distribution: Red Hat / Fedora / CentOS
Posts: 508

Rep: Reputation: 30
file systems becomes read-only


Hi guys,

just got back from a long break, and realise i wasn't to make changes (copy, write, change permission etc) on a particular server. It always says it is a "Read-only file system" only...

Did some search, some people were saying if a system change to a read-only file system, it could be signs that the harddisk is failing? Is it so?

For this server, it affects /home, I tried writing to /tmp it was ok. I reboot the machine and now all is fine...

read somewhere abt checking /etc/fstab, but I am not sure what to look out for. So thought I could do with some advice here...

many thanks
 
Old 02-08-2006, 02:33 AM   #2
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654
I doubt if you would find the answer looking in /etc/fstab. I don't see why that would have been changed. There is a "ro" mount option. You can check exactly what options are currently being used on the partition by looking at the output of the "mount" command or reading the /etc/mtab file.

You may want to start by reading the boot logs. When the system first boots up, the root drive is in memory. I thing that the drives are at first mounted ro until they check out OK. Here is a fragment from my Laptops /var/log/boot.msg

Code:
Checking file systems...
fsck 1.38 (30-Jun-2005)
/dev/hda5: clean, 39/38152 files, 16266/152584 blocks
Reiserfs super block in block 16 on 0x307 of format 3.6 with standard journal
Blocks (total/free): 393584/293414 by 4096 bytes
Filesystem is clean
Replaying journal..
Reiserfs journal '/dev/hda7' in blocks [18..8211]: 0 transactions replayed
Checking internal tree..finished
doneSetting up kernel module dependencies (if required)done
Mounting local file systems...
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
tmpfs on /dev/shm type tmpfs (rw)
devpts on /dev/pts type devpts (rw,mode=0620,gid=5)
/dev/hda5 on /boot type ext3 (rw,acl,user_xattr)
/dev/hda7 on /var type reiserfs (rw,acl,user_xattr)
/dev/hda1 on /windowsxp type ntfs (ro,uid=1000,gid=100,fmask=0027,dmask=0227)
doneSetting up the CMOS clockdone
Creating /var/log/boot.msg
I think that this is one area in the boot logs that might turn up an answer.
There are many things that go on in parallel when the system is starting. So don't count on the order of things in this example. Also check /var/log/warn.
For example, look at this line from mine:
Code:
Jan 20 18:37:13 hpamd64 kernel: NTFS-fs warning (device hda1): load_system_files(): Volume is dirty.  Will not be able to remount read-write.  Run chkdsk and mount in Windows.
In this case, since I hardly ever run Windows, and since this filesystem would be mounted read-only anyway, I hadn't noticed before.

One very remote cause, is that someone somehow remounted the /home partition with the read-only option.

If you verify on this machine that the /home partition is mounted read-only,
then log in as root, ( the root users home directory is on the root partition ), switch to single user mode, and try to umount and then mount the partition.
Watch what the response is in the console. If there is a problem, you will be told.

It also wouldn't hurt to scan the drive for errors. If there are some, and they are repaired, make a point to check the drive again in the near future. It is possible that the drive is going out.

Last edited by jschiwal; 02-08-2006 at 02:57 AM.
 
Old 02-09-2006, 04:36 AM   #3
Swakoo
Member
 
Registered: Apr 2005
Distribution: Red Hat / Fedora / CentOS
Posts: 508

Original Poster
Rep: Reputation: 30
hi there, some questions:

1) /var/log/warn - what kind of log is it?
2) What do you mean by Single user mode?
3) So I can actually mount/umount a partition anytime?

The partition became read only suddenly.

anyway, today.. the server in question crashed. Could not finish booting up. It has filesystem error.. alot of EXT3 errors while booting (especially when I did file integrity check). While checking journal (what's that?) it will start showing these error... took the harddisk out and replaced it with another one. Though I feel its just an OS problem... but I'm not comfortable with the harddisk anymore.

Guys can give me some pointers on the errors? Guess I'm still a noob after the past year on it... only learn when things happen...
 
Old 02-09-2006, 07:23 AM   #4
Dtsazza
Member
 
Registered: Oct 2005
Location: Oxford, UK
Distribution: Debian Etch (w/ dual-boot XP for gaming)
Posts: 282

Rep: Reputation: 30
Quote:
Originally Posted by Swakoo
1) /var/log/warn - what kind of log is it?
What do you mean by "what kind of log"? Seriously, it's just a plain old text file that contains descriptions of system events that are non-fatal but still not quite right.
Quote:
Originally Posted by Swakoo
2) What do you mean by Single user mode?
Single user mode is a runlevel whereby only one user (root) exists, and it boots much less services than usual, just the essential ones, so you can fix any errors that stop your system from booting normally.
Quote:
Originally Posted by Swakoo
3) So I can actually mount/umount a partition anytime?
Yep, though only root can do it (with the exception of partitions listed in /etc/fstab, which can be mounted by anyone and automatically take the options in that file). Also, you can only umount a partition that's not in use, so while you can theoretically umount the root partition (/), doing so in practice will be tricky if not impossible.

Quote:
Originally Posted by Swakoo
While checking journal (what's that?)
Journalled filesystems use a transactional model of storage - basically, before it writes anything it basically says "here's what I'm going to do", and puts that in the journal. Then it modifies the files (or whatever), and then it comes back to the journal and says "OK, it's done now" (A little more complex in practice, but that's the theory of it). The purpose of these extra steps is so that if the hard drive is forcibly interrupted halfway through a write (a crash or powercut etc.), it can just replay the events from the journal so a file is never left in a corrupted state. It's a good idea and generally works very well.

Quote:
Originally Posted by Swakoo
took the harddisk out and replaced it with another one. Though I feel its just an OS problem... but I'm not comfortable with the harddisk anymore.

Guys can give me some pointers on the errors? Guess I'm still a noob after the past year on it... only learn when things happen...
(my emphasis) Hmm... not sure I get your priorities - surely if it's an OS error it'll toast any drive you stick in there? In any case, the stability of Linux with ext3 has been pretty well established. It's more likely to be either a hardware error (how old is the drive? HDs are sensitive and don't last forever), or some kind of hostile environment. Does the computer often get turned off without shutdowns, or crash? Do you kill processes often (especially with kill -9)? All these things are likely to cause HD corruption, and while journals help vastly with reducing the damage, there's only so much they can do.
 
Old 02-09-2006, 09:25 PM   #5
Swakoo
Member
 
Registered: Apr 2005
Distribution: Red Hat / Fedora / CentOS
Posts: 508

Original Poster
Rep: Reputation: 30
the server have been in action for 8 months or so, brand new. From Dell though.
I have a couple of other machine running the same specs at the same time... so perhaps its just one of those days...?

one thing abt umount a partition, reason being i tried to do fsck but it says if i do it on a mounted partition i risk "severe" damage to it.. so thought i better check the procedure of umount an active partition...
 
Old 02-10-2006, 12:34 AM   #6
StevenO
Member
 
Registered: Jan 2006
Distribution: Slackware 10.2
Posts: 45

Rep: Reputation: 15
Sheesh. Im also having the same problem. But my fs is fat though.
http://www.linuxquestions.org/questi...d.php?t=413499
 
Old 02-10-2006, 04:02 PM   #7
Dtsazza
Member
 
Registered: Oct 2005
Location: Oxford, UK
Distribution: Debian Etch (w/ dual-boot XP for gaming)
Posts: 282

Rep: Reputation: 30
Quote:
Originally Posted by Swakoo
[I] thought i better check the procedure of umount an active partition...
Yes, good plan. As it happens, it's not like fsck where you can choose to run it anyway - if umount lets you unmount the partition, it's done it safely. If the partition's in use, you simply aren't allowed to unmount it (makes sense really). So there's certainly no harm or danger in trying to umount a partition.
 
Old 02-13-2006, 04:06 AM   #8
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654
With computers, if there is a defect, it will usually show up in the first year. Sounds like there was a problem with the drive from the start, it just reached the critical stage. I assume it's still under warrantee.

And yes, as root, running "mount -a" will try to mount everything in your /etc/fstab file, provided that the 'noauto' option isn't used. The noauto keyword would be used for a cdrom device for example, because a cdrom disc may not be present in the drive. You can also change some option with a mount command that uses the 'remount' option.

Last edited by jschiwal; 02-13-2006 at 04:10 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
File Systems spaceballs Slackware 57 09-27-2007 07:05 AM
Is arrangement of file systems will differ if we copy a file from FAT 32 to ext 3 ? anindyanuri Linux - Software 2 02-20-2005 11:39 AM
File systems gpit2286 Linux - General 2 02-09-2005 10:02 AM
file systems jdctx Linux - General 6 03-11-2002 11:05 PM
Change from Read only to Read Write File System? justiceisblind Linux - Newbie 3 03-03-2002 07:23 PM


All times are GMT -5. The time now is 01:17 AM.

Main Menu
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