I mean I'm already here right. If not, why?
Asked
Active
Viewed 4.4k times
1 Answers
25
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.
Rinzwind
- 293,910
- 41
- 570
- 710
-
7Also, don't try to get around this by running it read-only. The results from analyzing a moving target [cannot be trusted](http://manpages.ubuntu.com/manpages/natty/man8/fsck.ext2.8.html). – ændrük Jun 10 '11 at 05:59
-
Good call ændrük – Rinzwind Jun 10 '11 at 06:50
-
`sudo touch /forcefsck` only works with the old SysVinit and early versions of Upstart, it won’t work with systemd – dejanualex Aug 25 '21 at 13:21
-
doesn't appear to be working anymore on Ubuntu 20.04 – fIwJlxSzApHEZIl Mar 11 '22 at 17:55