//eettcc//mmkkffss [[--bb _b_o_o_t]] [[--dd]] [[--ff _n_a_m_e]] [[--ii _i_n_o_d_e_s]] [[--mm _a_r_g]] [[--nn _a_r_g]] [[--pp _p_a_c_k]] _f_i_l_e_s_y_s_t_e_m _p_r_o_t_omkfs makes a new file system. filesystem names the file (normally a block special file) where the new file system will reside. The contents of the newly created file system are described in proto. proto can be either a number or a file name.
If proto is a number, mkfs creates an empty file system (containing only a root directory) of the size in blocks given by proto. The number of i-nodes is calculated as a percentage of this number. The command
/etc/mkfs /dev/fha0 2400
creates a file system on a high-density, 5.25-inch diskette in drive 0. If the disk is a high-density, 3.5-inch diskette, use the command:
/etc/mkfs /dev/fva0 2880
If proto is a file name, however, the contents of that file will be used as a prototype for modeling the new file system. This prototype file must be laid out in the following manner:
_b_o_o_t_s_t_r_a_p___f_i_l_e___n_a_m_e _f_i_l_e___s_y_s_t_e_m___n_a_m_e _d_e_v_i_c_e___n_a_m_e
_n_o_.___o_f___b_l_o_c_k_s _n_o_.___o_f___i_-_n_o_d_e_s _n _m
_%_b _X_X _X_X _X_X
...
_d_i_r_e_c_t_o_r_y___n_a_m_e
_d_i_r_e_c_t_o_r_y___n_a_m_e _m_o_d_e _u_s_e_r___i_d _g_r_o_u_p___i_d _c_o_n_t_e_n_t_s
...
$
$
Each line is described below.
The first line has three fields. Field 1, bootstrap_file_name, contains the name of a file that holds the boot strap, which must fit into block 0 of the disk. Field 2, file_system_name, gives the name of the file system; and field 3, device_name, gives the name of file system's physical device (for example, //ddeevv//hhdd11). Only the first six characters in field 2 and the first 11 in field 3 are significant; all characters after them are ignored.
The second line contains four fields. Field 1, no._of_blocks, gives the size of the file system in blocks; field 2, no_of_i-nodes, gives the number of i-nodes in the file system. Because each file or directory requires one i-node, this number represents the limit on the number of files that may be created in the file system. A ratio of seven blocks per i- node generally works well.
Fields 3 and 4 control free list interleaving on your disk. n is the size of a ``virtual cylinder'': fsck allocates all the blocks on one virtual cylinder before it advances to the next virtual cylinder. The value of n must be less than or equal to 255, and should evenly divide the actual size of a cylinder on the device. m tells the system how many blocks to skip each time it increments a free list block number, i.e., the free list ``interleave''; n mod m must be zero. Choosing an optimal interleave value may improve system performance for the device. The optimal values for n and m are hardware- specific and can be determined by experimentation.
Next, the third line and following begin with %%bb. These list the bad blocks on your storage device. One or more block numbers may appear on each line, separated by white space. These blocks are allocated to the bad block file (i- node 1).
The remaining lines in the _p_r_o_t_o file define the names, modes, and contents of the directories and files in the file system. These lines are divided into fields separated by white space (blanks or tabs) as follows:
The proto file need not contain all of the above fields. However, it must contain the name of the boot block (line 1), the number of blocks and the number of i-nodes (line 2), the list of bad blocks, the name of at least one directory, and the dollar sign that ends the file.
/conf/boot.fha
2400 100
%b 55
%b 185 86
d--755 3 1
coherent ---644 3 1 /coherent
tmp d--777 3 1
$
bin d--755 3 1
mail -u-755 0 1 /bin/mail
$
dev d--755 3 1
tty30 c--644 0 1 3 0
tty35 c--644 0 1 3 5
mt0 b--600 0 1 12 0
$
$
You can use the command badscan to draw up the list of bad blocks on your disk and create a skeleton _p_r_o_t_o file.
su root
for i in `from 1 to 500`
do
touch /lost+found/$i
done
rm /lost+found/*
A Run this script for each file system whose lost+found directory you wish to expand. For example, if you have a file system mount on directory /u, run this script for directory /u/lost+found instead of for /lost+found.