[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Check whether fsck would run



On 12/13/2014 10:27 AM, Scott Schaefer wrote:
On 12/13/2014 08:56 AM, martin f krafft wrote:
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,


Per man fsck ...

 *-N*Don't execute, just show what would be done.


Which, unfortunately, always outputs one line:

fsck from util-linux-ng 2.17.2

... but then lists the fs-specific fscks that it would run ..

[/sbin/fsck.xfs (1) -- /] fsck.xfs /dev/md0
[/sbin/fsck.ext3 (1) -- /boot] fsck.ext3 /dev/sda1



My apologies.  This obviously fails to address your requirement at all.

Seem to be suffering from total lack of reading comprehension this morning :-(


Reply to: