COHERENT manpages

This page displays the COHERENT manpage for fsck [Check and repair file systems interactively].

List of available manpages
Index


fsck -- Command

Check and repair file systems interactively
/etc/fsck [ -fnqsSy ] [ -t tempfile ] [ filesystem ... ]

fsck checks  and interactively repairs file systems.  If  all is well, fsck
merely prints the number of files  used, the number of blocks used, and the
number  of  blocks that  are  free.  If  the  file system  is  found to  be
inconsistent in  one of  the aspects outlined  below, fsck asks  whether it
should fix the inconsistency and waits for you to reply yes or no.

The following file system aspects are checked for consistency by fsck:

-> If a block is claimed by more than one i-node, by an i-node and the free
   list, or more than once in the free list.

-> Whether  an  i-node or  the  free  list claims  blocks  beyond the  file
   system's range.

-> Link counts that are incorrect.

-> Whether the directory size is not aligned for 16 bytes.

-> Whether the i-node format is correct.

-> Whether any blocks are not accounted for.

-> Whether a file points to an unallocated i-node.

-> Whether a file's i-node number is out of range.

-> Whether the super block refers to more than 65,536 i-nodes.

-> Whether the  super block  assigned more blocks  to the i-nodes  than the
   system contains.

-> Whether the format of the free block list is correct.

-> Whether the  counts of the  total free blocks  and the free  i-nodes are
   correct.

fsck prints  a warning message  when a file  name is null,  has an embedded
slash `/',  is not  null-padded, or if  `.' or `..'  files do not  have the
correct i-node numbers.

When  fsck repairs  a file  system,  any file  that is  orphaned (that  is,
allocated but  not referenced) is  deleted if it  is empty, or  copied to a
directory  called lost+found,  with  its i-node  number as  its name.   The
directory  lost+found must  exist  in the  root  of the  file system  being
checked before  fsck is  executed, and  it must have  room for  new entries
without requiring that new blocks be allocated.

fsck recognizes the following options:

-f Fast check.  fsck  only checks whether a block has  been claimed by more
   than one  i-node, by an i-node  and the free list, or  more than once in
   the free list.  If necessary, fsck will reconstruct the free list.

-n No option: a default reply of no is given to all of fsck's questions.

-q Quiet option: run  quietly.  fsck automatically removes all unreferenced
   pipes, and  automatically fixes list  counts in the super  block and the
   free list.   File-name warning messages  are suppressed, but  fsck still
   prints the  number of  files used,  the number of  blocks used,  and the
   number of blocks that remain free.

-s Sort the  free lists, both  free blocks and  free i-nodes, based  on the
   interleave number.   This is useful in reducing  fragmentation of a file
   system.  This option ignores mounted file systems.

-S Same as  -s, except  that it  also works on  mounted file  systems.  Not
   recommended for the faint of heart.

-t Name the temporary file used by fsck.

-y Yes option: a default reply of yes is given to all of fsck's questions.

If you  do not name a  file system in fsck's command  line, fsck checks the
file systems named in the file /etc/checklist.

Files

/etc/checklist

See Also

clri,
commands,
icheck,
ncheck,
ram,
sync,
umount

Diagnostics

The  following describes  fsck's error messages  and questions.   The error
messages  fall  into two  categories:  warnings,  which describe  something
possibly wrong  with a file; and fatals, which  indicate that something has
gone wrong with a file system,  or with fsck itself, with which fsck cannot
cope.   Each question  describes  the condition  in question;  here, it  is
followed by advice on what is probably the correct response.

Bad action in virtual system (fatal)
Bad block number, i-number = number (warning)
Number Bad blocks in Free List (warning)

Bad/Dup blocks in i-node type file name (Clear i-node) [yes/no] (question)
     The given  i-node contains bad or  duplicately referenced blocks.  You
     are asked  if you would like  to clear the i-node  completely.  If you
     answer yes, then the file will be lost forever.

Bad entry in block number in directory name/i-node (warning)

Bad Free List (SALVAGE) [yes/no] (question)
     fsck is asking if you want  it to salvage the free list automatically.
     This is almost certainly a good thing to do.

Bad or Dup blocks in directory/file (Remove) [yes/no] (question)
     The  given  file's i-node  references  bad  or duplicately  referenced
     blocks.  fsck is asking if you wish to remove file from the directory.

