fsck" -- Command" "

Check and repair file systems interactively

//eettcc//ffsscckk [ --ffnnqqssSSyy ] [ --tt _t_e_m_p_f_i_l_e ] [ _f_i_l_e_s_y_s_t_e_m _._._. ]

fsck checks and interactively repairs file systems. If all is well, ffsscckk 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, ffsscckk asks whether it should fix the inconsistency and waits for you to reply yyeess or nnoo.

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

+o
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.

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

+o
Link counts that are incorrect.

+o
Whether the directory size is not aligned for 16 bytes.

+o
Whether the i-node format is correct.

+o
Whether any blocks are not accounted for.

+o
Whether a file points to an unallocated i-node.

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

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

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

+o
Whether the format of the free block list is correct.

+o
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 ffsscckk 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 lloosstt++ffoouunndd, with its i-node number as its name. The directory lloosstt++ffoouunndd must exist in the root of the file system being checked before ffsscckk is executed, and it must have room for new entries without requiring that new blocks be allocated.

fsck recognizes the following options:

--ff
Fast check. ffsscckk 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, ffsscckk will reconstruct the free list.

--nn
No option: a default reply of nnoo is given to all of ffsscckk's questions.

--qq
Quiet option: run quietly. ffsscckk 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 ffsscckk still prints the number of files used, the number of blocks used, and the number of blocks that remain free.

--ss
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.

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

--tt
Name the temporary file used by fsck.

--yy
Yes option: a default reply of yyeess is given to all of ffsscckk's questions.

If you do not name a file system in ffsscckk's command line, ffsscckk checks the file systems named in the file //eettcc//cchheecckklliisstt.

Files

//eettcc//cchheecckklliisstt

See Also

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 _(_f_a_t_a_l_)

Bad block _n_u_m_b_e_r, i-number = _n_u_m_b_e_r _(_w_a_r_n_i_n_g_)

_N_u_m_b_e_r Bad blocks in Free List _(_w_a_r_n_i_n_g_)

Bad/Dup blocks in _i_-_n_o_d_e _t_y_p_e _f_i_l_e _n_a_m_e (Clear i- node) [yes/no] _(_q_u_e_s_t_i_o_n_)
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 _n_u_m_b_e_r in directory _n_a_m_e_/_i_-_n_o_d_e _(_w_a_r_n_i_n_g_)

Bad Free List (SALVAGE) [yes/no] _(_q_u_e_s_t_i_o_n_)
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 _d_i_r_e_c_t_o_r_y_/_f_i_l_e (Remove) [yes/no] _(_q_u_e_s_t_i_o_n_)
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: _n_u_m_b_e_r _(_w_a_r_n_i_n_g_)

_N_u_m_b_e_r Blocks missing _(_w_a_r_n_i_n_g_)

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

Cannot close Ram Disk Close /dev/rram1close _(_f_a_t_a_l_)

Cannot create temp file _n_a_m_e _(_f_a_t_a_l_)

Cannot open Ram Disk Close /dev/rram1close _(_f_a_t_a_l_)

Cannot open read/write Ram Disk /dev/rram1 _(_f_a_t_a_l_)

Can not Read: Blk num: _n_u_m_b_e_r (CONTINUE) [yes/no] _(_q_u_e_s_t_i_o_n_)
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: _n_u_m_b_e_r (CONTINUE) [yes/no] _(_q_u_e_s_t_i_o_n_)
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: _n_u_m_b_e_r (CONTINUE) [yes/no] _(_q_u_e_s_t_i_o_n_)
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 _(_f_a_t_a_l_)

Can't malloc memory, phase 2 _(_f_a_t_a_l_)

Can't malloc space for interleave table. Free-block list is not rebuilt. _(_w_a_r_n_i_n_g_)

Can't open: _f_i_l_e _s_y_s_t_e_m _(_w_a_r_n_i_n_g_)

Can't open checklist file: /etc/checklist _(_f_a_t_a_l_)

Can't stat: _f_i_l_e _s_y_s_t_e_m _(_w_a_r_n_i_n_g_)

Can't stat temp file _n_a_m_e _(_f_a_t_a_l_)

Count = _c_o_u_n_t, should be _c_o_u_n_t (Adjust) [yes/no] _(_q_u_e_s_t_i_o_n_)
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 = _n_u_m_b_e_r _(_w_a_r_n_i_n_g_)

Dir i-number = _n_u_m_b_e_r connected. Parent was i-number = _n_u_m_b_e_r _(_w_a_r_n_i_n_g_)

Dir i-number = _n_u_m_b_e_r connected. It has bad/dup blocks. _(_w_a_r_n_i_n_g_)

Dir i-number = _n_u_m_b_e_r connected. It has no .. entry. _(_w_a_r_n_i_n_g_)

Dup/Bad blocks in root i-node (Continue) [yes/no] _(_q_u_e_s_t_i_o_n_)
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 _n_u_m_b_e_r, i-number = _n_u_m_b_e_r _(_w_a_r_n_i_n_g_)

_N_u_m_b_e_r Dup blocks in Free List _(_w_a_r_n_i_n_g_)

DUP Table Overflow (Continue) [yes/no] _(_q_u_e_s_t_i_o_n_)
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 _n_u_m_b_e_r in directory _n_a_m_e_/_i_-_n_o_d_e _(_w_a_r_n_i_n_g_)

Error seeking tmp file _(_f_a_t_a_l_)

