You are not logged in.
Pages: 1
Is it possible to have fsck run during shutdown/reboot when it is due? Ubuntu has AutoFsck that does this. Anything similar for Arch? Thanks,
Offline
It does already.
grep fsck /etc/rc.sysinit
Offline
Thanks. But it seems to run on startup. How do I make it run on reboot/shutdown?
Offline
/etc/rc.local.shutdown
this script is executed on shutdown/reboot
-m.
What happened to Arch's KISS? systemd sure is stupid but I must have missed the simple part ...
... and who is general Failure and why is he reading my harddisk?
Offline
OK. May be I'm not clear. I would like to have fsck run during shutdown and NOT at startup similar to AutoFsck in ubuntu.
Offline
May be I'm not clear.
You are not being clear at all. Explain *why* the disk checking should be done at shutdown. Or Startup.
*Whenever* it's done, it's always a pain in the arse.
Offline
keerthi wrote:May be I'm not clear.
You are not being clear at all. Explain *why* the disk checking should be done at shutdown. Or Startup.
*Whenever* it's done, it's always a pain in the arse.
May be because when you start the computer, you actually want to use the computer ASAP, while when you shut it down, you don't mind if it stays on for those few minutes?
Offline
May be because when you start the computer, you actually want to use the computer ASAP, while when you shut it down, you don't mind if it stays on for those few minutes?
Exactly. Its disappointing when you have to wait for fsck to finish (it takes 30 mins to complete for me) when there is a need to "check" something real quick.
Offline
May be because when you start the computer, you actually want to use the computer ASAP, while when you shut it down, you don't mind if it stays on for those few minutes?
+1
Why is this not standard?
Linux user #403491
"Men have called me mad; but the question is not yet settled, whether madness is or is not the loftiest intelligence– whether much that is glorious– whether all that is profound– does not spring from disease of thought– from moods of mind exalted at the expense of the general intellect." - E. A. Poe from Eleonora
Offline
You could install AutoFsck. However, note that it is not (yet) installed as standard, even in Ubuntu (has reliability concerns?). See Ubuntu thread for discussion. Reasons against it:
* Having the laptop battery run out of charge half-way through a fsck is not a good thing. You will all be moaning 10 times louder if you start getting corrupted partitions
* Use tune2fs, to change the default of checking the disk annoyingly often, e.g.: tune2fs -c 0 -i 2m /dev/sda1
* The annoying delay will hopefully be quicker with ext4.
I love this quote: "he had closed his laptop lid and not noticed the AutoFsck dialogue, it had then spent over an hour running in the bag with him on his journey home, and was almost out of power, all not good."
Offline
You could install AutoFsck. However, note that it is not (yet) installed as standard, even in Ubuntu (has reliability concerns?). See Ubuntu thread for discussion. Reasons against it:
* Having the laptop battery run out of charge half-way through a fsck is not a good thing. You will all be moaning 10 times louder if you start getting corrupted partitions
That can also happen when you do it on startup (in case you forgot your charger) ...
Offline
It seems to me that it would be simple for you to create a script that would run fsck and set the script to run at shutdown. Or even have the script do the shutdown for you.
The fsck at bootup would always go quickly because the real check would already be done.
Offline
add to rc.local.shutdown
#!/bin/bash
NETFS="nonfs,nosmbfs,nocifs,nocodafs,noncpfs,nosysfs,nousbfs,noshfs,nofuse,nofuseblk"
if (( `tune2fs -l /dev/sda2 | awk '/Mount count/{print $3}'` > `tune2fs -l /dev/sda2 | awk '/Maximum mount count/{print $4-1}' ))
then /sbin/fsck -A -T -C -a -t $NETFS 2>/dev/null
fi
this is my first bash script, hello world! Damn I'm satisfied
I don't know how to set gawk field separator to ":+random number of spaces" in order for the script to be less hackish.
Last edited by carlocci (2008-02-16 17:55:48)
Offline
there is also a script here (quite old)
http://bbs.archlinux.org/viewtopic.php?id=15496
I also prefer to check my filesystems when I shutdown (only shutdown, not when I reboot)
Anyone tried those scripts?
Offline
The problem with putting that script in your rc.local.shutdown is that rc.local.shutdown is executed before the filesystems are remounted from read-write to read-only and you should/must have a filesystem unmounted or mounted read-only if you are running fsck on it.
That script (actually it's a modification to the rc.shutdown script) linked to should work okay, however it forces a fsck check on every shutdown whether it is needed or not, but doesn't run when you are just rebooting. But I haven't actually tested it myself,
Offline
Pages: 1