LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (https://www.linuxquestions.org/questions/debian-26/)
-   -   Skip e2fsck / fsck at boot if working day - anyone done this? (https://www.linuxquestions.org/questions/debian-26/skip-e2fsck-fsck-at-boot-if-working-day-anyone-done-this-847206/)

wikapuki 11-29-2010 07:35 AM

Skip e2fsck / fsck at boot if working day - anyone done this?
 
Hi

Squeeze/Sid
Linux 2.6.32-5-486

I have my drives set to check on 29th mount.
Machine shutdown/reboot daily.

Occasionally I need to to a reboot during the working day and I have noticed over this pas year that during a working day reboot their is a more than 50 50 chance of it wanting to do a disk check which can be a long wait, plus it can be un-nerving when this machine is a remote machine (for me it's remote).

Is there a way I can specify that if the machine is booting between specified hours (10am to 10pm) then fsck is skipped but also ensures the next reboot fsck is done on that drive?

M.

jlcasado 11-29-2010 10:02 AM

Hi,

I can just thing in a script run when rebooting the server that will check the hour and modify the counter accordingly or better than this, disable fsck on next reboot and just run it when you feel that's needed.

jose

cepcasa 11-30-2010 04:31 AM

Quote:

Originally Posted by jlcasado (Post 4174785)
Hi,

I can just thing in a script run when rebooting the server that will check the hour and modify the counter accordingly or better than this, disable fsck on next reboot and just run it when you feel that's needed.

jose

in /etc/e2fsck.conf

# report fsck with ^C
[options]
allow_cancellation = 1

wikapuki 11-30-2010 07:13 AM

@jlcasado I was thinking of that too but was hoping it possible within fsck / e2fsck.conf

@cepcasa Unfortunately I will not be at the machine when needing to do the ^C. but I noted on my system that this file doesn't exist so will add and have that option in case I am there.

On reading the rest I saw: defer_check_on_battery

Possible Solution:
No this machine has not got a battery but I was wondering if I could somehow make the machine think it has a battery and when booting within 'working hours' make it think it has a low battery power so that 'defer_check_on_battery = 1' would make skip fsck??

I may try to see if there is a way for requesting such options to be added to /etc/e2fsck.conf

autocancel_timerange = 10:22
10:22 = 10am to 10pm

Added feature request: http://sourceforge.net/tracker/?func...06&atid=352406

catkin 11-30-2010 07:39 AM

IDK Debian so have been keeping quiet but no solution has been identified yet so here goes ...

Does Debian support an /etc/fastboot file? If so, it could be time-dependently created or deleted by a boot script running before the fsck activity in the boot order.

Alternatively the boot script that initiates fsck (/etc/init.d/mountall.sh?) could be modified, making that functionality time-dependent.

It is, of course, scary to mess with boot scripts on a remote server ... :eek: ... so if you choose to try this approach you might like to simply comment out the fsck code and call another script for the new/clever time-dependent commands so if it doesn't work at least the main script continues.


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