SiteHost

Running e2fsck on Linux (Linux File System Check)

e2fsck is a file system consistency checker for the ext2, ext3, and ext4 file systems commonly used in Linux-based operating systems. It examines the integrity of your VPS's file system, repairs any errors it discovers, and helps prevent data corruption or loss.

Why is e2fsck Important?

Regularly running e2fsck is a best practice to maintain the health of your server. Over time, file system inconsistencies can occur due to various factors such as power outages, hardware failures, or other unexpected events. e2fsck ensures that your file system remains in optimal condition and minimizes the risk of data corruption.

These instructions only apply to unmanaged Linux VPS and VDS servers. If you are running a managed server this will be handled by the SiteHost team. Details about Server Management can be found here

How to Run e2fsck on Your VPS:

If you undertake thie e2fsck and encounter any issues during the process, please do not hesitate to reach out to our support team for assistance. We are here to help you with any questions or concerns you may have.

Please follow these steps to run e2fsck on your unmanaged VPS:

We strongly advise you to take a backup of your important data before running e2fsck, as there is a possibility of data loss in the event of significant file system corruption.

  1. Log in to the SiteHost Control Panel.
  2. Go to the Servers module and select your VPS.
  3. Click into the SNAPSHOTS tab.
  4. Update the Lifetime to 12 hours and click on Take Snapshot
  5. When the snapshot process has completed, click into the RESCUE MODE tab.
  6. Click on the Enter Rescue Mode button. We have more information about Rescue Mode here.
  7. You will be given a temporary root password to log in to your Rescue Mode VPS.
  8. SSH into your VPS. Use your preferred SSH client to connect to your server.
  9. Do NOT follow the usual instructions to mount your filesystem, instead enter the command lsblk and note the xvda name of your main storage. This will usally be xvda3 and the largest device showing. xvda1 and xvda2 are usually the rescue mode devices. We will assume for these instructions it is /dev/xvda3
  10. Run the command blkid /dev/xvda3. Ensure that TYPE is ext3 or ext4. If it is not please contact us for further guidance.
  11. Next run the file system check command e2fsck -y /dev/xvda3.
  12. Follow On-Screen Prompts: e2fsck may prompt you to confirm actions or provide additional instructions. Please follow these prompts.
  13. Once completed and errors fixed, exit from rescue mode by logging out of your SSH session and returning the the SiteHost Control Panel.
  14. Click into the RESCUE MODE tab for the server in question.
  15. Click on the Leave Rescue Mode button.
  16. Check that all is well with your VPS. If your VPS will not start up correctly you can revert to the snapshot you created earlier. Please do not hesitate to reach out to our support team if you need to do this.

If you are not comfortable performing this maintenance task yourself then this may be a good opportunity to discuss Server Management for your VPS. Details about Server Management can be found here