{"id":3733,"date":"2023-11-21T12:31:32","date_gmt":"2023-11-21T04:31:32","guid":{"rendered":"https:\/\/www.servergigabit.com\/guide\/?post_type=kb&#038;p=3733"},"modified":"2026-03-16T12:16:15","modified_gmt":"2026-03-16T04:16:15","slug":"file-system-checks-linux-serverr","status":"publish","type":"kb","link":"https:\/\/www.servergigabit.com\/guide\/kb\/file-system-checks-linux-serverr","title":{"rendered":"Comprehensive Guide to Performing File System Checks on Your Server"},"content":{"rendered":"<p><img fetchpriority=\"high\" decoding=\"async\" class=\"alignnone wp-image-3734\" src=\"https:\/\/www.servergigabit.com\/guide\/wp-content\/uploads\/2023\/11\/f-300x169.jpeg\" alt=\"File System Checks\" width=\"710\" height=\"400\" srcset=\"https:\/\/www.servergigabit.com\/guide\/wp-content\/uploads\/2023\/11\/f-300x169.jpeg 300w, https:\/\/www.servergigabit.com\/guide\/wp-content\/uploads\/2023\/11\/f-1024x576.jpeg 1024w, https:\/\/www.servergigabit.com\/guide\/wp-content\/uploads\/2023\/11\/f-768x432.jpeg 768w, https:\/\/www.servergigabit.com\/guide\/wp-content\/uploads\/2023\/11\/f-1536x864.jpeg 1536w, https:\/\/www.servergigabit.com\/guide\/wp-content\/uploads\/2023\/11\/f-2048x1152.jpeg 2048w, https:\/\/www.servergigabit.com\/guide\/wp-content\/uploads\/2023\/11\/f-370x208.jpeg 370w, https:\/\/www.servergigabit.com\/guide\/wp-content\/uploads\/2023\/11\/f-1230x692.jpeg 1230w, https:\/\/www.servergigabit.com\/guide\/wp-content\/uploads\/2023\/11\/f-800x450.jpeg 800w, https:\/\/www.servergigabit.com\/guide\/wp-content\/uploads\/2023\/11\/f-390x219.jpeg 390w\" sizes=\"(max-width: 710px) 100vw, 710px\" \/><\/p>\n<p data-sourcepos=\"3:1-3:125\">Maintaining the health and integrity of your server&#8217;s file system is crucial for ensuring its smooth operation and preventing data loss. File system checks, also known as disk checks, are essential tools for identifying and repairing errors that can arise from various factors, such as sudden power outages, hardware malfunctions, or software glitches.<\/p>\n<p data-sourcepos=\"5:1-5:122\">This comprehensive guide provides a detailed walkthrough of performing a<a href=\"https:\/\/support.microsoft.com\/en-us\/windows\/using-system-file-checker-in-windows-365e0031-36b1-6031-f804-8fd86e0ef4ca\" rel=\"nofollow noopener\" target=\"_blank\"> file system check<\/a> on your server. We&#8217;ll cover the essential steps, including booting into the rescue system, identifying the file system type, and using appropriate commands to check and repair errors. Additionally, we&#8217;ll highlight key considerations and best practices to ensure a successful and safe file system check.<\/p>\n<p data-sourcepos=\"7:1-7:224\">Whether you&#8217;re experiencing server issues or simply want to proactively maintain its health, this guide will equip you with the knowledge and skills to perform file system checks effectively and safeguard your valuable data.<\/p>\n<div class=\"markdown markdown-main-panel\" dir=\"ltr\">\n<h2 data-sourcepos=\"3:1-3:38\"><strong>How to Perform a File System Checks<\/strong><\/h2>\n<p data-sourcepos=\"9:1-9:12\"><strong>Before You Start<\/strong><\/p>\n<ul data-sourcepos=\"11:1-12:7\">\n<li data-sourcepos=\"11:1-11:121\">Back up all of your data before you start the file system check, as there could be data loss during the repair process.<\/li>\n<li data-sourcepos=\"12:1-12:7\">Start the file system check in the rescue system.<\/li>\n<\/ul>\n<p data-sourcepos=\"14:1-14:36\"><strong>Identifying the System Partition<\/strong><\/p>\n<p>Display all existing partitions by using the following command:<\/p>\n<div class=\"code-block ng-star-inserted\">\n<pre><code class=\"code-container no-decoration-radius\" role=\"text\">fdisk -l\r\n<\/code><\/pre>\n<\/div>\n<p>In this example, the system partition is located on <code class=\"\">\/dev\/vda1<\/code>. Normally, the system partition is located on <code class=\"\">\/dev\/sda2<\/code> or <code class=\"\">\/dev\/vda1<\/code>.<\/p>\n<p data-sourcepos=\"22:1-22:36\"><strong>Determining the File System Type<\/strong><\/p>\n<p>Use the following command to check which file system type is used:<\/p>\n<div class=\"code-block ng-star-inserted\">\n<pre><code class=\"code-container no-decoration-radius\" role=\"text\">blkid | grep vda1 | awk '{print $4}'\r\n<\/code><\/pre>\n<\/div>\n<p data-sourcepos=\"29:1-29:40\"><strong>Checking the File System (Read-Only)<\/strong><\/p>\n<p>Depending on which file system is used and which partition has to be checked, use the following commands. This is only a check in advance and your file system will not be repaired.<\/p>\n<ul data-sourcepos=\"32:4-36:0\">\n<li data-sourcepos=\"32:4-32:55\">For the file system ext2: <code class=\"\">fsck.ext2 -n \/dev\/vda1<\/code><\/li>\n<li data-sourcepos=\"33:4-33:55\">For the file system ext3: <code class=\"\">fsck.ext3 -n \/dev\/vda1<\/code><\/li>\n<li data-sourcepos=\"34:4-34:55\">For the file system ext4: <code class=\"\">fsck.ext4 -n \/dev\/vda1<\/code><\/li>\n<li data-sourcepos=\"35:4-36:0\">For the file system btrfs: <code class=\"\">fsck.btrfs -n \/dev\/vda1<\/code><\/li>\n<\/ul>\n<p data-sourcepos=\"37:1-37:30\"><strong>Repairing Scattered Errors<\/strong><\/p>\n<p>Use the following command to repair scattered errors:<\/p>\n<div class=\"code-block ng-star-inserted\">\n<pre><code class=\"code-container no-decoration-radius\" role=\"text\">fsck.ext4 \/dev\/vda1\r\n<\/code><\/pre>\n<\/div>\n<p data-sourcepos=\"44:1-44:24\"><strong>Repairing All Errors<\/strong><\/p>\n<p>Use the following command to repair all errors. This command includes the parameter <code class=\"\">-y<\/code>, which answers all queries with &#8220;Yes&#8221;. It is not necessary to answer them manually.<\/p>\n<div class=\"code-block ng-star-inserted\">\n<pre><code class=\"code-container no-decoration-radius\" role=\"text\">fsck.ext4 -y \/dev\/vda1\r\n<\/code><\/pre>\n<\/div>\n<p data-sourcepos=\"51:1-51:29\"><strong>Exiting the Rescue System<\/strong><\/p>\n<p>Once the file system check has been finished, use the following command to reboot the system and exit the rescue system:<\/p>\n<div class=\"code-block ng-star-inserted\">\n<pre><code class=\"code-container no-decoration-radius\" role=\"text\">reboot\r\n<\/code><\/pre>\n<\/div>\n<p data-sourcepos=\"58:1-58:26\"><strong>Additional Information<\/strong><\/p>\n<ul data-sourcepos=\"60:1-60:356\">\n<li data-sourcepos=\"60:1-60:356\">If you start a file system check, some files might lose the information about their names and locations in the file system.<\/li>\n<li data-sourcepos=\"60:1-60:356\"><span class=\"animating\">The file system check deposits these files in a specific directory called <\/span><code class=\"\">lost+found<\/code><span class=\"animating\">.<\/span><span class=\"animating\"> If there are missing files after you have performed the file system check,<\/span><span class=\"animating\"> you will be able to find the files in this directory in most cases.<\/span><\/li>\n<\/ul>\n<h2 data-sourcepos=\"45:1-45:14\"><strong>Conclusion<\/strong><\/h2>\n<p data-sourcepos=\"47:1-47:188\">Performing a file system check is a valuable tool for maintaining the health of your <a href=\"https:\/\/www.servergigabit.com\/linux-vps-hosting\/\">Linux<\/a> system. By following the steps in this guide, you can easily check and repair file system errors.<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Maintaining the health and integrity of your server&#8217;s file system is crucial for ensuring its smooth operation and preventing data loss. File system checks, also known as disk checks, are essential tools for identifying and repairing errors that can arise from various factors, such as sudden power outages, hardware malfunctions, or software glitches. This comprehensive guide provides a detailed walkthrough&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"kbtopic":[1099],"kbtag":[1186],"class_list":["post-3733","kb","type-kb","status-publish","hentry","kbtopic-tutorials","kbtag-file-system-checks"],"_links":{"self":[{"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/kb\/3733","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/kb"}],"about":[{"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/types\/kb"}],"author":[{"embeddable":true,"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/comments?post=3733"}],"version-history":[{"count":5,"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/kb\/3733\/revisions"}],"predecessor-version":[{"id":4301,"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/kb\/3733\/revisions\/4301"}],"wp:attachment":[{"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/media?parent=3733"}],"wp:term":[{"taxonomy":"kbtopic","embeddable":true,"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/kbtopic?post=3733"},{"taxonomy":"kbtag","embeddable":true,"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/kbtag?post=3733"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}