PDA

View Full Version : Hard link count is wrong



jaapvstr
11th October 2006, 10:20 AM
When i typed the following to search for the smartd daemon
'find -name smart'

I got the following message:

"find: WARNING: Hard link count is wrong for ./selinux: this may be a bug in your filesystem driver. Automatically turning on find's -noleaf option. Earlier results may have failed to include directories that should have been searched."

What happend? :eek: :)

It's a fresh installed 64 bit system without gnome or kde, just the basics.

stevea
11th October 2006, 07:24 PM
The find command require a directory name before the 'expression'- like
'find / -name smartd'

Still your message is puzzling. There are several 'selinux' directories,
but hard links typically do not apply to directories.

Also try the "locate" command sometime. It requires use of the updatedb
program to collect file info, but is much faster, tho' less flexible than find.

[me@here ~]# locate smartd
/etc/smartd.conf
/etc/rc.d/init.d/smartd
/etc/rc.d/rc0.d/K40smartd
/etc/rc.d/rc1.d/K40smartd
/etc/rc.d/rc2.d/S40smartd
/etc/rc.d/rc3.d/S40smartd
/etc/rc.d/rc4.d/S40smartd
/etc/rc.d/rc5.d/S40smartd
/etc/rc.d/rc6.d/K40smartd
/usr/sbin/smartd
/usr/sbin/smartd-conf.py
/usr/sbin/smartd-conf.pyc
/usr/sbin/smartd-conf.pyo
/usr/share/doc/smartmontools-5.36/smartd.conf
/usr/share/logwatch/default.conf/services/smartd.conf
/usr/share/logwatch/scripts/services/smartd
/usr/share/man/man5/smartd.conf.5.gz
/usr/share/man/man8/smartd.8.gz
/var/lock/subsys/smartd

jaapvstr
12th October 2006, 08:11 AM
What are hard links then? it's the /selinux directory from root i think, since thats what i searched from.

yeah, i found the smartd daemon in the end, and figured out locate. But that message just had me puzzling if there's something wrong with my system?

thanks for your help

By the way, does anyone know a way to search for files with a certain content instead of just the name?

mwette
12th October 2006, 01:53 PM
If you suspect filesystem inconsistency, try "fsck".

To search for files with specific content you can use find.
For example, if I want to search for ".c" files with mySpecificFtn I can use

find . -name '*.c' -exec grep mySpecificFtn {} \; -print
This will look at all .c files under the current directory and grep for the
function. If found, find will print the path to the file.

jaapvstr
12th October 2006, 04:03 PM
thanks alot, i'll sure use find that way often :)!

On the fsck program i got the following message:

WARNING!!! Running e2fsck on a mounted filesystem may cause
SEVERE filesystem damage.

Do you really want to continue (y/n)?

Anyway to run it without causing severe damage? I dont know much about mounting :S Currently digging alot into networking and iptables.

mwette
13th October 2006, 02:07 AM
On the fsck program i got the following message:

WARNING!!! Running e2fsck on a mounted filesystem may cause
SEVERE filesystem damage.

Do you really want to continue (y/n)?

Anyway to run it without causing severe damage? I dont know much about mounting :S

Yes fsck may attempt to do repairs. One option is to run with "-n".
This tells fsck to not repair the disk. The other option is to run in
single-user mode (i.e., "init 1" -- try "man init").

jaapvstr
13th October 2006, 01:39 PM
I run it with -n:



fsck 1.38 (30-Jun-2005)
e2fsck 1.38 (30-Jun-2005)
Warning! /dev/VolGroup00/LogVol00 is mounted.
Warning: skipping journal recovery because doing a read-only filesystem check.
/dev/VolGroup00/LogVol00 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 (18345017, counted=18344986).
Fix? no

Free inodes count wrong (19234332, counted=19234296).
Fix? no

/dev/VolGroup00/LogVol00: ********** WARNING: Filesystem still has errors **********
/dev/VolGroup00/LogVol00: 33252/19267584 files (1.5% non-contiguous), 922567/19267584 blocks

What does this information tell me? What could have gone wrong? *trying to learn something about the filesystem*

mwette
13th October 2006, 01:45 PM
What does this information tell me? What could have gone wrong? *trying to learn something about the filesystem*

It happens. I believe you can have fsck run and repair on on next boot by doing:


# touch /forcefsck

and then rebooting.

jaapvstr
13th October 2006, 02:19 PM
It runs then, but it doesn't fix anything. running it after reboot with -n again produces similar results with different numbers.

mwette
14th October 2006, 02:04 AM
It runs then, but it doesn't fix anything. running it after reboot with -n again produces similar results with different numbers.

OK. Then try "init 1", which puts you in single user mode, followed by fsck.
I think it should be able to run in single user mode. [It been years since I
had to do this with Sun boxes.]