Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I run dmesg and this is what I see:

EXT4-fs (sda1): warning: mounting fs with errors, running e2fsck is recommended
EXT4-fs (sda1): mounted filesystem with ordered data mode. Opts: 

Here is the stuff in context

EXT3-fs (sdd1): using internal journal
EXT3-fs (sdd1): mounted filesystem with ordered data mode
EXT4-fs (sda1): warning: mounting fs with errors, running e2fsck is recommended
EXT4-fs (sda1): mounted filesystem with ordered data mode. Opts: 
EXT4-fs (sdb1): warning: maximal mount count reached, running e2fsck is recommended
EXT4-fs (sdb1): mounted filesystem with ordered data mode. Opts: 
EXT4-fs (sdc1): warning: maximal mount count reached, running e2fsck is recommended
EXT4-fs (sdc1): mounted filesystem with ordered data mode. Opts: 
Adding 4194296k swap on /dev/sdd2.  Priority:-1 extents:1 across:4194296k SSD
kjournald starting.  Commit interval 5 seconds
EXT3-fs (loop0): warning: maximal mount count reached, running e2fsck is recommended
EXT3-fs (loop0): using internal journal
EXT3-fs (loop0): mounted filesystem with ordered data mode

what is e2fsck anyway? How to run it?

share|improve this question
add comment

4 Answers 4

Seems your disk is damaged I recommend you to stop using it. Fsck stands for file system check which is a tool to repair problems in file systems. As the usage of this tool can result in dataloss if some details are not observed (i.e. running it on a mounted file system) strongly recommend you to read this manpage And google a bit before taking any decision.

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

  1. Take down system to single user mode and unmout system
  2. Boot from the installation CD into rescue mode

Following are the relevant steps in each case:

  1. Take down system to single user mode and unmout system

    • Use init (process control initialization ) command to change runlevel 1 (singe user mode)
    • Use umount command to unmount /home file system
    • Run the filesystem check using the 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/sda3

OR

e2fsck -y /dev/sda3

2.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:

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
reboot
share|improve this answer
    
Is there a way to reboot and specify to run efsck during reboot? I've heard about shutdown -rf could this be hardware? My provider insist that the problem is in user (me) rather than hardware. –  Jim Thio Aug 20 '13 at 7:21
    
/home1 is not the system file. However, I got "maximal mount count reached" on all other files too and I do not know how to fix that. None are the system file. –  Jim Thio Aug 20 '13 at 7:33
    
if I type umount /home1 given that sda/sda1 is mounted as /home1, that means /dev/sda will be unmounted right? sda1 is the only partition in sda –  Jim Thio Aug 20 '13 at 7:34
    
Why is it mounted more than x times? What's the limit? What's the problem? The drives are new. I only mount each once. –  Jim Thio Aug 20 '13 at 11:59
    
@JimThio it is mounted every time you reboot. See my answer. –  terdon Aug 20 '13 at 12:09
show 4 more comments

First of all, as far as I can tell, your disk is fine and everyone should relax. This is a safety feature, you can set a disk to be checked on each mount or after a specified number of mounts. If you have not done so, your system will give you the warnings you show, letting you know that it has been a while since the disk was last checked and that it would be a good idea to check it for errors (that's what e2fsck does).

Note that the error says:

warning: maximal mount count reached, running e2fsck is recommended

That's a warning, not an error, and a recommendation, not a command.

The warning: mounting fs with errors, running e2fsck is recommended is a bit more worrying but can probably be fixed by e2fsck.

This all comes down to /etc/fstab options. A typical fstab partition entry looks like this:

# <file system>       <dir>         <type>    <options>             <dump> <pass>
UUID=123-456-ABC-DEF   /             ext4      defaults,noatime      0      1

The last field, pass, specifies how/when the disk should be checked for errors. If it is set to 0, the drive will never be checked, if set to 1, it will be checked on each boot and if set to 2 or more, it will be checked each time it has been mounted more than a specified (30 by default) number of times without being checked.

Given the warnings you observe, my guess is that you have set it to 0 in your /etc/fstab. The recommended values are 1 for your /partition and 2 or higher for everything else. If set at a value greater than 1, the system will check your drive for errors every 30 mounts. To change the frequency of checking (for example, to check every 20 mounts), run:

tune2fs -c 20 /dev/sda1

So, while @vfbsilva's answer is perfectly correct, it would be much easier to simply edit your /etc/fstab, change the pass value for the partition in question to 2 and reboot. That should cause the drive to be checked and the warnings to go away.

share|improve this answer
    
seems stange that the error is mentioned before the count of mounts, does it matters in this contexts? –  vfbsilva Aug 20 '13 at 18:30
    
@vfbsilva they refer to different disks, the mounting fs with errors is about sda1 and the count warning is about sdb1. –  terdon Aug 20 '13 at 18:33
add comment

DANGER....DANGER....

To avoid losing information or compromising your disk further, IMMEDIATELY dismount the affected disks and run e2fsck as directed!!! You should never mount and use a damaged disk.

If you fail to do this your disk is getting more and more corrupted and might become unsalvageable.

Then of course you'll have to rely on those fine backups you have been using.

share|improve this answer
add comment

Apparently when mounting this device the kernel detected that your file system has not been cleanly unmounted, so it might have errors.

You have to first unmount it and then run the filesystem check like e2fsck /dev/sda1. This will check if there are any errors, and if so it asks you whether it should fix them.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.