]> git.ipfire.org Git - thirdparty/e2fsprogs.git/blame - debugfs/debugfs.8.in
Many files:
[thirdparty/e2fsprogs.git] / debugfs / debugfs.8.in
CommitLineData
3839e657 1.\" -*- nroff -*-
50e1e10f
TT
2.\" Copyright 1993, 1994, 1995 by Theodore Ts'o. All Rights Reserved.
3.\" This file may be copied under the terms of the GNU Public License.
4.\"
74becf3c 5.TH DEBUGFS 8 "@E2FSPROGS_MONTH@ @E2FSPROGS_YEAR@" "E2fsprogs version @E2FSPROGS_VERSION@"
3839e657
TT
6.SH NAME
7debugfs \- ext2 file system debugger
8.SH SYNOPSIS
9.B debugfs
10[
3839e657
TT
11.B \-w
12]
fc6d9d51
TT
13[
14.B \-f
15cmd_file
16]
17[
18.B \-R
19request
20]
21[
3839e657
TT
22device
23]
24.SH DESCRIPTION
fc6d9d51
TT
25The
26.B debugfs
27program
3839e657
TT
28is a file system debugger. It can be used to examine and change the
29state of an ext2 file system.
30.br
31.I device
32is the special file corresponding to the device containing the ext2
33file system (e.g /dev/hdXX).
34.SH OPTIONS
35.TP
36.I -w
37Specify that the file system should be open in read-write mode. Without this
38option, the file system is open in read-only mode.
fc6d9d51
TT
39.TP
40.I -f cmd_file
41Causes
42.B debugfs
43to read in commands from
44.IR cmd_file ,
45and execute them. When
46.B debugfs
47is finsihed executing those commands, it will exit.
48.TP
49.I -R request
50Causes
51.B debugfs
52to execute the single command
53.IR request ,
54and then exit.
3839e657
TT
55.SH COMMANDS
56.B debugfs
57is an interactive debugger. It understands a number of commands.
58.TP
fc6d9d51
TT
59.I cat filespec
60Dump the contents of the inode
61.I filespec
62to stdout.
3839e657 63.TP
fc6d9d51
TT
64.I cd filespec
65Change the current working directory to
66.IR filespec .
50e1e10f 67.TP
fc6d9d51
TT
68.I chroot filespec
69Change the root directory to be the directory
70.IR filespec .
3839e657
TT
71.TP
72.I close
73Close the currently open file system.
74.TP
fc6d9d51
TT
75.I clri file
76Clear the contents of the inode
77.IR file .
78.TP
79.I dump [-p] filspec out_file
80Dump the contents of the inode
81.I filespec
82to the output file
83.IR out_file .
84If the
85.I -p
86option is given set the owner, group and permissions information on
87.I out_file
88to match
89.IR filespec .
90.TP
91.I expand_dir filespec
92Expand the directory
93.IR filespec .
3839e657
TT
94.TP
95.I find_free_block [goal]
96Find the first free block, starting from
97.I goal
98and allocates it.
99.TP
100.I find_free_inode [dir [mode]]
fc6d9d51
TT
101Find a free inode and allocates it. If present,
102.I dir
103specifies the inode number of the directory
104which the inode is to be located. The second
105optional argument
106.I mode
107specifies the permissions of the new inode. (If the directory bit is set
108on the mode, the allocation routine will function differently.)
109.TP
110.I freeb block
111Mark the block number
112.I block
113as not allocated.
114.TP
115.I freei filespec
116Free the inode specified by
117.I filespec
3839e657
TT
118.TP
119.I help
50e1e10f
TT
120Print a list of commands understood by
121.BR debugfs (8).
122.TP
fc6d9d51
TT
123.I icheck block ...
124Print a listing of the inodes which use the one or more block specified
125on the command line.
3839e657 126.TP
fc6d9d51 127.I initialize device blocksize
3839e657
TT
128Create an ext2 file system on
129.I device
fc6d9d51
TT
130with device size
131.IR blocksize .
132Note that this does not fully initialize all of the data structures;
133to do this, use the
134.BR mke2fs (8)
135program. This is just a call to the low-level library, which sets up
136the superblock and block descriptors.
137.TP
138.I kill_file filespec
139Dellocate the inode
140.I filespec
141and its blocks. Note that this does not remove any directory
142entries (if any) to this inode. See the
143.I rm
144command if you wish to unlink a file.
145.TP
146.I ln filespec dest_file
147Create a link named
148.I dest_file
149which is a link to
150.IR filespec .
151Note this does not adjust the inode reference counts.
152.TP
521e3685 153.I ls [-l] filespec
fc6d9d51
TT
154Print a listing of the files in the directory
155.IR filespec .
156.TP
157.I modify_inode filespec
158Modify the contents of the inode structure in the inode
159.IR filespec .
160.TP
161.I mkdir filespec
3839e657
TT
162Make a directory.
163.TP
fc6d9d51
TT
164.I mknod filespec [p|[[c|b] major minor]]
165Create a special device file (a named pipe, character or block device).
166If a character or block device is to be made, the
167.I major
168and
169.I minor
170device numbers must be specified.
50e1e10f 171.TP
fc6d9d51
TT
172.I ncheck inode_num ...
173Take the requested list of inode numbers, and print a listing of pathnams
174to those inodes.
50e1e10f 175.TP
fc6d9d51
TT
176.I open [-w] device
177Open a file system for editing.
3839e657
TT
178.TP
179.I pwd
50e1e10f 180Print the current working directory.
3839e657
TT
181.TP
182.I quit
183Quit
184.B debugfs
185.TP
fc6d9d51
TT
186.I rm pathname
187Unlink
188.IR pathname .
189If this cuases the inode pointed to by
190.I pathname
191to have no other references, deallocate the file. This command functions
192as the unlink() system call.
193.I
194.TP
195.I rmdir filespec
196Remove the directory
197.IR filespec .
198This function is currently not implemented.
199.TP
200.I setb block
201Mark the block number
202.I block
203as allocated.
204.TP
205.I seti filespec
206Mark inode
207.I filespec
208as in use in the inode bitmap.
3839e657
TT
209.TP
210.I show_super_stats
211List the contents of the super block.
212.TP
fc6d9d51
TT
213.I stat filespec
214Display the contents of the inode structure of the inode
215.IR filespec .
3839e657 216.TP
fc6d9d51
TT
217.I testb block
218Test if the block number
219.I block
220is marked as allocated in the block bitmap.
3839e657 221.TP
fc6d9d51
TT
222.I testi filespec
223Test if the inode
224.I filespec
225is marked as allocated in the inode bitmap.
3839e657 226.TP
fc6d9d51
TT
227.I unlink pathname
228Remove the link specified by
229.I pathname
230to an inode. Note this does not adjust the inode reference counts.
50e1e10f 231.TP
fc6d9d51 232.I write source_file out_file
50e1e10f 233Create a file in the filesystem named
fc6d9d51 234.IR out_file ,
50e1e10f
TT
235and copy the contents of
236.I source_file
237into the destination file.
fc6d9d51
TT
238.SH SPECIFYING FILES
239Many
240.B debugfs
241commands take a
242.I filespec
243as an argument to specify an inode (as opposed to a pathname)
244in the filesystem which is currently opened by debugfs. The
245.I filespec
246argument may be specified in two forms. The first form is an inode
247number surrounded by angle brackets, e.g.,
248.IR <2> .
249The second form is a pathname; if the pathname is prefixed by a forward slash
250('/'), then it is interpreted relative to the root of the filesystem
251which is currently opened by debugfs. If not, the pathname is
252interpreted relative to the current working directory as maintained
253by debugfs. This may be modified by using the debugfs command
254.IR cd .
3839e657
TT
255.SH AUTHOR
256.B debugfs
50e1e10f 257was written by Theodore Ts'o <tytso@mit.edu>.
3839e657
TT
258.SH SEE ALSO
259.BR dumpe2fs (8),
260.BR e2fsck (8),
261.BR mke2fs (8)