Allow IPv6 address entry in tools>ping - Loosens valid character check
[tomato/davidwu.git] / release / src / router / ntfs-3g / ntfsprogs / ntfsundelete.8.in
blob6ef80e15e2d1d7d0a5589c89b27ac708cb4f2b9a
1 .\" Copyright (c) 2002\-2005 Richard Russon.
2 .\" This file may be copied under the terms of the GNU Public License.
3 .\"
4 .TH NTFSUNDELETE 8 "November 2005" "ntfs-3g @VERSION@"
5 .SH NAME
6 ntfsundelete \- recover a deleted file from an NTFS volume.
7 .SH SYNOPSIS
8 .B ntfsundelete
9 [\fIoptions\fR] \fIdevice\fR
10 .SH DESCRIPTION
11 .B ntfsundelete
12 has three modes of operation:
13 .IR scan ,
14 .I undelete
15 and
16 .IR copy .
17 .SS Scan
18 .PP
19 The default mode,
20 .I scan
21 simply reads an NTFS Volume and looks for files that have been deleted.  Then it
22 will print a list giving the inode number, name and size.
23 .SS Undelete
24 .PP
25 The
26 .I undelete
27 mode takes the files either matching the regular expression (option \-m)
28 or  specified by the inode\-expressions and recovers as much of the data
29 as possible.   It saves the result to another location.  Partly for
30 safety, but mostly because NTFS write support isn't finished.
31 .SS Copy
32 .PP
33 This is a wizard's option.  It will save a portion of the MFT to a file.  This
34 probably only be useful when debugging
35 .I ntfsundelete
36 .SS Notes
37 .B ntfsundelete
38 only ever
39 .B reads
40 from the NTFS Volume.
41 .B ntfsundelete
42 will never change the volume.
43 .SH CAVEATS
44 .SS Miracles
45 .B ntfsundelete
46 cannot perform the impossible.
47 .PP
48 When a file is deleted the MFT Record is marked as not in use and the bitmap
49 representing the disk usage is updated.  If the power isn't turned off
50 immediately, the free space, where the file used to live, may become
51 overwritten.  Worse, the MFT Record may be reused for another file.  If this
52 happens it is impossible to tell where the file was on disk.
53 .PP
54 Even if all the clusters of a file are not in use, there is no guarantee that
55 they haven't been overwritten by some short\-lived file.
56 .SS Locale
57 In NTFS all the filenames are stored as Unicode.  They will be converted into
58 the current locale for display by
59 .BR ntfsundelete .
60 The utility has successfully displayed some Chinese pictogram filenames and then
61 correctly recovered them.
62 .SS Extended MFT Records
63 In rare circumstances, a single MFT Record will not be large enough to hold the
64 metadata describing a file (a file would have to be in hundreds of fragments
65 for this to happen).  In these cases one MFT record may hold the filename, but
66 another will hold the information about the data.
67 .B ntfsundelete
68 will not try and piece together such records.  It will simply show unnamed files
69 with data.
70 .SS Compressed and Encrypted Files
71 .B ntfsundelete
72 cannot recover compressed or encrypted files.  When scanning for them, it will
73 display as being 0% recoverable.
74 .SS The Recovered File's Size and Date
75 To recover a file
76 .B ntfsundelete
77 has to read the file's metadata.  Unfortunately, this isn't always intact.
78 When a file is deleted, the metadata can be left in an inconsistent state. e.g.
79 the file size may be zero; the dates of the file may be set to the time it was
80 deleted, or random.
81 .br
82 To be safe
83 .B ntfsundelete
84 will pick the largest file size it finds and write that to disk.  It will also
85 try and set the file's date to the last modified date.  This date may be the
86 correct last modified date, or something unexpected.
87 .SH OPTIONS
88 Below is a summary of all the options that
89 .B ntfsundelete
90 accepts.  Nearly all options have two equivalent names.  The short name is
91 preceded by
92 .B \-
93 and the long name is preceded by
94 .BR \-\- .
95 Any single letter options, that don't take an argument, can be combined into a
96 single command, e.g.
97 .B \-fv
98 is equivalent to
99 .BR "\-f \-v" .
100 Long named options can be abbreviated to any unique prefix of their name.
102 \fB\-b\fR, \fB\-\-byte\fR NUM
103 If any clusters of the file cannot be recovered, the missing parts will be
104 filled with this byte.  The default is zeros.
106 \fB\-C\fR, \fB\-\-case\fR
107 When scanning an NTFS volume, any filename matching (using the
108 .B \-\-match
109 option) is case\-insensitive.  This option makes the matching case\-sensitive.
111 \fB\-c\fR, \fB\-\-copy\fR RANGE
112 This wizard's option will write a block of MFT FILE records to a file.  The
113 default file is
114 .I mft
115 which will be created in the current directory.  This option can be combined
116 with the
117 .B \-\-output
119 .B \-\-destination
120 options.
122 \fB\-d\fR, \fB\-\-destination\fR DIR
123 This option controls where to put the output file of the
124 .B \-\-undelete
126 .B \-\-copy
127 options.
129 \fB\-f\fR, \fB\-\-force\fR
130 This will override some sensible defaults, such as not overwriting an existing
131 file.  Use this option with caution.
133 \fB\-h\fR, \fB\-\-help\fR
134 Show a list of options with a brief description of each one.
136 \fB\-i\fR, \fB\-\-inodes\fR RANGE
137 Recover the files with these inode numbers.
138 .I RANGE
139 can be a single inode number, several numbers separated by commas "," or a
140 range separated by a dash "\-".
142 \fB\-m\fR, \fB\-\-match\fR PATTERN
143 Filter the output by only looking for matching filenames.  The pattern can
144 include the wildcards '?', match exactly one character or '*', match zero or
145 more characters.  By default the matching is case\-insensitive.  To make the
146 search case sensitive, use the
147 .B \-\-case
148 option.
150 \fB\-O\fR, \fB\-\-optimistic\fR
151 Recover parts of the file even if they are currently marked as in use.
153 \fB\-o\fR, \fB\-\-output\fR FILE
154 Use this option to set name of output file that
155 .B \-\-undelete
157 .B \-\-copy
158 will create.
160 \fB\-P\fR, \fB\-\-parent\fR
161 Display the parent directory of a deleted file.
163 \fB\-p\fR, \fB\-\-percentage\fR NUM
164 Filter the output of the
165 .B \-\-scan
166 option, by only matching files with a certain amount of recoverable content.
167 .B Please read the caveats section for more details.
169 \fB\-q\fR, \fB\-\-quiet\fR
170 Reduce the amount of output to a minimum.  Naturally, it doesn't make sense to
171 combine this option with
172 .BR \-\-scan .
174 \fB\-s\fR, \fB\-\-scan\fR
175 Search through an NTFS volume and print a list of files that could be recovered.
176 This is the default action of
177 .BR ntfsundelete .
178 This list can be filtered by filename, size, percentage recoverable or last
179 modification time, using the
180 .BR \-\-match ,
181 .BR \-\-size ,
182 .B \-\-percent
184 .B \-\-time
185 options, respectively.
187 The output of scan will be:
190 Inode  Flags  %age     Date      Size  Filename
191  6038  FN..    93%  2002\-07\-17  26629  thesis.doc
194 box;
195 lB lB
196 l l.
197 Flag    Description
198 F/D     File/Directory
199 N/R     (Non\-)Resident data stream
200 C/E     Compressed/Encrypted data stream
201 !       Missing attributes
205 The percentage field shows how much of the file can potentially be recovered.
207 \fB\-S\fR, \fB\-\-size\fR RANGE
208 Filter the output of the
209 .B \-\-scan
210 option, by looking for a particular range of file sizes.  The range may be
211 specified as two numbers separated by a '\-'.  The sizes may be abbreviated
212 using the suffixes k, m, g, t, for kilobytes, megabytes, gigabytes and terabytes
213 respectively.
215 \fB\-t\fR, \fB\-\-time\fR SINCE
216 Filter the output of the
217 .B \-\-scan
218 option.  Only match files that have been altered since this time.  The time must
219 be given as number using a suffix of d, w, m, y for days, weeks, months or years
220 ago.
222 \fB\-T\fR, \fB\-\-truncate\fR
224 .B ntfsundelete
225 is confident about the size of a deleted file, then it will restore the file to
226 exactly that size.  The default behaviour is to round up the size to the nearest
227 cluster (which will be a multiple of 512 bytes).
229 \fB\-u\fR, \fB\-\-undelete\fR
230 Select
231 .B undelete
232 mode.  You can specify the files to be recovered using by using
233 .B \-\-match
235 .B \-\-inodes
236 options.  This option can be combined with
237 .BR \-\-output ,
238 .BR \-\-destination ,
240 .BR \-\-byte .
242 When the file is recovered it will be given its original name, unless the
243 .B \-\-output
244 option is used.
246 \fB\-v\fR, \fB\-\-verbose\fR
247 Increase the amount of output that
248 .B ntfsundelete
249 prints.
251 \fB\-V\fR, \fB\-\-version\fR
252 Show the version number, copyright and license for
253 .BR ntfsundelete .
254 .SH EXAMPLES
255 Look for deleted files on /dev/hda1.
258 .B ntfsundelete /dev/hda1
261 Look for deleted documents on /dev/hda1.
264 .B ntfsundelete /dev/hda1 \-s \-m '*.doc'
267 Look for deleted files between 5000 and 6000000 bytes, with at least 90% of the
268 data recoverable, on /dev/hda1.
271 .B ntfsundelete /dev/hda1 \-S 5k\-6m \-p 90
274 Look for deleted files altered in the last two days
277 .B ntfsundelete /dev/hda1 \-t 2d
280 Undelete inodes 2, 5 and 100 to 131 of device /dev/sda1
283 .B ntfsundelete /dev/sda1 \-u \-i 2,5,100\-131
286 Undelete inode number 3689, call the file 'work.doc' and put it in the user's
287 home directory.
290 .B ntfsundelete /dev/hda1 \-u \-i 3689 \-o work.doc \-d ~
293 Save MFT Records 3689 to 3690 to a file 'debug'
296 .B ntfsundelete /dev/hda1 \-c 3689\-3690 \-o debug
299 .SH BUGS
300 There are some small limitations to
301 .BR ntfsundelete ,
302 but currently no known bugs.  If you find a bug please send an email describing
303 the problem to the development team:
306 ntfs\-3g\-devel@lists.sf.net
308 .SH AUTHORS
309 .B ntfsundelete
310 was written by Richard Russon and Holger Ohmacht, with contributions from Anton
311 Altaparmakov.
312 It was ported to ntfs-3g by Erik Larsson and Jean-Pierre Andre.
313 .SH AVAILABILITY
314 .B ntfsundelete
315 is part of the
316 .B ntfs-3g
317 package and is available from:
320 http://www.tuxera.com/community/
322 .SH SEE ALSO
323 .BR ntfsinfo (8),
324 .BR ntfsprogs (8)