Mercurial > hg > Members > kono > nitros9-code
annotate docs/nitros9guide/dcheck.refentry @ 1404:097d8033bccc
source improvements
author | boisy |
---|---|
date | Thu, 27 Nov 2003 23:46:01 +0000 |
parents | 4dae346c4969 |
children | b00cf13c9f61 |
rev | line source |
---|---|
135 | 1 <refentry id="dcheck"> |
2 <refnamediv> | |
3 <refname>DCHECK</refname> | |
4 <refpurpose>Check Disk File Structure</refpurpose> | |
5 </refnamediv> | |
6 | |
7 <refsynopsisdiv> | |
8 <cmdsynopsis> | |
1093 | 9 <command>dcheck</command> |
135 | 10 <arg choice="opt"> |
11 <option>-opts</option> | |
12 </arg> | |
13 <arg choice="plain"> | |
975
c565a4700689
The entitity replstart was replaced with <replaceable>
roug
parents:
648
diff
changeset
|
14 <replaceable>devnam</replaceable> |
135 | 15 </arg> |
16 </cmdsynopsis> | |
17 </refsynopsisdiv> | |
18 | |
19 <refsect1><title>Description</title> | |
20 <para> | |
21 It is possible for sectors on a disk to be marked as being allocated | |
22 but in fact are not actually associated with a file or the disk's | |
23 free space. This can happen if a disk is removed from a drive while | |
24 files are still open, or if a directory which still contains files | |
1093 | 25 is deleted (see <xref linkend="sec3.5"/>). <command>Dcheck</command> is a diagnostic that can be used to |
135 | 26 detect this condition, as well as the general integrity of the directory/file linkages. |
27 </para> | |
28 <para> | |
1053
b5ff125a1d60
Since this book was only typeset in fixed width, single-font, they used
roug
parents:
975
diff
changeset
|
29 <command>Dcheck</command> is given as a parameter the name of the disk device to be |
135 | 30 checked. After verifying and printing some vital file structure |
1053
b5ff125a1d60
Since this book was only typeset in fixed width, single-font, they used
roug
parents:
975
diff
changeset
|
31 parameters, <command>dcheck</command> follows pointers down the disk's file system tree |
135 | 32 to all directories and files on the disk. As it does so, it |
33 verifies the integrity of the file descriptor sectors, reports any | |
34 discrepancies in the directory/file linkages, and builds a sector | |
35 allocation map from the segment list associated with each file. If | |
36 any file descriptor sectors (FDs) describe a segment with a cluster | |
37 not within the file structure of the disk, a message is reported | |
38 like: | |
39 </para> | |
40 <screen> | |
975
c565a4700689
The entitity replstart was replaced with <replaceable>
roug
parents:
648
diff
changeset
|
41 *** Bad FD segment ($xxxxxx-$yyyyyy) for file: <replaceable>pathlist</replaceable> |
135 | 42 </screen> |
43 <para> | |
44 This indicates that a segment starting at sector xxxxxx and ending | |
45 at sector yyyyyy cannot really be on this disk. Because there is a | |
46 good chance the entire FD is bad if any of it's segment descriptors | |
47 are bad, the allocation map is <emphasis>not</emphasis> updated for corrupt FDs. | |
48 </para> | |
49 <para> | |
1053
b5ff125a1d60
Since this book was only typeset in fixed width, single-font, they used
roug
parents:
975
diff
changeset
|
50 While building the allocation map, <command>dcheck</command> also makes sure that each |
135 | 51 disk cluster appears only once and only once in the file structure. |
1053
b5ff125a1d60
Since this book was only typeset in fixed width, single-font, they used
roug
parents:
975
diff
changeset
|
52 If this condition is detected, <command>dcheck</command> will display a message like: |
135 | 53 </para> |
54 <screen> | |
55 Cluster $xxxxxx was previously allocated | |
56 </screen> | |
57 <para> | |
58 This message indicates that cluster xxxxxx has been found at least | |
59 once before in the file structure. The message may be printed more | |
60 than once if a cluster appears in a segment in more than one file. | |
61 </para> | |
62 <para> | |
63 The newly created allocation map is then compared to the allocation | |
64 map stored on the disk, and any differences are reported in messages | |
65 like: | |
66 </para> | |
67 <screen> | |
68 Cluster $xxxxxx in allocation map but not in file structure | |
69 Cluster $xxxxxx in file structure but not in allocation map | |
70 </screen> | |
71 <para> | |
72 The first message indicates sector number xxxxxx (hexadecimal) was | |
73 found not to be part of the file system, but was marked as allocated | |
74 in the disk's allocation map. In addition to the causes mentioned | |
75 in the first paragraph, some sectors may have been excluded from the | |
76 allocation map by the FORMAT program because they were defective or | |
77 they may be the last few sectors of the disk, the sum of which was | |
78 two small to comprise a cluster. | |
79 </para> | |
80 <para> | |
81 The second message indicates that the cluster starting at sector | |
82 xxxxxx is part of the file structure but is <emphasis>not</emphasis> | |
83 marked as allocated | |
84 in the disk's allocation map. It is possible that this cluster may | |
85 be allocated to another file later, overwriting the contents of the | |
86 cluster with data from the newly allocated file. Any clusters that | |
1053
b5ff125a1d60
Since this book was only typeset in fixed width, single-font, they used
roug
parents:
975
diff
changeset
|
87 have been reported as "previously allocated" by <command>dcheck</command> as described |
135 | 88 above surely have this problem. |
89 </para> | |
90 <para> | |
1053
b5ff125a1d60
Since this book was only typeset in fixed width, single-font, they used
roug
parents:
975
diff
changeset
|
91 Available <command>dcheck</command> options are: |
135 | 92 </para> |
93 | |
94 <informaltable frame="none"> | |
95 <tgroup cols="2"> | |
648 | 96 <colspec colwidth="1.3in"/> |
97 <colspec colwidth="3in"/> | |
135 | 98 <tbody> |
99 <row> | |
975
c565a4700689
The entitity replstart was replaced with <replaceable>
roug
parents:
648
diff
changeset
|
100 <entry>-w=<replaceable>path</replaceable></entry> |
135 | 101 <entry>pathlist to directory for work files</entry> |
102 </row> | |
103 <row> | |
104 <entry>-p</entry> | |
105 <entry>print pathlists for questionable clusters</entry> | |
106 </row> | |
107 <row> | |
108 <entry>-m</entry> | |
109 <entry>save allocation map work files</entry> | |
110 </row> | |
111 <row> | |
112 <entry>-b</entry> | |
113 <entry>suppress listing of unused clusters</entry> | |
114 </row> | |
115 <row> | |
116 <entry>-s</entry> | |
117 <entry>display count of files and directories only</entry> | |
118 </row> | |
119 <row> | |
120 <entry>-o</entry> | |
1053
b5ff125a1d60
Since this book was only typeset in fixed width, single-font, they used
roug
parents:
975
diff
changeset
|
121 <entry>print <command>dcheck</command>'s valid options</entry> |
135 | 122 </row> |
123 </tbody> | |
124 </tgroup> | |
125 </informaltable> | |
126 | |
127 <para> | |
1053
b5ff125a1d60
Since this book was only typeset in fixed width, single-font, they used
roug
parents:
975
diff
changeset
|
128 The "-s" option causes <command>dcheck</command> to display a count of files and |
135 | 129 directories only; only FDs are checked for validity. The "-b" option |
130 suppresses listing of clusters allocated but not in file structure. | |
1053
b5ff125a1d60
Since this book was only typeset in fixed width, single-font, they used
roug
parents:
975
diff
changeset
|
131 The "-p" option causes <command>dcheck</command> to make a second pass through the file |
b5ff125a1d60
Since this book was only typeset in fixed width, single-font, they used
roug
parents:
975
diff
changeset
|
132 structure printing the pathlists for any clusters that <command>dcheck</command> finds |
135 | 133 as "already allocated" or "in file structure but not in allocation |
1053
b5ff125a1d60
Since this book was only typeset in fixed width, single-font, they used
roug
parents:
975
diff
changeset
|
134 map". The "-w=" option tells <command>dcheck</command> where to locate it's allocation |
135 | 135 map work file(s). The pathlist specified must be a FULL pathlist to |
136 a <emphasis>directory</emphasis>. The directory "/D0" is | |
137 used is used if "-w" is not | |
138 specified. It is recommended that this pathlist NOT be located on | |
1053
b5ff125a1d60
Since this book was only typeset in fixed width, single-font, they used
roug
parents:
975
diff
changeset
|
139 the disk being <command>dcheck</command>ed if the disk's file structure integrity is in |
135 | 140 doubt. |
141 </para> | |
142 <para> | |
1053
b5ff125a1d60
Since this book was only typeset in fixed width, single-font, they used
roug
parents:
975
diff
changeset
|
143 <command>Dcheck</command> builds its disk allocation map in a file called |
975
c565a4700689
The entitity replstart was replaced with <replaceable>
roug
parents:
648
diff
changeset
|
144 <replaceable>pathlist</replaceable>/DCHECKppO, where <replaceable>pathlist</replaceable> |
135 | 145 is as specified by the |
146 "-w=" option and pp is the process number in hexadecimal. Each bit | |
147 in this bitmap file corresponds to a cluster of sectors on the disk. | |
1053
b5ff125a1d60
Since this book was only typeset in fixed width, single-font, they used
roug
parents:
975
diff
changeset
|
148 If the "-p" option appears on the command line, <command>dcheck</command> creates a |
975
c565a4700689
The entitity replstart was replaced with <replaceable>
roug
parents:
648
diff
changeset
|
149 second bitmap file (<replaceable>pathlist</replaceable>/DCHECKpp1) that has a bit set for |
1053
b5ff125a1d60
Since this book was only typeset in fixed width, single-font, they used
roug
parents:
975
diff
changeset
|
150 each cluster <command>dcheck</command> finds as "previously allocated" or "in file |
135 | 151 structure but not in allocation map" while building the allocation |
1053
b5ff125a1d60
Since this book was only typeset in fixed width, single-font, they used
roug
parents:
975
diff
changeset
|
152 map. <command>Dcheck</command> them makes another pass through the directory structure |
135 | 153 to determine the pathlists for these questionable clusters. These |
154 bitmap work files may be saved by specifying the "-m" option on the | |
155 command line. | |
156 </para> | |
157 </refsect1> | |
158 <refsect1><title>Restrictions</title> | |
159 <para> | |
1053
b5ff125a1d60
Since this book was only typeset in fixed width, single-font, they used
roug
parents:
975
diff
changeset
|
160 For best results, <command>dcheck</command> should have exclusive access to the disk |
b5ff125a1d60
Since this book was only typeset in fixed width, single-font, they used
roug
parents:
975
diff
changeset
|
161 being checked. Otherwise <command>dcheck</command> may be fooled if the disk allocation map |
135 | 162 changes while it is building its bitmap file from the |
1053
b5ff125a1d60
Since this book was only typeset in fixed width, single-font, they used
roug
parents:
975
diff
changeset
|
163 changing file structure. <command>Dcheck</command> cannot process disks with a directory |
135 | 164 depth greater than 39 levels. |
165 </para> | |
166 <para> | |
1093 | 167 For more information see: <xref linkend="sec3.10"/>, |
168 <xref linkend="sec3.5"/>, | |
169 <command>format</command>, | |
170 6.1 of OS-9 Systems Programmer's Manual | |
135 | 171 </para> |
172 </refsect1> | |
173 <refsect1><title>Examples</title> | |
174 <screen> | |
175 OS9: dcheck /d2 (workfile is on /D0) | |
176 | |
177 Volume - 'My system disk' on device /d2 | |
178 $009A bytes in allocation map | |
179 1 sector per cluster | |
180 $0004D0 total sectors on media | |
181 Sector $000002 is start of root directory FD | |
182 $0010 sectors used for id, allocation map and root directory | |
183 Building allocation map work file... | |
184 Checking allocation map file... | |
185 | |
186 | |
187 'My system disk' file structure is intact | |
188 1 directory | |
189 2 files | |
190 | |
191 OS9: dcheck -mpw=/d2 /d0 | |
192 Volume - 'System disk' on device /d0 | |
193 $0046 bytes in allocation map | |
194 1 sector per cluster | |
195 $00022A total sectors on media | |
196 Sector $000002 is start of root directory FD | |
197 $0010 sectors used for id, allocation map and root directory | |
198 Building allocation map work file... | |
199 Cluster $00040 was previously allocated | |
200 *** Bad FD segment ($111111-$23A6F0) for file: /d0/test/junky.file | |
201 Checking allocation map file... | |
202 Cluster $000038 in file structure but not in allocation map | |
203 Cluster $00003B in file structure but not in allocation map | |
204 Cluster $0001B9 in allocation map but not in file structure | |
205 Cluster $0001BB in allocation map but not in file structure | |
206 | |
207 Pathlists for questionable clusters: | |
208 Cluster $000038 in path: /d0/OS9boot | |
209 Cluster $00003B in path: /d0/OS9boot | |
210 Cluster $000040 in path: /d0/OS9boot | |
211 Cluster $000040 in path: /d0/test/double.file | |
212 | |
213 1 previously allocated clusters found | |
214 2 clusters in file structure but not in allocation map | |
215 2 clusters in allocation map but not in file structure | |
216 1 bad file descriptor sector | |
217 | |
218 'System disk' file structure is not intact | |
219 5 directories | |
220 25 files | |
221 </screen> | |
222 </refsect1> | |
223 </refentry> | |
224 |