Commit Graph

19 Commits

Author SHA1 Message Date
Jean-Pierre André
1f863fef7d Processed redo log actions associated to undoing a CompensationlogRecord
At least when there is a shortage of space on the target device, several
redo actions are associated to undoing a CompensationlogRecord, and they
should be redone upon recovery.
2017-10-26 10:44:36 +02:00
Jean-Pierre André
cdd58aaee3 Fixed updating the vcn of subtree in ntfsrecover
The logic for determining where the actions SetIndexEntryVcnRoot and
SetIndexEntryVcnAllocation had to insert a new vcn was unclear and was
wrong in some situations. This is to fix the logic as determined by new
evidence.
2017-06-20 08:56:00 +02:00
Jean-Pierre André
5be0b9f62a Fixed the computation of highest_vcn when applying a runlist fixup
When a file is partially truncated, the highest_vcn has to be recomputed
before the file size is adjusted. As a consequence the unmapped run
inserted at the end of runlist to match the file size should not be taken
into account when determining the higest_vcn.
2017-05-25 10:52:54 +02:00
Jean-Pierre André
1797ab5ecd Upgraded ntfsrecover to support log files 2.0
When the fast restart mode of Windows 8 (or later) is activated, the
log file format is different (version 2.0 instead of 1.1), having 32
temporaty blocks instead of 2. This patch upgrades ntfsrecover to take
the new format into account.
2017-05-25 10:44:18 +02:00
Erik Larsson
65f63fe2b3 Use signed endian conversion macros for signed little-endian members. 2017-03-21 11:55:41 +01:00
Jean-Pierre André
3cc22ba329 Moved general declarations from ntfsrecover.h to logfile.h
The declarations related to the log file structure are now grouped
in logfile.h, those specific to the recovery process are kept in
ntfsrecover.h
2016-04-06 11:03:31 +02:00
Jean-Pierre André
ad59ecec3f Redefined target_vcn on 64 bits in ntfsrecover.h
In a log record, the target vcn has to be stored on 64 bits
2016-04-06 10:45:30 +02:00
Jean-Pierre André
a6f4bae6d5 Typedef'ed new structs in ntfsrecover the same way as in logfile.h
Prepare merging ntfsrecover.h into logfile.h by declaring new structs
the same was as in logfile.h
2016-04-06 10:34:46 +02:00
Jean-Pierre André
2ab8bb509a Typedef'ed old structs in ntfsrecover the same way as in logfile.h
Prepare merging ntfsrecover.h into logfile.h by declaring duplicated
structs the same way
2016-04-06 10:32:39 +02:00
Jean-Pierre André
71b03fbd16 Redefined ntfsrecover enums as little-endian values
Rather than cpu-endian values, use little-endian ones in ntfsrecover
for similarity with layout.h
2016-04-06 10:26:46 +02:00
Jean-Pierre André
8fc9c96305 Reworked decisions to undo related to unreadable records
When an INDX or MFT record could not be read while undoing the creation
of this record, there is nothing to do. However if this was undoing the
deletion of the last entry in an index, a new void index block has to be
created.
2016-04-06 08:44:38 +02:00
Erik Larsson
a2efc3ec9f Change type of all LSN struct members in ntfsrecover.h to leLSN.
This is done to match the type of the LSN struct members in layout.h.
The effect of this change is that while these members were declared with
the le64 type previously, leLSN resolves to sle64. I.e. what was
previously unsigned fields are now signed.

Following this change we also need to switch over a few macros from
unsigned to signed versions in the code that uses these struct
definitions.
2016-01-29 12:36:06 +01:00
Erik Larsson
ee4c48f4b1 playlog.c: Use const macro for byteswapping const expression. 2016-01-29 10:49:52 +01:00
Erik Larsson
81fce3b70e playlog.c: Fix improper byteswapping macros used for sle64 members. 2016-01-29 10:49:25 +01:00
Jean-Pierre André
f85b82c8e1 Fixed headers of log play functions in playlog
The functions were made static with a textual description.
2015-11-20 16:14:16 +01:00
Jean-Pierre André
aade4c46b6 Fixed missing error return in playlog
No error was returned from reading a protected record which is part of
an unreadable raw cluster.
2015-11-20 16:11:15 +01:00
Jean-Pierre André
ede1808ba6 Removed obsolete code from playlog
The code for dealing with new MFT records had been made more general
2015-11-12 15:46:33 +01:00
Jean-Pierre André
22b59548d9 Subdivided the replay functions in playlog
Partially unnested play_redos() and play_undos()
2015-11-12 15:44:47 +01:00
Jean-Pierre André
0cb0173bbc Implemented recovery of updates committed by Windows
ntfsrecover applies to the metadata the updates which were requested on
Windows but could not be completed because they were interrupted by
some event such as a power failure, a hardware crash, a software crash
or the device being unplugged. Doing so, the file system is restored
to the latest consistent state.

No update to libntfs-3g is required by this implementation.
2015-11-09 13:18:58 +01:00