#773035 molly-guard: please inform about filesystems to be checked after reboot

#773035#5
Date:
2014-12-13 13:50:45 UTC
From:
To:
package: molly-guard
severity: wishlist
tags: gift

Hi Josh,

thanks for maintaining molly-guard! :-)

It would be nice if molly-guard would inform whether there will be any
filesystems checks being performed after reboots. It seems
/etc/molly-guard/run.d/ would be an ideal place to place a small shell script:

[14:41] <      h01ger> | madduck: this is almost usefor for /etc/molly-guard/run.d/ already: df -t ext2 -t ext3 -t ext4|grep /|cut -d " " -f1|sort -u | while read i ; do echo $i ; tune2fs -l $i |egrep "(ount
count|Last checked|Check interval):" ; echo ; done
[14:42] <      h01ger> | madduck: are you continueing on this or should i dump this into a bug now?
[14:42] < madduck> i am not going to hack on this, but…
[14:42] < madduck> fsck -A -t ext2,ext3,ext4 …
[14:42] <      h01ger> | maybe add a "echo 'press enter' ; read"
[14:43] < madduck> I just have not found out how to ask fsck whether a check will run
[14:43] < madduck> the script should exit 0 if there is a fsck to be expected, 1 otherwise, and -v should display the
                   filesystems
[14:44] < madduck> go ahead and dump this into a bug report, good idea


Obviously the above one liner doesnt really implement this yet in the most
useful way...

I might continue finishing it the next time I'll wait for some unexpected fsck
to finish :-)


cheers,
	Holger

#773035#10
Date:
2014-12-13 13:56:48 UTC
From:
To:
Holger had the idea to add to molly-guard a check that would require
the sysadmin to manually ack a reboot if fsck would be expected to
run. I like it.

Instead of parsing df -t output, invoking tune2fs -l and doing
a whole bunch of grep magic, I wonder if there's a smarter way to
find out if fsck would do something if it were to run now.

There is

  fsck -A -t ext2,ext3,ext4,… ...

but I could not find out how to ask it the question I want answered,
which is: "hey, fsck, if you were to run right now on -All
filesystems of -type as listed, would you want to do a routine
check?"

Do you know?

Cheers,