Error writing tmp file _(_f_a_t_a_l_)

Error writing to tmp file _(_f_a_t_a_l_)

Excessive Bad Blocks i-number = _n_u_m_b_e_r (Continue) [yes/no] _(_q_u_e_s_t_i_o_n_)
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 = _n_u_m_b_e_r (Continue) [yes/no] _(_q_u_e_s_t_i_o_n_)
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 _b_a_d_/_d_u_p blocks in free list (Continue) [yes/no] _(_q_u_e_s_t_i_o_n_)
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 _n_u_m_b_e_r missing blocks next time fsck is run as a result of i-nodes being cleared. _(_m_e_s_s_a_g_e_)

file is not a block or character device; OK? [yes/no]: _(_q_u_e_s_t_i_o_n_)
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) _(_f_a_t_a_l_)

***** File System _s_y_s_t_e_m was modified ***** _(_m_e_s_s_a_g_e_)

_N_u_m_b_e_r files _n_u_m_b_e_r blocks _n_u_m_b_e_r free _(_m_e_s_s_a_g_e_)

Fixblock error. _(_f_a_t_a_l_)

Free Block count wrong in superblock. (FIX) [yes/no] _(_q_u_e_s_t_i_o_n_)
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] _(_q_u_e_s_t_i_o_n_)
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 _n_u_m_b_e_r in directory _n_a_m_e_/_i_-_n_o_d_e _(_w_a_r_n_i_n_g_)

Inconsistent .. entry in block _n_u_m_b_e_r in directory _n_a_m_e_/_i_-_n_o_d_e _(_w_a_r_n_i_n_g_)

i-number = _n_u_m_b_e_r is in a bad inode block. _(_w_a_r_n_i_n_g_)

I-number is out of range I=_f_i_l_e _n_a_m_e (Remove) [yes/no] _(_q_u_e_s_t_i_o_n_)
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 _n_u_m_b_e_r is a multiply referenced directory i- node. _(_w_a_r_n_i_n_g_)

internal linktable corruption. _(_f_a_t_a_l_)

Invalid interleave factors in superblock. Default free-block list spacing assumed. _(_w_a_r_n_i_n_g_)

Invalid Response _(_f_a_t_a_l_)

Link count discrepancy in _i_-_n_o_d_e _t_y_p_e _f_i_l_e _n_a_m_e

_f_i_l_e _s_y_s_t_e_m mounted on _p_o_i_n_t as of _t_i_m_e _(_m_e_s_s_a_g_e_)

Name too long. _(_w_a_r_n_i_n_g_)

Non null padded entry in block _n_u_m_b_e_r in directory _n_a_m_e_/_i_-_n_o_d_e _(_w_a_r_n_i_n_g_)

Null name entry in block _n_u_m_b_e_r in directory _n_a_m_e_/_i_- _n_o_d_e _(_w_a_r_n_i_n_g_)

Out of Range Block number: _n_u_m_b_e_r (CONTINUE) [yes/no] _(_q_u_e_s_t_i_o_n_)
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 = _n_u_m_b_e_r _(_w_a_r_n_i_n_g_)

Possible File Size Error i-number = _n_u_m_b_e_r _(_w_a_r_n_i_n_g_)

Possible file system on ram disk /dev/rram1, use the -t option _(_f_a_t_a_l_)

Ram disk close /dev/rram1close not mknoded properly _(_f_a_t_a_l_)

Ram disk /dev/rram1 not mknoded properly _(_f_a_t_a_l_)

Root i-node is not a directory (FIX) [yes/no] _(_q_u_e_s_t_i_o_n_)
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 _(_f_a_t_a_l_)

Size check: fsize _b_l_o_c_k_s isize _f_i_r_s_t _n_o_n_-_i_-_n_o_d_e _b_l_o_c_k _(_w_a_r_n_i_n_g_)

Sorry. No lost+found directory. _(_w_a_r_n_i_n_g_)

Sorry. No space in lost+found directory. _(_w_a_r_n_i_n_g_)

Temp File must not be on file system to fsck _(_f_a_t_a_l_)

Too many file systems in checklist file: /etc/checklist _(_f_a_t_a_l_)

Too large free block count _(_w_a_r_n_i_n_g_)

Too large free i-node count _(_w_a_r_n_i_n_g_)

Too many links in i-node _n_u_m_b_e_r _(_f_a_t_a_l_)

Tried to checkpath i-node _n_u_m_b_e_r which is not dir. _(_f_a_t_a_l_)

Unallocated _f_i_l_e (Remove) [yes/no] _(_q_u_e_s_t_i_o_n_)
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 = _n_u_m_b_e_r (Clear) [yes/no]: _(_q_u_e_s_t_i_o_n_)
The mode field in the specified i-node is unknown. If you wish, you can clear the named i-node.

_f_i_l_e _s_y_s_t_e_m unmounted. Last mounted on _p_o_i_n_t. _(_m_e_s_s_a_g_e_)

Unref Dir _n_a_m_e (Reconnect) [yes/no] _(_q_u_e_s_t_i_o_n_)
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_-_n_o_d_e _t_y_p_e _f_i_l_e _n_a_m_e (Reconnect) [yes/no] _(_q_u_e_s_t_i_o_n_)
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_-_n_o_d_e _t_y_p_e _f_i_l_e _n_a_m_e (Clear i-node) [yes/no] _(_q_u_e_s_t_i_o_n_)
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.
A

Notes

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

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

A 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.