Bad Super Block: number (warning)
Number Blocks missing (warning)

***** BOOT Coherent (NO SYNC!) ***** (message)
     Do as  the message says:  reboot COHERENT without  running the command
     sync.

Cannot close Ram Disk Close /dev/rram1close (fatal)
Cannot create temp file name (fatal)

Cannot open Ram Disk Close /dev/rram1close (fatal)
Cannot open read/write Ram Disk /dev/rram1 (fatal)

Can not Read: Blk num: number  (CONTINUE) [yes/no] (question)
     The  given  action could  not  be  performed.  If  you  choose to  not
     continue, fsck will abort.  If you choose to continue, the results may
     be unpredictable.

Can not Seek: Blk num: number  (CONTINUE) [yes/no] (question)
     The  given  action could  not  be  performed.  If  you  choose to  not
     continue, fsck will abort.  If you choose to continue, the results may
     be unpredictable.

Can not Write: Blk num: number  (CONTINUE) [yes/no] (question)
     The  given  action could  not  be  performed.  If  you  choose to  not
     continue, fsck will abort.  If you choose to continue, the results may
     be unpredictable.

Can't access ram disk /dev/rram1, use the -t option (fatal)
Can't malloc memory, phase 2 (fatal)
Can't malloc  space for interleave  table. Free-block list  is not rebuilt.
     (warning)
Can't open: file system (warning)
Can't open checklist file: /etc/checklist (fatal)
Can't stat: file system (warning)
Can't stat temp file name (fatal)

Count = count, should be count (Adjust) [yes/no] (question)
     The given i-node  claims to have a different number  of links than was
     actually  found in  the file  system.  You  are asked  if you  wish to
     adjust the  count found in the  i-node.  If you answer  yes, then fsck
     will correct the i-node count.

Directory Misaligned i-number = number (warning)
Dir i-number = number connected. Parent was i-number = number (warning)
Dir i-number = number connected.  It has bad/dup blocks. (warning)
Dir i-number = number connected.  It has no .. entry. (warning)

Dup/Bad blocks in root i-node (Continue) [yes/no] (question)
     The root i-node has bad or  duplicate blocks.  This may require a guru
     to fix properly.  fsck is asking  whether you want it to continue.  If
     not, then fsck will abort.

Dup Block number, i-number = number (warning)
Number Dup blocks in Free List (warning)

DUP Table Overflow (Continue) [yes/no] (question)
     The table  of duplicately referenced disk  blocks has overflowed.  You
     can continue with the fsck (as best as it is able), or abort.

Embedded  slashes  in  entry  in  block  number  in  directory  name/i-node
     (warning)
Error seeking tmp file (fatal)
Error writing tmp file (fatal)
Error writing to tmp file (fatal)

Excessive Bad Blocks i-number = number (Continue) [yes/no] (question)
     The  specified i-node  references an excessive  number of  bad blocks.
     You can continue with the fsck (at the next i-node), or abort.

Excessive Dup Blocks i-number = number (Continue) [yes/no] (question)
     The  specified  i-node references  an  excessive  number of  duplicate
     blocks.   You can  continue with  the  fsck (at  the next  i-node), or
     abort.


Excessive bad/dup blocks in free list (Continue) [yes/no] (question)
     This indicates that  there are excessive bad or duplicately referenced
     blocks in  the free list  off of the  superblock.  This is  a very bad
     condition.  You should choose to  continue, which will fall to phase 6
     to salvage the free list.  If you answer no, then fsck will abort.

Expect roughly number  missing blocks next time fsck is  run as a result of
     i-nodes being cleared. (message)

file is not a block or character device; OK? [yes/no]: (question)
     You are  attempting to fsck  a file that  is not a  block or character
     device.  If  you are certain it  is a file system,  then answer yes to
     continue.

File System Read-Only (NO WRITE) (fatal)
***** File System system was modified ***** (message)
Number files number blocks number free (message)
Fixblock error. (fatal)

Free Block count wrong in superblock. (FIX) [yes/no] (question)
     The free block count in the superblock is incorrect.  You should allow
     fsck to  repair it unless  you are a  guru and have  reason to believe
     that fsck  should not use the  redundancy in the file  system (via all
     previously reported messages) to  repair this crucial piece of data in
     the superblock.

