{"id":3457,"date":"2015-11-02T15:04:06","date_gmt":"2015-11-02T13:04:06","guid":{"rendered":"https:\/\/contabo.com\/blog\/?p=3457"},"modified":"2021-12-21T12:50:05","modified_gmt":"2021-12-21T11:50:05","slug":"perform-file-system-check","status":"publish","type":"post","link":"https:\/\/contabo.com\/blog\/perform-file-system-check\/","title":{"rendered":"How to perform a file system check?"},"content":{"rendered":"<p>The file system check is is a practical tool if an error occurs in your file system and your server is not booting any more. With this tool you can analyse and repair such errors in your file system. We recommend to backup all your data before you start with this operation, because there could be data loss of your server during the repair process. Please start the file system check in the rescue system.<\/p>\n<p>If you do not know what the rescue system is or how to start it, please click <a href=\"https:\/\/contabo.com\/blog\/tutorials\/system-rescue-cd-first-steps\/\" target=\"_blank\" rel=\"noopener noreferrer\">here<\/a>.<\/p>\n<p><a href=\"https:\/\/contabo.com\/blog\/wp-content\/uploads\/2015\/10\/fsck1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-4205\" src=\"https:\/\/contabo.com\/blog\/wp-content\/uploads\/2015\/10\/fsck1-300x173.png\" alt=\"fsck1\" width=\"300\" height=\"173\" srcset=\"https:\/\/contabo.com\/blog\/wp-content\/uploads\/2015\/10\/fsck1-300x173.png 300w, https:\/\/contabo.com\/blog\/wp-content\/uploads\/2015\/10\/fsck1.png 617w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>If you\u2019re not sure about your admin rights, always enter the command sudo -i at the beginning of every session:<\/p>\n<ul>\n<li><span style=\"color: #008000;\">sudo -i<\/span><\/li>\n<\/ul>\n<p>This command will grant you the rights of a power user, so you don\u2019t have to write the command sudo at the beginning of every command line.<\/p>\n<p>As soon as your server has booted into the rescue system, please use the following command to display all existing partitions.<\/p>\n<ul>\n<li><span style=\"color: #008000;\">fdisk -l<\/span><\/li>\n<\/ul>\n<p><a href=\"https:\/\/contabo.com\/blog\/wp-content\/uploads\/2015\/10\/fsck2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-4206 alignnone\" src=\"https:\/\/contabo.com\/blog\/wp-content\/uploads\/2015\/10\/fsck2-300x160.png\" alt=\"fsck2\" width=\"300\" height=\"160\" srcset=\"https:\/\/contabo.com\/blog\/wp-content\/uploads\/2015\/10\/fsck2-300x160.png 300w, https:\/\/contabo.com\/blog\/wp-content\/uploads\/2015\/10\/fsck2.png 510w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>In this example the system partition is located on <strong>\/dev\/vda1<\/strong>. Normally the system partition is located on <strong>\/dev\/sda2<\/strong> or <strong>\/dev\/vda1<\/strong>.<\/p>\n<p>Please use the following command to check which file system type is used.<\/p>\n<p><em><span style=\"color: #333333;\">INFORMATION: Please use your actual partition, in our case we have to use \/dev\/vda1<\/span><\/em><\/p>\n<ul>\n<li><span style=\"color: #008000;\">blkid | grep vda1 | awk &#8216;{print $4}&#8217;<\/span><\/li>\n<\/ul>\n<p><a href=\"https:\/\/contabo.com\/blog\/wp-content\/uploads\/2015\/10\/fsck5.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-4222\" src=\"https:\/\/contabo.com\/blog\/wp-content\/uploads\/2015\/10\/fsck5-300x22.png\" alt=\"fsck5\" width=\"300\" height=\"22\" srcset=\"https:\/\/contabo.com\/blog\/wp-content\/uploads\/2015\/10\/fsck5-300x22.png 300w, https:\/\/contabo.com\/blog\/wp-content\/uploads\/2015\/10\/fsck5.png 476w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>Depending on which file system is used and which partition has to be checked,&nbsp; you have to use the following commands. This is only a check in advance and your file system will not be repaired.<\/p>\n<ul>\n<li><span style=\"color: #008000;\">fsck.ext2 -n \/dev\/vda1 = For the file system ext2<br \/>\n<\/span><\/li>\n<li><span style=\"color: #008000;\">fsck.ext3 -n \/dev\/vda1 = For the file system ext3<br \/>\n<\/span><\/li>\n<li><span style=\"color: #008000;\">fsck.ext4 -n \/dev\/vda1 = <span style=\"color: #008000;\">For the file system<\/span> ext4<br \/>\n<\/span><\/li>\n<li><span style=\"color: #008000;\">fsck.btrfs -n \/dev\/vda1 = For the file system btrfs<br \/>\n<\/span><\/li>\n<li><span style=\"color: #008000;\">and so on&#8230;<\/span><\/li>\n<\/ul>\n<p>In our case we are using the file system ext4, therefore, we have to use the following command. Please use the command with the right file system type for the rest of the following commands.<\/p>\n<ul>\n<li><span style=\"color: #008000;\">fsck.ext4 -n \/dev\/vda1<\/span><\/li>\n<\/ul>\n<p><a href=\"https:\/\/contabo.com\/blog\/wp-content\/uploads\/2015\/10\/fsck10.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-4234\" src=\"https:\/\/contabo.com\/blog\/wp-content\/uploads\/2015\/10\/fsck10-300x30.png\" alt=\"fsck10\" width=\"300\" height=\"30\" srcset=\"https:\/\/contabo.com\/blog\/wp-content\/uploads\/2015\/10\/fsck10-300x30.png 300w, https:\/\/contabo.com\/blog\/wp-content\/uploads\/2015\/10\/fsck10.png 489w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>You will get as result the errors of your file system. If you would like to repair scattered errors, so use the following command.<\/p>\n<ul>\n<li><span style=\"color: #008000;\">fsck.ext4 \/dev\/vda1<\/span><\/li>\n<\/ul>\n<p><a href=\"https:\/\/contabo.com\/blog\/wp-content\/uploads\/2015\/10\/fsck11.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-4235\" src=\"https:\/\/contabo.com\/blog\/wp-content\/uploads\/2015\/10\/fsck11-300x32.png\" alt=\"fsck11\" width=\"300\" height=\"32\" srcset=\"https:\/\/contabo.com\/blog\/wp-content\/uploads\/2015\/10\/fsck11-300x32.png 300w, https:\/\/contabo.com\/blog\/wp-content\/uploads\/2015\/10\/fsck11.png 493w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>If you think that all errors have to be repaired, please use the following command. This command includes the parameter&nbsp; <em>-y <\/em>which answers all queries with&nbsp; &#8220;Yes&#8221;. It is not necessary to answer them manually.<\/p>\n<p><em><span style=\"color: #ff0000;\">Important: We recommend to use this command only if you are 100 percent sure.&nbsp; All queries will be accepted without further notification. <\/span><br \/>\n<\/em><\/p>\n<ul>\n<li><span style=\"color: #008000;\">fsck.ext4 -y \/dev\/vda1<\/span><\/li>\n<\/ul>\n<p><a href=\"https:\/\/contabo.com\/blog\/wp-content\/uploads\/2015\/10\/fsck12.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-4236\" src=\"https:\/\/contabo.com\/blog\/wp-content\/uploads\/2015\/10\/fsck12-300x32.png\" alt=\"fsck12\" width=\"300\" height=\"32\" srcset=\"https:\/\/contabo.com\/blog\/wp-content\/uploads\/2015\/10\/fsck12-300x32.png 300w, https:\/\/contabo.com\/blog\/wp-content\/uploads\/2015\/10\/fsck12.png 490w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>Your system should start normally once the file system check has been finished.<\/p>\n<p>If you would like to exit the rescue system and booting from the regular hard drive, please use the following command.<\/p>\n<ul>\n<li><span style=\"color: #008000;\">reboot<\/span><\/li>\n<\/ul>\n<p>Your server should will start the operating system now.<\/p>\n<p><span style=\"color: #ff0000;\">Additional important information:<\/span><\/p>\n<p>If you start a file system check , some files might lose the information about their names and locations in the file system. The file system check d<code><\/code>eposits these files in a specific directory called <em>lost+found<\/em>. If there are missing files after you have performed the file system check, you will be able to find the files in this directory in most cases.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The file system check is is a practical tool if an error occurs in your file system and your server is not booting any more. With this tool you can analyse and repair such errors in your file system. We recommend to backup all your data before you start with this operation, because there could [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"_uag_custom_page_level_css":"","site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[18],"tags":[181,328,695,735,813],"ppma_author":[1488],"class_list":["post-3457","post","type-post","status-publish","format-standard","hentry","category-tutorials","tag-contabo","tag-file-system-check","tag-recovery","tag-server","tag-system"],"uagb_featured_image_src":{"full":false,"thumbnail":false,"medium":false,"medium_large":false,"large":false,"1536x1536":false,"2048x2048":false},"uagb_author_info":{"display_name":"Mike","author_link":"https:\/\/contabo.com\/blog\/author\/mike\/"},"uagb_comment_info":0,"uagb_excerpt":"The file system check is is a practical tool if an error occurs in your file system and your server is not booting any more. With this tool you can analyse and repair such errors in your file system. We recommend to backup all your data before you start with this operation, because there could&hellip;","authors":[{"term_id":1488,"user_id":3,"is_guest":0,"slug":"mike","display_name":"Mike","avatar_url":"https:\/\/secure.gravatar.com\/avatar\/3f53b7f35c06dff01c900c8b80069e7f59329f909731d3b79f9fafe983229098?s=96&d=mm&r=g","0":null,"1":"","2":"","3":"","4":"","5":"","6":"","7":"","8":""}],"_links":{"self":[{"href":"https:\/\/contabo.com\/blog\/wp-json\/wp\/v2\/posts\/3457","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/contabo.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/contabo.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/contabo.com\/blog\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/contabo.com\/blog\/wp-json\/wp\/v2\/comments?post=3457"}],"version-history":[{"count":0,"href":"https:\/\/contabo.com\/blog\/wp-json\/wp\/v2\/posts\/3457\/revisions"}],"wp:attachment":[{"href":"https:\/\/contabo.com\/blog\/wp-json\/wp\/v2\/media?parent=3457"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/contabo.com\/blog\/wp-json\/wp\/v2\/categories?post=3457"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/contabo.com\/blog\/wp-json\/wp\/v2\/tags?post=3457"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/contabo.com\/blog\/wp-json\/wp\/v2\/ppma_author?post=3457"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}