Steve Kondik | e68cb60 | 2016-08-28 00:45:36 -0700 | [diff] [blame] | 1 | .\" Copyright (c) 2015 Jean-Pierre Andre |
| 2 | .\" This file may be copied under the terms of the GNU Public License. |
| 3 | .\" |
| 4 | .TH NTFSRECOVER 8 "September 2015" "ntfs-3g @VERSION@" |
| 5 | .SH NAME |
| 6 | ntfsrecover \- Recover updates committed by Windows on an NTFS volume |
| 7 | .SH SYNOPSIS |
| 8 | \fBntfsrecover\fR [\fIoptions\fR] \fIdevice\fR |
| 9 | .SH DESCRIPTION |
| 10 | .B ntfsrecover |
| 11 | applies to the metadata the updates which were requested on Windows but could |
| 12 | not be completed because they were interrupted by some event such as a power |
| 13 | failure, a hardware crash, a software crash or the device being unplugged. |
| 14 | Doing so, the file system is restored to a consistent state, however updates |
| 15 | to user data may still be lost. |
| 16 | |
| 17 | Updating the file system generally requires updating several records which |
| 18 | should all be made for the file system to be kept consistent. For instance, |
| 19 | creating a new file requires reserving an inode number (set a bit in a bit |
| 20 | map), creating a file record (store the file name and file attributes), and |
| 21 | registering the file in a directory (locate the file from some path). When an |
| 22 | unfortunate event occurs, and one of these updates could be done but not all |
| 23 | of them, the file system is left inconsistent. |
| 24 | |
| 25 | A group of updates which have all to be done to preserve consistency is |
| 26 | called a transaction, and the end of updates within a transaction is called |
| 27 | the commitment of the transaction. |
| 28 | |
| 29 | To protect from unfortunate events, Windows first logs in a special file all |
| 30 | the metadata update requests without applying any, until the commitment is |
| 31 | known. If the event occurs before the commitment, no update has been made and |
| 32 | the file system is consistent. If the event occurs after the update, the log |
| 33 | file can be analyzed later and the transactions which were committed can be |
| 34 | executed again, thus restoring the integrity of the file system. |
| 35 | |
| 36 | .B ntfsrecover |
| 37 | similarly examines the log file and applies the updates within committed |
| 38 | transactions which could not be done by Windows. |
| 39 | |
| 40 | Currently, ntfs-3g does not log updates, so |
| 41 | .B ntfsrecover |
| 42 | cannot be used to restore consistency after an unfortunate event occurred |
| 43 | while the file system was updated by Linux. |
| 44 | |
| 45 | .SH OPTIONS |
| 46 | Below is a summary of all the options that |
| 47 | .B ntfsrecover |
| 48 | accepts. The normal usage is to use no option at all, as most of these |
| 49 | options are oriented towards developers needs. |
| 50 | |
| 51 | Nearly all options have two equivalent names. The short name is |
| 52 | preceded by |
| 53 | .B \- |
| 54 | and the long name is preceded by |
| 55 | .BR \-\- . |
| 56 | Any single letter options, that don't take an argument, can be combined into a |
| 57 | single command, e.g. |
| 58 | .B \-bv |
| 59 | is equivalent to |
| 60 | .BR "\-b \-v" . |
| 61 | Long named options can be abbreviated to any unique prefix of their name. |
| 62 | .TP |
| 63 | \fB\-b\fR, \fB\-\-backward\fR |
| 64 | Examine the actions described in the logfile backward from the latest one to |
| 65 | the earliest one without applying any update. This may encompass records |
| 66 | generated during several sessions, and when Windows is restarted, it often |
| 67 | does not restart writing where it ended the previous session, so this leads |
| 68 | to errors and bad sequencing when examining the full log file. |
| 69 | .TP |
| 70 | \fB\-c\fR, \fB\-\-clusters\fR \fBCLUSTER-RANGE\fR |
| 71 | Restrict the output generated when using options -b -f -u -p |
| 72 | to the actions operating on a cluster within the given cluster range. |
| 73 | CLUSTER-RANGE is defined by the first and last cluster numbers separated |
| 74 | by a hyphen, for instance 100-109 or 0x3e8-0x3ff. A single number means |
| 75 | restricting to a single cluster. The first four log blocks have a special |
| 76 | role and they are always shown. |
| 77 | .TP |
| 78 | \fB\-f\fR, \fB\-\-forward\fR \fBNUM\fR |
| 79 | Examine the actions described in the logfile forward from the first one to |
| 80 | the last one without applying any update. As the log file is reused |
| 81 | circularly, the first one is generally not the earliest. Moreover when |
| 82 | Windows is restarted, it often does not restart writing where it ended the |
| 83 | previous sessions, and this leads to errors when examining a log file |
| 84 | generated during several sessions. |
| 85 | .TP |
| 86 | \fB\-h\fR, \fB\-\-help\fR |
| 87 | Show some help information. |
| 88 | .TP |
| 89 | \fB\-n\fR, \fB\-\-no-action\fR |
| 90 | Do not apply any modification, useful when using the options -p, -s or -u. |
| 91 | .TP |
| 92 | \fB\-p\fR, \fB\-\-play\fR \fBCOUNT\fR |
| 93 | Undo COUNT transaction sets and redo a single one, a transaction set being |
| 94 | all transactions between two consecutive checkpoints. This is useful for |
| 95 | replaying some transaction in the past. As a few actions are not undoable, |
| 96 | this is not always possible. |
| 97 | .TP |
| 98 | \fB\-r\fR, \fB\-\-range\fR \fBBLOCK-RANGE\fR |
| 99 | Examine the actions described in the logfile forward restricted to the |
| 100 | requested log file block range without applying any update. The first four |
| 101 | log blocks have a special role and they are always examined. |
| 102 | .TP |
| 103 | \fB\-s\fR, \fB\-\-sync\fR |
| 104 | Sync the file system by applying the committed actions which have not |
| 105 | been synced previously. This is the default option, used when none of |
| 106 | the options -n, -f, -r, -p and -u are present. |
| 107 | |
| 108 | The option -s can be repeated to request applying the committed actions |
| 109 | mentioned in the obsolete restart page. This is useful for testing the |
| 110 | situations where the latest restart page cannot be read though it can |
| 111 | actually be read. |
| 112 | .TP |
| 113 | \fB\-t\fR, \fB\-\-transactions\fR \fBCOUNT\fR |
| 114 | Display the transaction parameters when examining the log file with one |
| 115 | of the options --forward, --backward or --range. |
| 116 | .TP |
| 117 | \fB\-u\fR, \fB\-\-undo\fR \fBCOUNT\fR |
| 118 | Undo COUNT transaction sets, thus resetting the file system to some |
| 119 | checkpoint in the past, a transaction set being all transactions between |
| 120 | two consecutive checkpoints. As a few actions are not undoable, this is |
| 121 | not always possible. |
| 122 | .TP |
| 123 | \fB\-v\fR, \fB\-\-verbose\fR |
| 124 | Display more debug/warning/error messages. This option may be used twice |
| 125 | to display even more information. |
| 126 | .TP |
| 127 | \fB\-V\fR, \fB\-\-version\fR |
| 128 | Show the version number, copyright and license of |
| 129 | .BR ntfsrecover . |
| 130 | .SH EXAMPLES |
| 131 | Sync an NTFS volume on /dev/sda1. |
| 132 | .RS |
| 133 | .sp |
| 134 | .B ntfsrecover -s /dev/sda1 |
| 135 | .sp |
| 136 | .RE |
| 137 | Display all actions which updated a cluster in range 100 to 119 : |
| 138 | .RS |
| 139 | .sp |
| 140 | .B ntfsrecover --verbose --backward --clusters=100-119 /dev/sda1 |
| 141 | .sp |
| 142 | .RE |
| 143 | .SH BUGS |
| 144 | If you find a bug please send an email describing the problem to the |
| 145 | development team: |
| 146 | .br |
| 147 | .nh |
| 148 | ntfs\-3g\-devel@lists.sf.net |
| 149 | .hy |
| 150 | .SH AUTHORS |
| 151 | .B ntfsrecover |
| 152 | was written by Jean-Pierre Andre |
| 153 | .SH AVAILABILITY |
| 154 | .B ntfsrecover |
| 155 | is part of the |
| 156 | .B ntfs-3g |
| 157 | package and is available from: |
| 158 | .br |
| 159 | .nh |
| 160 | http://www.tuxera.com/community/ |
| 161 | .hy |
| 162 | .SH SEE ALSO |
| 163 | .BR ntfs-3g (8), |
| 164 | .BR ntfsfix (8), |
| 165 | .BR ntfsprogs (8) |