Can I run fsck or e2fsck when Linux file system is mounted?
Q. Can I run fsck or e2fsck command when Linux file system is mounted? Do you advice to run fsck on a live file system? I am using Cent OS.
A. No. Do not run fsck on a live or mounted file system. fsck is used to check and optionally repair one or more Linux file systems. Running fsck on a mounted filesystem can usually result in disk / data corruption. So please do not do it. You have two choices
(a) Take down system to single user mode and unmout system
(b) Boot from the installation CD into rescue mode
(a) Take down system to single user mode and unmout system
Following are steps :
=> Use init (process control initialization ) command to change runlevel 1 (singe user mode)
=> Use umount command to unmount /home file system
=> Run fsck using fsck command
Let us say you would like to run fsck on /home (/dev/sda3):
# init 1
# umount /home
# umount /dev/sda
# fsck /homeOR
# fsck /dev/sda3OR
# e2fsck -y /dev/sda3
(b) Boot from the installation CD into rescue mode
If you are using Cent OS/Fedora Core/RHEL linux, boot from first CD and at boot prompt type linux rescue nomount:
boot: linux rescue nomount
Now make new node for disk and partition 3:
# mknod /dev/sda
# mknod /dev/sda3
# fsck /dev/sda3
OR
# e2fsck -y /dev/sda3
Don't forget to reboot the system:
# exit;exit
# reboot
Linux Powered Asus EEE Laptop PC From $299
E-mail
Print
Can't find an answer to your question? Contact us
Related Other Helpful FAQs:
- Linux Optimize Directories ( File Access Time ) in ext3 Filesystem
- What command do you run to check file system consistency under UNIX or Linux?
- Linux Force fsck on the next reboot or boot sequence
- Boot Ubuntu Linux into Rescue mode to fix system
- How do I check and repair MS-DOS file systems under Linux?
Discussion on This FAQ
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!
Tags: data corruption, e2fsck command, fsck command, init, linux boot, linux file system, reboot command, rescue mode, rhel, single user mode


October 2nd, 2007 at 2:38 pm
l will like to know the big difference between fsck and e2fsck commands.
August 13th, 2008 at 5:24 pm
That advise above worked great. But I used to be able to rub “shutdown -rF 0″ to force fsck to run on reboot. But as of Fedora 9 on my i686 32 bit system the -F option is missing. Is there any way to get that option back in the shutdown menue?