LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   fsck and root file system (http://www.linuxquestions.org/questions/slackware-14/fsck-and-root-file-system-833814/)

xj25vm 09-22-2010 12:29 PM

fsck and root file system
 
I would like to know if there is a way to do an unattended check on the root file system on my servers, *and* send emails in case of errors.

I know you can schedule a root file system fsck during boot time - but the root file system will be mounted read-only - so if fsck finds any problems - it can't email away a warning, or write the result to a file - or can it?

Essentially I would like my servers to do a self-check of the root file system periodically - and to email me if it fails. I just can't think of a way to get it done.

malekmustaq 09-22-2010 12:55 PM

Quote:

I know you can schedule a root file system fsck during boot time - but the root file system will be mounted read-only - so if fsck finds any problems - it can't email away a warning, or write the result to a file - or can it?
Yes. But you can always mail the warning portion of your log file after fsck has completed. It might not be "instant" in this case, but the same, you are informed by mail what happened the last fsck run for the given disk.

Use script.

Good luck.

xj25vm 09-22-2010 12:59 PM

Quote:

Yes. But you can always mail the warning portion of your log file after fsck has completed.
Are you saying that fsck saves it's output (generated during the boot-up scan) to one of the logs? How does it do that if it's not meant to be writing to the root partition (which is being checked)?

xj25vm 10-20-2011 06:36 AM

I know this thread is a bit oldish - but I'm resurrecting it hoping that somebody has an answer. The question is still:

Is there anyway of capturing (and possibly emailing away) the results of the automatic fsck check of the root partition during startup? If I have a server tucked away at a client site, which does a file system check on the root partition during an unattended boot - am I correct in thinking that the results of this test are not saved anywhere on the disk - as the root filesystem is not mounted rw during the check (otherwise the check itself can't happen). Is there any way around this?

Thanks for any suggestions

gnashley 10-20-2011 02:11 PM

You'd have to write some code which would mount some device and re-direct the output from fsck to that device.


All times are GMT -5. The time now is 03:59 AM.