LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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-08-2003, 09:17 AM   #1
redss
Member
 
Registered: Jun 2003
Posts: 168

Rep: Reputation: 16
fsck -y automatically when necessary?


I have a slackware Linux box in the closet (no monitor attached) that I telnet into when its on. Sometimes when I boot up, it has a filesystem error and sits at the "enter root password for maintenance" prompt, instead of going into multiuser mode.

Is there a way to have it automatically run "e2fsck -y" automatically when this happens so that I don't have to plug up a monitor to troubleshoot it?
 
Old 06-08-2003, 10:55 AM   #2
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 269Reputation: 269Reputation: 269
You can always edit your /etc/rc.d scripts and add it to check at startup but you shouldn't get that error at boot time anyways unless your shutting the machine down improperly.
Also if your on a open network, might want to consider ssh, its more secure than telnet.
 
Old 06-08-2003, 03:29 PM   #3
camelrider
Member
 
Registered: Apr 2003
Location: Juneau, Alaska
Posts: 251

Rep: Reputation: 32
See man e2fsck. It looks like the -y switch might be useful to you.
E2fs are usually set to do fsck after a given number of reboots. If you can find where this is set you may be able to add the option. I can't remember just now where it is.
 
Old 06-08-2003, 04:17 PM   #4
redss
Member
 
Registered: Jun 2003
Posts: 168

Original Poster
Rep: Reputation: 16
Well, my problem has just become far worse :-(

My original question was to avoid the inconvenience of having to plug up a monitor to get it to boot. But NOW when it boots, it runs fsck with errors, then lets me go into single user mode. I grep'ed to find that etc/rc.d/rc.S contains the script that calls fsck, however I wasn't able to save any changes because the filesystem was readonly.

Everytime this happened before it seemed to be fixed by e2fsck enabling me to boot,, but now it constantly loops: reboot, fail fsck, manually go into single user mode and run e2fsck, ^d to reboot, repeats the whole thing. If I don't go into single-user mode, it reboots automatically. Nothing I do in single user mode is enough to not require reboot (I see in the rc.d/S script that fsck return value of > 2 or 4 requires reboot).

How am I supposed to fix anything with a readonly filesystem? Was this due to the fact that I did a shutdown -F the last time it was running in multiuser mode? It was working completely fine before today.

Here are some of the error msgs during fsck: "drive ready seek complete error" and "uncorrectable error" and "force rewrite: yes" and finally "UNEXPECTED INCONSISTENCY: run fsck manually without -a and -p options"

BTW this is slackware 9 (2.4.20 kernel)

Help!!!
 
Old 06-08-2003, 10:46 PM   #5
cuckoopint
Member
 
Registered: Feb 2003
Distribution: Debian
Posts: 797

Rep: Reputation: 30
Quote:
How am I supposed to fix anything with a readonly filesystem?
Maybe I'm completely off track here (sorry, it's late), but can't you remount the fs read-write?
 
Old 06-08-2003, 11:37 PM   #6
whansard
Senior Member
 
Registered: Dec 2002
Location: Mosquitoville
Distribution: RH 6.2, Gen2, Knoppix,arch, bodhi, studio, suse, mint
Posts: 3,304

Rep: Reputation: 65
you need to boot with the install cdrom in rescue mode
and run e2fsck on the system from there.
 
  


Reply



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
2 fsck or not 2 fsck? naps SUSE / openSUSE 4 03-18-2005 02:11 PM
automatic fsck on boot. fsck errors. nixel Slackware 1 05-17-2004 07:51 AM
How to do fsck Please help Zi5 Linux - Distributions 2 05-13-2004 06:47 PM
Fsck scottpioso Linux - Newbie 7 06-01-2003 03:06 PM
How could I do the fsck? Alasis Linux - General 1 08-09-2002 08:55 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 03:15 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
Open Source Consulting | Domain Registration