Manually fix disk errors on boot on Debian

Manually fix disk errors on boot on Debian

One day, while I was running my updates, I was pleasantly surprised to discover that the virtual machine hard disk was inconsistent, and that Debian could not manually repair these errors.

To fix this error, you are then asked to run fsck manually

These operations are, of course, not without risks.
Remember to backup your VM or machine in case the command could irreparably corrupt your storage.
As usual, I cannot be held responsible for any data loss.

Apparently, Debian can't fix this problem, so you have to run the magic command yourself.

Type the command below:

fsck -yf /dev/sda1
In principle the system is located on the sda1 partition.
Replace sda1 with the partition indicated at the top of the message.

Once the command is executed, the orphaned inodes will be fixed, and the report will then be displayed on the screen

If any inodes were fixed, rerun the command until all errors are corrected.

Once no more errors are fixed, exit recovery mode by typing:

exit

The machine will then reboot, and the server should then boot.