Add Hama WLAN PCI Card 54 Mbps to recognized cards. Bump date.
[netbsd-mini2440.git] / sbin / fsdb / fsdb.8
blob2d8182f4a9b08cdd9299d1d84228bb92bdc676ba
1 .\"     $NetBSD: fsdb.8,v 1.21 2005/05/25 10:01:34 wiz Exp $
2 .\"
3 .\" Copyright (c) 1996 The NetBSD Foundation, Inc.
4 .\" All rights reserved.
5 .\"
6 .\" This code is derived from software contributed to The NetBSD Foundation
7 .\" by John T. Kohl.
8 .\"
9 .\" Redistribution and use in source and binary forms, with or without
10 .\" modification, are permitted provided that the following conditions
11 .\" are met:
12 .\" 1. Redistributions of source code must retain the above copyright
13 .\"    notice, this list of conditions and the following disclaimer.
14 .\" 2. Redistributions in binary form must reproduce the above copyright
15 .\"    notice, this list of conditions and the following disclaimer in the
16 .\"    documentation and/or other materials provided with the distribution.
17 .\"
18 .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
19 .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
20 .\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
21 .\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
22 .\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23 .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24 .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26 .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28 .\" POSSIBILITY OF SUCH DAMAGE.
29 .\"
30 .Dd January 3, 2004
31 .Dt FSDB 8
32 .Os
33 .Sh NAME
34 .Nm fsdb
35 .Nd FFS debugging/editing tool
36 .Sh SYNOPSIS
37 .Nm
38 .Op Fl dFn
39 .Fl f Ar fsname
40 .Sh DESCRIPTION
41 .Nm
42 opens
43 .Ar fsname
44 (usually a raw disk partition) and runs a command loop
45 allowing manipulation of the file system's inode data.
46 You are prompted to enter a command with
47 .Dq "fsdb (inum X)\*[Gt]"
48 where
49 .Va X
50 is the currently selected i-number.
51 The initial selected inode is the root of the filesystem (i-number 2).
52 The command processor uses the
53 .Xr editline 3
54 library, so you can use command line editing to reduce typing if desired.
55 When you exit the command loop, the file system superblock is marked
56 dirty and any buffered blocks are written to the file system.
57 .Pp
58 The
59 .Fl d
60 option enables additional debugging output (which comes primarily from
61 .Xr fsck 8 Ns -derived
62 code).
63 .Pp
64 The
65 .Fl F
66 option indicates that
67 .Ar filesystem
68 is a file system image, rather than a raw character device.
69 It will be accessed
70 .Sq as-is ,
71 and no attempts will be made to read a disklabel.
72 .Pp
73 The
74 .Fl n
75 option disables writing to the device, preventing any changes from being made
76 to the filesystem.
77 .Sh COMMANDS
78 Besides the built-in
79 .Xr editline 3
80 commands,
81 .Nm
82 supports these commands:
83 .Pp
84 .Bl -tag -width indent -compact
85 .It Cm help
86 Print out the list of accepted commands.
87 .Pp
88 .It Cm inode Ar i-number
89 Select inode
90 .Ar i-number
91 as the new current inode.
92 .Pp
93 .It Cm back
94 Revert to the previously current inode.
95 .Pp
96 .It Cm clri
97 Clear the current inode.
98 .Pp
99 .It Cm lookup Ar name
100 .It Cm cd Ar name
101 Find
102 .Ar name
103 in the current directory and make its inode the current inode.
104 .Ar Name
105 may be a multi-component name or may begin with slash to indicate that
106 the root inode should be used to start the lookup.
107 If some component along the pathname is not found,
108 the last valid directory encountered is left as the active inode.
110 This command is valid only if the starting inode is a directory.
112 .It Cm active
113 .It Cm print
114 Print out the active inode.
116 .It Cm uplink
117 Increment the active inode's link count.
119 .It Cm downlink
120 Decrement the active inode's link count.
122 .It Cm linkcount Ar number
123 Set the active inode's link count to
124 .Ar number .
126 .It Cm ls
127 List the current inode's directory entries.
128 This command is valid only if the current inode is a directory.
130 .It Cm blks
131 List the current inode's blocks numbers.
133 .It Cm findblk Ar disk block number ...
134 Find the inode(s) owning the specified disk block(s) number(s).
135 Note that these are not absolute disk blocks numbers, but offsets from the
136 start of the partition.
138 .It Cm rm Ar name
139 .It Cm del Ar name
140 Remove the entry
141 .Ar name
142 from the current directory inode.
143 This command is valid only if the current inode is a directory.
145 .It Cm ln Ar ino Ar name
146 Create a link to inode
147 .Ar ino
148 under the name
149 .Ar name
150 in the current directory inode.
151 This command is valid only if the current inode is a directory.
153 .It Cm chinum Ar dirslot Ar inum
154 Change the i-number in directory entry
155 .Ar dirslot
157 .Ar inum .
159 .It Cm chname Ar dirslot Ar name
160 Change the name in directory entry
161 .Ar dirslot
163 .Ar name .
164 This command cannot expand a directory entry.
165 You can only rename an entry if the name will fit into
166 the existing directory slot.
168 .It Cm chtype Ar type
169 Change the type of the current inode to
170 .Ar type .
171 .Ar type
172 may be one of:
173 .Em file ,
174 .Em dir ,
175 .Em socket ,
177 .Em fifo .
179 .It Cm chmod Ar mode
180 Change the mode bits of the current inode to
181 .Ar mode .
182 You cannot change the file type with this subcommand; use
183 .Ic chtype
184 to do that.
186 .It Cm chflags Ar flags
187 Change the file flags of the current inode to
188 .Ar flags .
190 .It Cm chown Ar uid
191 Change the owner of the current inode to
192 .Ar uid .
194 .It Cm chgrp Ar gid
195 Change the group of the current inode to
196 .Ar gid .
198 .It Cm chgen Ar gen
199 Change the generation number of the current inode to
200 .Ar gen .
202 .It Cm mtime Ar time
203 .It Cm ctime Ar time
204 .It Cm atime Ar time
205 Change the modification, change, or access time (respectively) on the
206 current inode to
207 .Ar time .
208 .Ar Time
209 should be in the format
210 .Em YYYYMMDDHHMMSS[.nsec]
211 where
212 .Em nsec
213 is an optional nanosecond specification.
214 If no nanoseconds are specified, the
215 .Va mtimensec ,
216 .Va ctimensec ,
218 .Va atimensec
219 field will be set to zero.
221 .It Cm quit, Cm q, Cm exit, Aq Em EOF
222 Exit the program.
224 .Sh SEE ALSO
225 .Xr editline 3 ,
226 .Xr fs 5 ,
227 .Xr clri 8 ,
228 .Xr fsck 8
229 .Sh HISTORY
231 uses the source code for
232 .Xr fsck 8
233 to implement most of the file system manipulation code.
234 The remainder of
236 first appeared in
237 .Nx 1.1 .
238 .Sh WARNING
239 Use this tool with extreme caution -- you can damage an FFS file system
240 beyond what
241 .Xr fsck 8
242 can repair.
243 .Sh BUGS
244 Manipulation of
245 .Dq short
246 symlinks doesn't work (in particular, don't
247 try changing a symlink's type).
249 You must specify modes as numbers rather than symbolic names.
251 There are a bunch of other things that you might want to do which
253 doesn't implement.