Linux – Ext2-fs error which crops up monthly or sometimes weekly

debianext2filesystemslinux

I have an extremely strange error message which causes a complete system crash and remount of the filesystem as read-only. It all started ages ago when I installed a dodgy $2 ebay PCI modem and there were kernel panics showing up monthly and the output was huge. A new hard disk and a dist-upgrade later I have gotten the error to be very sporadic and a lot smaller in terms of what is actually printed. (it's still rubbish to me – even after thorough googling )

This system when booted into Debian has been 'cursed' I was thinking about trashing the computer and getting a new one… but because it is only a Linux problem it must be software!!

Basically here it is (I post now because I crashed today but also yesterday):

EXT2-fs error (device hda1): ext2_check_page: bad entry in directory #5898285: rec_len is smaller than minimal - offset=0, inode=5898285, rec_len=8, name_len=1
Remounting filesystem read-only

What is going on? I then have to pull the power out, reboot, fsck -y, reboot and then that usually settles it for a while.

If this could be figured out I would be so happy.

Thanks in advance for any light you guys can shed on this matter.

–EDIT:

Now running updatedb causes this error every time (well twice) and that means it's reproducible and trackable! (now just to fix it…)

Is it time for a new computer?

–EDIT:

resize2fs /dev/hda1 says it's already the correct amount of blocks long and badblocks doesn't return anything (is it not meant to?)

–EDIT:

Is it possible something is corrupting all my new disks? A hardware problem – someone said it might be the disk controller, or a bios option – is there anyway to check this?

Thanks.

Best Answer

That really does sound like the filesystem's idea of the partition size is different to what the actual partition size is. You said you installed a new hard drive; if you transferred the filesystem to the new hard drive with dd (or some other method that didn't involve a mkfs on the new disk) this could happen.

Try running resize2fs /dev/hda1 from within a rescue environment (after a fsck -f, etc) and see if the filesystem size changes. I'm guessing that it probably will, and your problems will mysteriously go away.

Related Topic