fsck Command – Check & Repair Linux & Unix File Systems

Phase 3: Check Connectivity

This phase checks the directories examined in Phase 2. It reports error conditions resulting from:

  • unreferenced directories
  • missing or full lost+found directories

fsck error messages, warning messages and responses for Phase 3 – Check Connectivity.

3.1) UNREF DIR I=OWNER=O MODE=M SIZE=S MTIME=T (RECONNECT)

The directory the inode number was not connected to a directory entry when the file system was traversed. The owner O, mode M, size S, and modify time T of directory the inode number are printed. When preening, the directory is reconnected if its size is non-zero; otherwise it is cleared.

Possible responses to the RECONNECT prompt are:

YES Reconnect directory the inode number to the file system in the directory for lost files (usually the lost+found directory). This might generate the lost+found error messages in Phase 3 if there are problems connecting directory the inode number to the lost+found directory. It can also generate the CONNECTED error message in Phase 3 if the link was successful.

NO Ignore this error condition. This generates the UNREF error message in Phase 4.

3.2) NO lost+found DIRECTORY (CREATE)

There is no lost+found directory in the root directory of the filesystem; When preening, fsck tries to create a lost+found directory.

Possible responses to the CREATE prompt are:

YES – Create a lost+found directory in the root of the filesystem. This might produce the message:
NO SPACE LEFT IN / (EXPAND)

Inability to create a lost+found directory aborts the attempt to link up the lost inode, and generates this message:
SORRY. CANNOT CREATE lost+found DIRECTORY
This in turn generates the UNREF error message in Phase 4.

NO – Abort the attempt to link up the lost inode. This generates the UNREF error message in Phase 4.

3.3) lost+found IS NOT A DIRECTORY (REALLOCATE)

The entry for lost+found is not a directory.

Possible responses to the REALLOCATE prompt are:

YES –  Allocate a directory inode, and change lost+found to reference it. The previous inode referenced by the lost+found directory is not cleared. Thus, it is either reclaimed as an UNREF’ed inode or has its link count ADJUST’ed later in this phase. Inability to create a lost+found directory generates the message:
SORRY. CANNOT CREATE lost+found DIRECTORY
and aborts the attempt to link up the lost inode. This in turn generates the UNREF error message in Phase 4.

NO – Abort the attempt to link up the lost inode. This generates the UNREF error message in Phase 4.

3.4) NO SPACE LEFT IN /lost+found (EXPAND)

There is no space to add another entry to the lost+found directory in the root directory of the filesystem. When preening, the lost+found directory is expanded.

Possible responses to the EXPAND prompt are:

YES Expand the lost+found directory to make room for the new entry. If the attempted expansion fails fsck prints the message:
SORRY. NO SPACE IN lost+found DIRECTORY
and aborts the attempt to link up the lost inode. This in turn generates the UNREF error message in Phase 4. Clear out unnecessary entries in the lost+found directory. This error is fatal if the
file system is being repaired.

NO Abort the attempt to link up the lost inode. This generates the UNREF error message in Phase 4.

3.5) DIR I=I1 CONNECTED. PARENT WAS I=I2

This is an advisory message indicating that a directory the inode number 1 was successfully connected to the lost+found directory. The parent the inode number 2 of the directory the inode number 1 is replaced by the inode number of the lost+found directory.

3.6) DIRECTORY F LENGTH S NOT MULTIPLE OF B (ADJUST)

A directory F has been found with size S that is not a multiple of the directory block size B. (Note that this may reoccur in Phase 3 if the error condition is not corrected in Phase 2).

Possible responses to the ADJUST prompt are:
YES Round up the length to the appropriate block size. When preening, the file system only a warning is printed and the directory is adjusted.

NO Ignore the error condition.

3.7) BAD INODE S TO DESCEND

An internal error has caused an impossible state S to be passed to the routine that descends the
file system directory structure. fsck exits.

Initialization Phase
** phase 1 – Check Blocks and Sizes
** phase 2 – Check Pathnames

** phase 3 – Check Connectivity

NEXT>>** phase 4 – Check Reference Counts
** phase 5 – Check Cylinder Groups
cleanup phase

2 thoughts on “fsck Command – Check & Repair Linux & Unix File Systems

Comments

This site uses Akismet to reduce spam. Learn how your comment data is processed.