0

What is the best approach to do fsck on corrupted disk

  • one from the following options:

The first option is to set “1” ( the last character ) on device in /etc/fstab file ,

so it will check this partition first , as the following example:

 /dev/sdc /grop/sdc ext4 defaults,noatime 0 1   <-------- < we set 1 instead 0 >

and then reboot machine

  • during boot fsck will run on device /dev/sdc

The second approach , is to do the following

init 1
stop the relevant services
umount /dev/sdc
e2fsck -y /dev/sdc
init 3

1 Answer 1

0

Don't call init 1 on a remote machine! or you'll be locked out.

If the disk is really corrupted, I won't trust fsck running alone at boot.

If the machine is a local machine, I would recommend your init 1 method, then reboot.

If the machine is remote machine.

  • Stop all services one at a time, not stopping ssh, until the umount /dev/sdc command succeed.
  • Fix the disk using e2fsck.
  • remount it to be sure it is really fine (mount -a).
  • reboot. Since you've already stopped most useful services, this won't take so much more time to reboot. Generally, I install security updates just before rebooting, so I save the next reboot needed for security updates.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .