{"id":126,"date":"2013-10-05T07:36:00","date_gmt":"2013-10-05T07:36:00","guid":{"rendered":"http:\/\/265@jodohost.com\/\/blog\/"},"modified":"2013-10-05T07:36:00","modified_gmt":"2013-10-05T07:36:00","slug":"file-system-check-for-bad-sectors-on-a-drive-in-linux","status":"publish","type":"post","link":"http:\/\/www.jodohost.com\/blog\/index.php\/2013\/10\/05\/file-system-check-for-bad-sectors-on-a-drive-in-linux\/","title":{"rendered":"File system check for bad sectors on a drive in Linux"},"content":{"rendered":"<p>Sometimes our disk has bad sectors or may have errors like an input-output related error or be in a read-only file system. At that time we can use e2fsck which is a file system check utility to check for bad sectors on the disk or to resolve other errors on the disk.<\/p>\n<p>However, mostly we use a e2fsck utility when a drive is in a Read-Only file system or when we want to scan our hard disk for bad sectors.<\/p>\n<p>To run e2fsck in a correct way is necessary, which should be like below:- <\/p>\n<p>Step 1: It is always recommended to scan a file system in single-user mode. So first go to single-user mode.<br \/>Step 2: Unmount the partition on which you would like to run it.<\/p>\n<p>[root@localhost ~]# umount\u00a0 \/dev\/sda1<\/p>\n<p>Step 3: After this run the e2fsck utility on the system as below:- <\/p>\n<p>[root@localhost ~]# e2fsck -y -v -f \/dev\/sda2 <\/p>\n<p>-y = To auto access yes for all questions.<br \/>-v = Verbose mode output<br \/>-f = Forcefully<\/p>\n<p>Once the file system check is completed, again mount the drive and then shutdown and start the Linux machine. That&#8217;s all.<\/p>\n<p> ]]><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Sometimes our disk has bad sectors or may have errors like an input-output related error or be in a read-only file system. At that time we can use e2fsck which is a file system check utility to check for bad sectors on the disk or to resolve other errors on the disk. However, mostly we [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[2],"tags":[],"_links":{"self":[{"href":"http:\/\/www.jodohost.com\/blog\/index.php\/wp-json\/wp\/v2\/posts\/126"}],"collection":[{"href":"http:\/\/www.jodohost.com\/blog\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.jodohost.com\/blog\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.jodohost.com\/blog\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.jodohost.com\/blog\/index.php\/wp-json\/wp\/v2\/comments?post=126"}],"version-history":[{"count":0,"href":"http:\/\/www.jodohost.com\/blog\/index.php\/wp-json\/wp\/v2\/posts\/126\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.jodohost.com\/blog\/index.php\/wp-json\/wp\/v2\/media?parent=126"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.jodohost.com\/blog\/index.php\/wp-json\/wp\/v2\/categories?post=126"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.jodohost.com\/blog\/index.php\/wp-json\/wp\/v2\/tags?post=126"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}