6

My ubuntu system just froze, and I was forced to run the REIUSB commands. Now, in windows, you can run chdsk. I've read about "touch /forcefsck", but I have also read that's is dangerous to check a mounted filesystem.

Will "touch /forcefsck" check the disks mounted? Is "touch /forcefsck" safe? Will it automatically fix the errors? Where will my corrupt file go?

Thanks in advance!

14

touch /forcefsck simply creates a file /forcefsck. This file will cause the system to run fsck on the next reboot before the filesystem is mounted. Its similar to when you try to run chkdsk in Windows and it says it can't but it will do it on the next reboot.

So its pretty safe and with any luck it will fix your problem.

  • Will it automaticly fix the errors? – DevRandom Jun 3 '14 at 16:18
2

Yes and no. It is safe enough, and some distros will routinely run this every 30 days.

The generally preferred method is to boot a live distro and check the drive as a non-system device, partition by partition if need be. You can run e2fsck -c -c to check for bad blocks, it will take a while. Note that for LVM groups some special handling is required. (check from /dev/mapper/...). The most recent versions of GParted and the like do this fairly handily.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.