1 .\" $NetBSD: fsdb.8,v 1.2 1995/10/08 23:18:08 thorpej Exp $
3 .\" Copyright (c) 1995 John T. Kohl
4 .\" All rights reserved.
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
9 .\" 1. Redistributions of source code must retain the above copyright
10 .\" notice, this list of conditions and the following disclaimer.
11 .\" 2. Redistributions in binary form must reproduce the above copyright
12 .\" notice, this list of conditions and the following disclaimer in the
13 .\" documentation and/or other materials provided with the distribution.
14 .\" 3. The name of the author may not be used to endorse or promote products
15 .\" derived from this software without specific prior written permission.
17 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR `AS IS'' AND ANY EXPRESS OR
18 .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19 .\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20 .\" DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
21 .\" INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22 .\" (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
23 .\" SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
25 .\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
26 .\" ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27 .\" POSSIBILITY OF SUCH DAMAGE.
31 .Dd September 14, 1995
36 .Nd FFS debugging/editing tool
47 (usually a raw disk partition) and runs a command loop
48 allowing manipulation of the file system's inode data. You are prompted
49 to enter a command with
53 is the currently selected i-number. The initial selected inode is the
54 root of the filesystem (i-number 2).
55 The command processor uses the
57 library, so you can use command line editing to reduce typing if desired.
58 When you exit the command loop, the file system superblock is marked
59 dirty and any buffered blocks are written to the file system.
61 The following options are available:
62 .Bl -tag -width indent
64 Enable additional debugging output (which comes primarily from
68 Left for historical reasons and has no meaning.
70 Open the filesystem read/only, and disables all commands that would
78 supports these commands:
80 .Bl -tag -width indent -compact
82 Print out the list of accepted commands.
84 .It Cm inode Ar i-number
87 as the new current inode.
90 Revert to the previously current inode.
92 .It Cm clri Ar i-number
100 in the current directory and make its inode the current inode.
102 may be a multi-component name or may begin with slash to indicate that
103 the root inode should be used to start the lookup. If some component
104 along the pathname is not found, the last valid directory encountered is
105 left as the active inode.
107 This command is valid only if the starting inode is a directory.
111 Print out the active inode.
114 Increment the active inode's link count.
117 Decrement the active inode's link count.
119 .It Cm linkcount Ar number
120 Set the active inode's link count to
124 List the current inode's directory entries. This command is valid only
125 if the current inode is a directory.
131 from the current directory inode. This command is valid only
132 if the current inode is a directory.
134 .It Cm ln Ar ino Ar name
135 Create a link to inode
139 in the current directory inode. This command is valid only
140 if the current inode is a directory.
142 .It Cm chinum Ar dirslot Ar inum
143 Change the i-number in directory entry
148 .It Cm chname Ar dirslot Ar name
149 Change the name in directory entry
153 This command cannot expand a directory entry. You can only rename an
154 entry if the name will fit into the existing directory slot.
156 .It Cm chtype Ar type
157 Change the type of the current inode to
168 Change the mode bits of the current inode to
170 You cannot change the file type with this subcommand; use
174 .It Cm chflags Ar flags
175 Change the file flags of the current inode to
179 Change the owner of the current inode to
183 Change the group of the current inode to
187 Change the generation number of the current inode to
193 Change the modification, change, or access time (respectively) on the
197 should be in the format
198 .Em YYYYMMDDHHMMSS[.nsec]
201 is an optional nanosecond specification. If no nanoseconds are specified, the
206 field will be set to zero.
208 .It Cm quit, Cm q, Cm exit, Em <EOF>
217 Manipulation of ``short'' symlinks doesn't work (in particular, don't
218 try changing a symlink's type).
220 You must specify modes as numbers rather than symbolic names.
222 There are a bunch of other things that you might want to do which
227 uses the source code for
229 to implement most of the file system manipulation code. The remainder of
240 Use this tool with extreme caution--you can damage an FFS file system