Technical article 114061

Why does fsck fail after Phase 1 with "BAD STATE # FOR INODE I=XXX?"

OpenServer 5.0.0OpenServer 5.0.2OpenServer 5.0.4OpenServer 5.0.5OpenServer 5.0.6

Written · Last revised

Problem

Running fsck -ofull, either from the Emergency Boot and Floppies or from single user mode, the following output is seen:

# fsck -ofull
/dev/root
HTFS File System: Volume:

** Root file system ** Phase 1 - Check Blocks and Sizes BAD STATE # FOR INODE I=XXX #

The shell prompt is now shown, fsck has failed to fix anything and will continue showing this error message every time it is run.

Cause

There are many reasons why fsck is failing with this error. This is the default error message for fsck if it cannot determine the state of a particular inode. Most likely the reason for receiving this error message is hardware corruption of the hard disk. Other possibilities are bad disk geometry from an incompatible kernel and/or superblock.

Solution

Do not continue using the system; have the hardware inspected immediately. If the hardware has been diagnosed and is functioning properly, then there is another reason for fsck failing here.

If you are running fsck from single user, it is advised to run this
from the Emergency Boot and Root floppy disks.  This ensures that
there no activity on the root filesystem and allows fsck to fully
check your file system.
One possible solution is to clear out this specific inode.  To do
this, run the clri command on the file system that is being checked
with the inode number that fsck originally complained about. The
following example is from the root file system, where XXX is the
inode number from the above error message:
# clri / XXX; fsck -ofull

The fsck command must be run immediately after the clri command, otherwise the system may attempt to reuse this inode.

If you are running this from the boot and root floppies, if may be
possible that the kernel on the boot floppy is corrupted or
incompatible with your system.  To verify this, attempt to run fsck
from single user mode, booting from the hard disk.

You should recreate your boot floppy disk using mkdev fd and retest. If fsck is still failing, mkdev fd could be stripping a needed driver from the mini-kernel it creates. To solve this, mount the boot floppy disk, compress the current kernel you are using (most likely /stand/unix) and replace the kernel on the floppy disk.

# mount /dev/fd0 /mnt
# cp /stand/unix /tmp
# compress /tmp/unix
# mv /tmp/unix.Z /mnt/unix.Z
# umount /mnt

This kernel may be too big. Another option is to compress unix.install, name it to unix.Z, and move it to the floppy.

This must be tested with each new kernel.

See also

TA # 110737 "Filesystems on my SCSI disk drive are no longer accessible after moving it to another OpenServer 5 system, or after making various SCSI configuration changes."

TA # 104384 "How is the badtrk scheme implemented?"

From the Xinuos technical article database, record 114061. Reproduced with permission. The original is at www.sco.com/ta/114061, which is reachable but blocked from search engines. Xinuos marks this article against a retired product line. That refers to the product’s lifecycle, not to whether the advice still works — plenty of it still applies to running systems.

Next step

Need this fixed rather than explained?

Tell us the release, what the system runs and what it is doing. We will reply by email with what we would do next.

  • You deal with the people who do the work
  • No obligation, and no upgrade required before we will help
  • We tell you plainly if something is not worth doing

Send an enquiry

We reply by email. If a server is down, say so in the first line. You can also write to help@scoexpert.com.