Can I run fsck or e2fsck when Linux file system is mounted?

I mean I'm already here right. If not, why?

1 Answer

No.

Do not run fsck on a live or mounted file system. fsck is used to check and optionally repair a Linux file systems. Running fsck on a mounted filesystem can usually result in disk and/or data corruption.

This will force a check on next boot:

sudo touch /forcefsck

So will this but it will also reboot the machine at the moment you hit enter:

shutdown -rF now

There are more ways (like telling the machine to go to init 1 and then umount the partition/disc your want to check) but these 2 are the easiest.

4

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like