Free i-node count wrong in superblock. (FIX) [yes/no] (question)
     The  free i-node  count in  the superblock  is incorrect.   You should
     allow  fsck to  repair it  unless you  are a guru  and have  reason to
     believe that  fsck should  not use the  redundancy in the  file system
     (via all previously reported messages) to repair this crucial piece of
     data in the superblock.

Inconsistent . entry in block number in directory name/i-node (warning)
Inconsistent .. entry in block number in directory name/i-node (warning)
i-number = number is in a bad inode block. (warning)

I-number is out of range  I=file name (Remove) [yes/no] (question)
     file has an i-node number that is out of range.  fsck is asking if you
     wish to remove the stated file (which, after all, does not exist).

I-node number is a multiply referenced directory i-node. (warning)
internal linktable corruption. (fatal)
Invalid interleave  factors in superblock. Default  free-block list spacing
     assumed. (warning)
Invalid Response (fatal)
Link count discrepancy in i-node type file name
file system mounted on point as of time (message)
Name too long. (warning)
Non null padded entry in block number in directory name/i-node (warning)
Null name entry in block number in directory name/i-node (warning)

Out of Range Block number: number  (CONTINUE) [yes/no] (question)
     The  given  action could  not  be  performed.  If  you  choose to  not
     continue, fsck will abort.  If you choose to continue, the results may
     be unpredictable.

Possible Directory Size Error i-number = number (warning)
Possible File Size Error i-number = number (warning)
Possible file system on ram disk /dev/rram1, use the -t option (fatal)
Ram disk close /dev/rram1close not mknoded properly (fatal)
Ram disk /dev/rram1 not mknoded properly (fatal)

Root i-node is not a directory (FIX) [yes/no] (question)
     The root i-node must be a  directory.  fsck is asking whether you wish
     to fix this.  If not, then fsck will abort.

Root i-node is unallocated.  Terminating (fatal)
Size check: fsize blocks isize first non-i-node block (warning)
Sorry.  No lost+found directory. (warning)
Sorry.  No space in lost+found directory. (warning)
Temp File must not be on file system to fsck (fatal)
Too many file systems in checklist file: /etc/checklist (fatal)
Too large free block count (warning)
Too large free i-node count (warning)
Too many links in i-node number (fatal)
Tried to checkpath i-node number which is not dir. (fatal)

Unallocated file (Remove) [yes/no] (question)
     file's i-node  is unallocated.  fsck  is asking if you  wish to remove
     the stated file (which, after all, does not exist).

Unknown File Type i-number = number (Clear) [yes/no]: (question)
     The mode field  in the specified i-node is unknown.   If you wish, you
     can clear the named i-node.

file system unmounted.  Last mounted on point. (message)

Unref Dir name (Reconnect) [yes/no] (question)
     The given  directory's i-node is  unreferenced.  You are  asked if you
     would like to reconnect the stated directory.  If you answer yes, then
     the  directory will  be reconnected  in  directory /lost+found  in the
     given file  system.  If not, it will remain  unreferenced and you will
     be asked later if you would like to remove it.

Unref i-node type file name (Reconnect) [yes/no] (question)
     The  given i-node  is unreferenced.   fsck  is asking  if you  wish to
     reconnect it  to the stated  file.  If you  answer yes, then  the file
     will be reconnected in directory /lost+found in the given file system.
     If not, it will remain unreferenced and you will be asked later if you
     would like to remove it.

Unref i-node type file name (Clear i-node) [yes/no] (question)
     The given i-node is unreferenced.  fsck  asks if you wish to clear the
     i-node completely.  If you answer  yes, the file is lost forever.  You
     have already  decided not  to reconnect  it, so there  seems to  be no
     reason to keep it anyway.

Notes

The correction  of file systems  almost always involves  the destruction of
data.

You should run fsck only when the COHERENT system is in single-user mode.

fsck cannot modify a file system during its work.  This rule was adopted to
prevent fsck from attempting to modify a corrupt file system, and so making
matters worse.   However, this  means that fsck  cannot change the  size of
directory lost+found. Thus, if more files are detached from the file system
than  lost+found can  hold, fsck  must  delete them  outright.  If  you are
running an application that uses  large numbers of transient files (e.g., a
news system), you  should increase the size of lost+found  so that it has a
fighting chance of  holding all detached files that fsck  finds.  To do so,
use  the  command /etc/mklost+found.  For  details, see  its  entry in  the
Lexicon.