Fixing filesystem check or mount fail

Beginners on Linux will probably encounter a file system check or mount fail at least once throughout their experience. I know I did. Multiple times. But it’s hard to get around hard shut downs when your computer just freezes! Now some people might just press i to ignore every time. Others blindly follow guides, unaware of the effects on their computer.

I for one want to know what the commands I type actually do. So without much further ado, with reference to Simon Richter’s reply on an Ask Ubuntu thread, here’s how you can resolve the issue permanently (complete with explanations of each command):

Step 1: Boot up Computer

Press that power button. 😉

Step 2: Enter Manual Recovery Mode

In the GNU GRUB boot loader, press m to enter manual recovery mode.

Step 3: Remount the System

Remount your system to read-only mode. This will prevent the kernel from writing any permanent changes that could harm your system.

  • mount is the command.
  • -o allows you to specify mount options.
    • ro is the read-only option.
    • remount is the option to remount an already mounted system.
  • / is the mount point for the entire system.
mount -o ro,remount /

Step 4: Repair the System

Run the file system consistency check and interactive repair. You do not need to understand all the underlying semantics of fsck but understand that fsck possesses a set of standards for file systems and ensures all the files on your system follow that standard.

  • fsck is the repair command.
  • -f is the flag to also check clean files.
fsck -f

Step 5: Write the Changes

Write the changes to your system by using a sync.

sync

Step 6: Reboot Computer.

Reboot the system and all changes should be implemented.

reboot

Next time you turn on your computer, everything should be running smoothly!

Advertisements