13

Following this question: Force fsck.ext4 on reboot, but really "forceful"

Apparently the output of e2fsck -n is not reliable when you use it on a mounted filesystem, so its output should not be trusted.

Is there any way to check for errors in a mounted filesystem? Just check, not fix. I am more interested in ext4, because that's what I use the most.

UrkoM
  • 1,375

2 Answers2

11

Because of the way that most Linux file systems work you simply cannot do a safe/useful check on a mounted file system. It's not really safe, and because the system is in use, it can be unreliable. Sadly, sometimes, you have to live with things the way they are until someone does it better ;). Ext4 probably won't pick up this feature (maybe ext5? if it ever happens) but I believe btrfs will, and if it does, you will be able to switch your partitions over when the time comes.

tshepang
  • 2,007
RolandiXor
  • 51,797
2

if it is an LVM volume then you can take a snapshot of the volume and then run fsck on the snapshot to see whether the filesystem is in a recoverable state. That's not the same as checking whether it currently is in a consistent state. However it is close enough for almost all intentions. When you're done, drop the snapshot.

Wil
  • 843