How to fix your Debian file system with fsck

Today my server is suddently report with file system error (ext4) after reboot. Some partition is not able to mount automatically and require for fsck. Here are some simple sharing about how to fix it safely.

Boot your server with Debian installation CD/DVD

First of all you should shutdown your server, and prepare with yor Debian installation CD/DVD. Both full or netinst version is suitable, or even a gparted live cd. BTW, the main point is: this bootable linux should support your harddisk controller. In case of my server it is running on hardware RAID5 with 3ware 9650SE-8LPML, so a latest Debian stable installation CD is a minimum requirement.

Go into "Rescue mode"

Once boot up your server with CD/DVD, choose "Advanced options" and "Rescue mode":

[img_assist|nid=532|title=|desc=|link=node|align=left|width=240|height=188]

Just answer some basic question (they don't really affect your real system, just store as temporary) and soon you will face this page and ask for your root file system (i.e. your /; in case of my server, it is /dev/sda3); BUT!! Let's choose for "Do not use a root file system":

[img_assist|nid=533|title=|desc=|link=node|align=left|width=240|height=188]

Fix the file system with fsck

Now execute with the shell and run with following command in order to check your online harddisks:

parted -l

Once you discover your online harddisk and its partition, now we can fix it with fsck, e.g.

fsck.ext3 -yfv /dev/sda1 fsck.ext3 -yfv /dev/sda3

After all checking completed, now we should shutdown the server, remove the bootable CD/DVD, and start your server again. It should now be fixed :D

Tags: 

Add new comment

Restricted HTML

  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd> <h4> <h5> <h6>
  • Lines and paragraphs break automatically.
  • Web page addresses and e-mail addresses turn into links automatically.
  • HTML tags will be transformed to conform to HTML standards.

Plain text

  • No HTML tags allowed.
  • Lines and paragraphs break automatically.
  • Web page addresses and e-mail addresses turn into links automatically.
CAPTCHA
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.