Repairing Linux ext2 or ext3 file system
1) File system must be unmounted, you cannot repair it while it is running. Take system down to runlevel one (make sure you run all command as root user):
# init 1
2)Unmount file system, for example if it is /home (/dev/sda3) file system then type command:
# umount /home
OR
# umount /dev/sda3
3) Now run fsck on the partition:
# fsck /dev/sda3
However be sure to specify the file system type using -t option. Recenly one of our sys admin run the command on ext3 file system w/o specifying file system. Result was more corruption as fsck by default assumes ext2 file system.
# fsck -t ext3 /dev/sda3
OR
# fsck.ext3 /dev/sda3
Tip if you don't know your file system type then typing mount command will display file system type.
fsck will check the file system and ask which problems should be fixed or corrected. If you don't wanna type y every time then you can use pass -y option to fsck.
# fsck -y /dev/sda3
Please not if any files are recovered then they are placed in /home/lost+found directory by fsck command.
4) Once fsck finished, remount the file system:
# mount /home
5) Go to multiuser mode
# init 3
Read man page of fsck for more information. Make sure you replace /dev/sda3 with your actual device name.
You may also be interested in other helpful articles:
- How to Read Ext2 / Ext3 File System From Windows Computer
- How do I Read ext2 or ext3 filesystems under Windows 2000 or XP Desktop?
- Repairing ReiserFS file system with reiserfsck
- Ubuntu Linux Live CD: Save data & desktop information on USB device
- Linux hide files so that no one can see it
Discussion on This Article:
Leave a Reply
We encourage your comments, and suggestions. But please stay on topic, be polite, and avoid spam. Thank you very much for stopping by our site!


simple and effective
good pice of work
can I try same commands on HP/UX?
Commands are same but syntax changes.
To repair HFS file system (/home)
umount /home
fsck –F hfs /dev/vg00/lvo1
mount /home
To repair JFS file system (/home)
umount /home
fsck –F vxfs /dev/vg00/lvo14
mount /home
Replace /dev/XXX/YYY with actual device file.
thanks for HP/UX JFS repair commands
Concise, very effecive and to the point. Just what was required.
excllent work
What about to recover data that are deleted?
Thanks anyway…
http://linux-tweaks.blogspot.com
Hello, i love http://www.cyberciti.biz! Let me in, please
Thankyou - this page saved my life! (well, not literally). After checking loads of links that just told me what it said in the man page, here was a quick, easy and practical way to use the command.
How do you check the / partition - which cannot be unmounted since it still shows as “in use” after going to run level 1? Is there a way without rebooting?
Thanks, very good guide!