Linux - GeneralThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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?
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.
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.
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"
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.