Hi there! If you’re a system administrator just like me, you must have encountered this eerie message a couple of times, “On battery power, so skipping file system check”. Don’t you worry anymore! This blog post is exclusively for you. Grab your cup of coffee, sit back, relax and let’s delve into how to fix this common issue found in Debian systems.
Understanding the Issue
So, you might be wondering what exactly this message means. Essentially, this message is as a result of a design consideration in the system’s boot sequence. Primarily, during boot-up, the system would carry out file system checks to ensure the system is healthy. However, when you’re operating on battery power, this check is skipped to save some energy and speed up the boot process.
This is especially common in laptops, but surely you’d like your system to be checked regardless of where the power is coming from, right? That’s where this workaround comes in handy.
To bypass the power check, we’ll need to manipulate the ‘checkfs.sh’ script, which controls the file system check during boot-up. We’ll create a backup of this file (for safety’s sake), then modify it to ignore the power source when conducting file system checks.
Now, let’s get our hands dirty. Open your terminal and follow me through the steps below:
- Firstly, navigate to the directory where the script is located, which is ‘/etc/init.d/’. We’ll use the ‘cd’ command for this:
- Next, we’ll create a backup of the ‘checkfs.sh’ script, using the ‘cp’ command:
sudo cp checkfs.sh checkfs.sh.bak
- Now, open the ‘checkfs.sh’ script in a text editor. I prefer using ‘nano’, but you can use ‘vi’ or ’emacs’ if you wish:
sudo nano checkfs.sh
- Scroll down and find the line that checks the type of power source. It’s typically similar to:
if [ "$on_ac_power" -eq 1 ]. Change this line to
if [ "$on_ac_power" -eq 0 ].
- Save your changes and exit the editor. In ‘nano’, you save using ‘Ctrl+O’ and exit using ‘Ctrl+X’.
There you have it! You’ve successfully bypassed the ‘On battery power, so skipping file system check’ step during boot-up on your Debian systems. Remember, always keep a backup of any script or file before you modify it. This safety measure will ensure that if anything goes wrong, you can easily restore the original state. See you in the next post!