All this happens as super user. First do a "umount /dev/hda6".. If it won't umount, find out which program is accessing something on that disk. A way to find which file is open on hda6 is to run "/usr/sbin/lsof | more" and look for the file that is being accessed. To find the file you will need to run "df /dev/hda6" and see where the mount point is. lsof dumps a lot of stuff, like libraries in use, etc. You have to umount that partition or you could risk scrambling the partition. You might have to start your machine in single user mode.
The "fsck" command will call the proper program to fix your /dev/hda6 file system type. It probably call /sbin/fsck.ext2 or /sbin/fsck.ext3
You might try seeing which file inode number 51291 is hooked to. If you do a "ls -i -R <mount-pt-of-/dev/hda6>", the ls command might tell you which file that Inode is associated with. Inodes for a single file a chained together and I don't know how to traverse the inode list.
Then run /sbin/fsck -f -p /dev/hda6". The -a is the "automatic mode". I would try the -p mode (prompt) first. It will prompt you for your fix, if you know what it should be!! The program should dump enough to tell you what might be wrong. The -f is the flag to force a scan. I would just enter "yes" for the program to fix it. Hope, that nothing breaks and you have a good backup. When you are done, run it again: "/sbin/fsck -f /dev/hda6". If you don't put the -f, fsck will return in about 2 seconds and say "everything is OK". Type "sync" when you're done to flush changes to the file systems.
If you want, you can try e2fsck and debugfs.
Good luck. Just one unattached inode isn't bad. Wait tell you have 30 or 40, then the easiest thing to do is just say "yes".