PDA

View Full Version : Possible file system errors



pastim
14th March 2012, 09:26 AM
I have a new fedora 16 installation, courtesy of Vortexbox. I am fairly new to linux in general and fedora in particular.

In researching an issue I had I ran"fsck -n" to check the (mounted) file system. It reported the log below. I have already forced fsck to run at boot time, but still get a similar report from "fsck -n".

Is this anything to worry about?



fsck -n
fsck from util-linux 2.20.1
e2fsck 1.41.14 (22-Dec-2010)
Warning! /dev/mapper/VolGroup-lv_root is mounted.
Warning: skipping journal recovery because doing a read-only filesystem check.
/dev/mapper/VolGroup-lv_root contains a file system with errors, check forced.
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
Free blocks count wrong (4339028, counted=4338978).
Fix? no

Free inodes count wrong (1202357, counted=1202352).
Fix? no


/dev/mapper/VolGroup-lv_root: ********** WARNING: Filesystem still has errors **
********

/dev/mapper/VolGroup-lv_root: 78763/1281120 files (0.2% non-contiguous), 780972/
5120000 blocks
[vortexbox.localdomain ~]#


I tried to find out what fsck had done at boot time but when I found 'boot.log' it only reported on the last few %, so I don't know what happened.

DBelton
14th March 2012, 10:22 AM
run



e2fsck -p


You will have to boot from a livecd or DVD and make certain your filesystem is not mounted. You do need to fix those errors.

It is possible that those errors are only due to running it on a mounted filesystem, but I would run a full check on it unmounted just to make certain.

jpollard
14th March 2012, 12:33 PM
It is almost certainly due to being mounted.

The root filesystem always have files open (/var/log,/tmp, even /home...). These files will always have a few blocks internally allocated for writing, but have not been commited to disk. Also note, the journal file may have a number of pending transactions to commit.

The combination of both of these cause "Free block count" errors as the disk resident data has not been updated yet.

The "Free inode count" errors are due to the same, but here there have been new files created (could be /var/log, could be /tmp could even be /home if /home is part of the root filesystem). These files may have their inode usage in the journal, or even in memory.

It just means the filesystem is in use.

The only way to be sure the filesystem is valid is to do it when it is dismounted, or mounted read only (used for checking). Any repairs done wile mounted will corrupt the system...

Gareth Jones
14th March 2012, 01:17 PM
If you don't have a live disc handy, use the GRUB menu to add " 1" to the end of the kernel command line to boot into single-user mode. Then run

umount -a
fsck -f -y
to unmount all mounted file-systems (/ will automatically be remounted read-only, which is safe enough), and to force a check and attempt repair all disk file-systems. Then reboot.

pastim
14th March 2012, 04:17 PM
If you don't have a live disc handy, use the GRUB menu to add " 1" to the end of the kernel command line to boot into single-user mode. Then run

umount -a
fsck -f -y
to unmount all mounted file-systems (/ will automatically be remounted read-only, which is safe enough), and to force a check and attempt repair all disk file-systems. Then reboot.
I don't know if I have a 'live' disc - I have a bootable ISO for installation, but I don't understand the reference to 'live'.

I guess I should try and find out about GRUB menus, but I know nothing whatsoever about them, nor how to modify them, nor what the risks are in doing so. I'll think I'll have to assume the previous post is correct and that's it is all OK.

I was hoping there would be a way of seeing the report from a forcefsck which should have checked the system at reboot, to see if it said all was OK or not. Isn't it a bit strange not to log the output somewhere? Or is it stored somewhere I am unaware of?

jpollard
15th March 2012, 02:36 AM
It should be in the /var/log/messages file, but those have been lacking ever since F15, and I don't clearly remember them from before (but then, I don't need to reboot that often, so the auto-fsck due to reaching a mount limit count doesn't happen, and It has been years since I've had a crash/power fail that marked the disks as corrupted - the journal has been taking care of most of that.

Gareth Jones
15th March 2012, 03:19 AM
I don't know if I have a 'live' disc - I have a bootable ISO for installation, but I don't understand the reference to 'live'.

The live discs actually run a Fedora desktop when you boot them, which you can then install (i.e. copy) to hard-disk, or use to e.g. repair or check an installed system. The installation DVD boots to the installer rather than a desktop, but you can still switch to a virtual console (Ctrl+Alt+Fx) and type commands into it, so that should be okay too.


I'll think I'll have to assume the previous post is correct and that's it is all OK.

Better to try and run the full check as described. Presumably there was a good reason to run fsck originally, so there might be real errors hidden amongst all the "false" errors, especially if /forcefsck-induced fsck was complaining on boot.


I was hoping there would be a way of seeing the report from a forcefsck which should have checked the system at reboot, to see if it said all was OK or not. Isn't it a bit strange not to log the output somewhere? Or is it stored somewhere I am unaware of?

/var/log/messages and /var/log/boot.log would be the obvious places, so if it isn't there (or in one of the older rotated logs with names ending "-YYYYMMDD"), I don't know where to look.

pastim
15th March 2012, 09:25 AM
The live discs actually run a Fedora desktop when you boot them, which you can then install (i.e. copy) to hard-disk, or use to e.g. repair or check an installed system. The installation DVD boots to the installer rather than a desktop, but you can still switch to a virtual console (Ctrl+Alt+Fx) and type commands into it, so that should be okay too.

My system doesn't have a keyboard or monitor. I could try & attach them, although I never have, if I can find the right cables and so on.



Better to try and run the full check as described. Presumably there was a good reason to run fsck originally, so there might be real errors hidden amongst all the "false" errors, especially if /forcefsck-induced fsck was complaining on boot.


I ran it originally because a particular programme was behaving strangely, not processing files beyond a certain point. That problem has (rather mysteriously) disappeared, not as a result of running a forcefsck. I don't know if forcefsk complained on boot, since I can't find any relevant log. It's puzzling that one can run such things but have no evidence of what it did or did not do.



/var/log/messages and /var/log/boot.log would be the obvious places, so if it isn't there (or in one of the older rotated logs with names ending "-YYYYMMDD"), I don't know where to look.

I'll have to accept this, but I find it very strange (however I find much of linux very strange, so nothing new there). I am also surprised that a check on the file system (fsck -n) appears to be incapable of reporting 'no errors' but that seems to be the case (others users of the system I'm using have now reported similar results). There's really not much point in such a report since it induces concern for no apparent reason.

This box is meant to sit in a corner quietly acting as a NAS. I really want to keep it stable by leaving it alone, not do anything I am unsure about, nor update it or change it in any way, unless I have to.

So I'll leave it alone. Thanks to all for the advice.

DBelton
15th March 2012, 02:33 PM
If you set the forcefschk and it booted, then it didn't find an issue with your file system. (it does give messages, but if it finds errors that it can't automatically fix, it will toss you out to a emergency shell and tell you to run fsck manually and fix the problems.

pastim
15th March 2012, 04:15 PM
If you set the forcefschk and it booted, then it didn't find an issue with your file system. (it does give messages, but if it finds errors that it can't automatically fix, it will toss you out to a emergency shell and tell you to run fsck manually and fix the problems.
Ah Ha! Thanks for that. I wouldn't have seen the emergency shell (having no monitor attached) but even I would have noticed that it didn't boot.:D

Gareth Jones
15th March 2012, 10:24 PM
Okay, under those circumstances I concur, no need to pursue fsck further.