-   Linux - Newbie (
-   -   File System Integrity Check (

Palula 08-01-2005 08:29 PM

File System Integrity Check
Hi everybody.
I am a new proud owner of a Linux Router/Firewall at my home. And I have to thank very much the community and a special thank to Mara (moderator) for her patience and support.

But with every new solution, problems come along. And here it comes!!!

My Linux firewall doesnt work on nobreaks (they are far too expensive here in Brazil for me to by one on a home basis), so sometimes the connection can drop because of electrical failures/blackouts... So, now Im worried about the integrity of my file system and would like to know how can I monitor/fix file system inconsistencies?

Is there anything that works sort of like windows 95/98 scandisk?

I worry a lot about this because of the time and work put on to my router for it to work. So I would like to periodically (lets say on a weekly basis, for a start) check for the integrity of my file system. :-)

My file system is ext3, by the way.

Thanks again!!! :)
Palula Brasil.

rshaw 08-01-2005 08:31 PM

Palula 08-01-2005 09:14 PM

Okay, Ive already read about fsck, but the thing is that when I run it, this message appears:

WARNING!!! Running E2FSCK on mounted filesystem may cause SEVERE filesystem damage.
Is this a joke? Im a newbie!!! Of course I will not run that thing on my file system.

Can anybody help?

btmiller 08-02-2005 12:50 AM

You shouldn't run fsck on a mounted filesystem, like the message says (if you remount the filesystewm read only, though, it should be OK). Fsck will give you an option to run at boot if there's an unclean shutdown, before filesystems are mounted, if you choose, Generally, if you have a journalling filesystem like ext3 or reiserfs the chance of corruption is greatly lessened.

Electro 08-02-2005 01:29 AM

Buy an in-line UPS device. They are expensive but they are much better than stand-by UPS devices. An in-line UPS always draws its power from the battery while the battery is getting charged, so the computer power supply will get constant power. A stand-by UPS is just there waiting to make its move to switch from AC to battery. When it switches, there is a slight pause. Many power supplies have problems with this, so the computer could have some stability problems.

Palula 08-02-2005 06:37 AM

How do I unmount my hdxs?
I mean... What would be the command line?

umount /dev/hda
umount /dev/hdb

And how do I remount it... To work just as it works when I boot? I took a look at fstab and that is just really awkward, full of codes etc...

Thank You.

tredegar 08-02-2005 09:35 AM

You can't unmount your /dev/hda- because this is where your system is running!
But fsck needs the disk unmounted......

The solution is to go to a console, become root and enter

shutdown -Fr

This will shutdown the computer, Force a filesystem check at the next boot and reboot for you. fsck will run as the system starts up.


Palula 08-02-2005 10:37 AM

Thank you very much.
That was exactly what I was looking for. :-)

Boow 08-02-2005 11:08 AM

The ext3 filesystem is a journalizing filesystem If its unmounted uncleanly it recovers lost data from the journal. It will fsck itself after 30 days or so many mounts so you should'nt worry too much but forcing fsck wont hurt.

Palula 08-03-2005 08:29 PM

Well I did the "shutdown -Fr 0" and it started to work and did fine. It worked just like when the machine is booted unclean. And after that first part is started to show a lot of text I have never seened it. Its really a lot of text/messages etc...

But the system halted at some place and this message appeared:

Recursive die failure, output supressed
<0> Kernel panic - not syncing: Fatal exception in interrupt.

What should I do?

btmiller 08-03-2005 08:35 PM

It would help if you could paste a few lines of text above the kernel panic. Also try cold booting the system.

Palula 08-05-2005 06:33 AM

It worked!!!!!

For some reason when I put: shutdown -Fr 0 it goes all wrong (should work too). But when I put shutdown -Fr now, it works.

But I still need some help regarding the messages... My FC3 is in portuguese so Ill try to write in an understandable way. I have two partitions in my Linux.

1 - Root partition (with all system files etc.);
2 - Home partition (all particular user files).

When I run reboot with fsck, the system show these messages:

Checking filesystem root 3.7% (non-contiguous).
Checking filesystem home 9.1% (non-contiguous).

Is this correct? I think the best choice would be to have nothing non-contiguous. :)

Another question is how can I put fsck to run on the next boot automatically, if the previous boot has been done unclean. It asks like this: Press a key in five second to run fsck. Or something like that. I want it to run imperatively. :)

Boow 08-06-2005 06:49 PM

Checking filesystem root 3.7% (non-contiguous).
Checking filesystem home 9.1% (non-contiguous).

I wouldn't worry about that I've never seen ext3 filesystem go above 10 percent fragmentation. I think that is what it was before fsck repaired it.

bp12345 08-07-2005 04:07 AM

If you don't mind reinstalling everything, I'd reccommend Debian. It has very fast boot and shutdown times, and it is very stable. Also, the filesystem has never been so corrupted that it took more than 30 seconds or so to repair it. I'd also reccommend ReiserFS. It's journal is much more comprehensive, it is more effieient and it is faster, too.

All times are GMT -5. The time now is 10:51 AM.