man e2fsck says;
Note that in general it is not safe to run e2fsck on mounted filesystems. The only exception is if the -n option is specified, and -c, -l, or -L options are not specified. However, even if it is safe to do so, the results printed by e2fsck are not valid if the filesystem is mounted. If e2fsck asks whether or not you should check a filesystem which is mounted, the only correct answer is ``no''. Only experts who really know what they are doing should consider answering this question in any other way
I can see (at least ext4) file system errors running journalctl -k
. Ostensibly, journalctl gets the same kernel messages as the dmesg utility reports. fsck works differently on each file system, but in general checks the actual fs journal, looks for some other stuff at each inode (iirc). In reading man dmesg, I see mention of a special block device /dev/kmsg and the file /proc/kmsg. I can cat /dev/kmsg
and read that information. Is this the same source that journalctl -k
gets its data from? How is this related to e2fsck -n
?