When using option --ignore-fs-check in ntfsclone, doubly allocated cluster
still lead to aborting the process. Bypassing the error is useful for
creating a metadata image intended for debugging, for example when the
partition was not closed properly and the logfile has to be applied to
restore the integrity of metadata.
Usually, only a few pages of the Windows log file are saved in an
ntfsclone image. This is inappropriate for building reference images
for recovering the log, and the --full-logfile option serves that
purpose.
When the bad cluster list required extent, ntfsclone and ntfsresize
did not process the extents, leading to unexpected read errors and
unmatching bitmaps. This fix enables the full list to be taken into
account.
The ntfsprogs used to return failure when option --version or --help
was used, and this has triggered complains from distribution packagers
who use these options in packaging scripts.
With this patch, success is returned (same behavior as gcc).
The ioctl() function is not implemented in the Windows variant. By forcing
a negative apparent return, an alternative is triggered to get the
partition size which is normally obtained from an ioctl().
When ntfsclone'ing to a file, the target file was truncated to the volume
size. This is not useful on file systems which support sparse files. In
the case of ntfs-3g this leads to prevent optimizations specific to
appending data. So when a sparse output file is detected, it is emptied
to benefit from subsequent appending of data.
When a sector is unreadable, consider the whole sector as bad, instead
of trying to find which 512-byte parts of it are bad. This was causing
unwanted retries for devices with 4K sectors.
This mainly means using the functions in win32_io.c instead of the
standard msvcrt.dll ones in order to be able to truncate files and
create sparse ones.
This mainly means using the functions in win32_io.c instead of the
standard msvcrt.dll ones in order to be able to truncate files and
create sparse ones.
Allow the "--ignore-fs-check" option to be used when cloning a file system
which has allocation errors. This is useful when there is a fear that
repairing the file system might create further damage, or when the repair
has to be made on another computer.
This patch adds a new option -n to ntfsclone for simulating a restore
without writing anything. This is useful for checking the consistency
of an image without destroying the original partition.
When creating a metadata image, all user data is supposed to be wiped off,
but this was wrong for $MFT and directory indexes when they were
fragmented. This patch cleans the tails of metadata fragments.
The MS_* flags originated from system constants. However the flags
passed to ntfs_mount were really unrelated to the system constants and
many new MS_* flags had to be introduced as different features were
added to the library. Those flags had no counterparts in any system
APIs, so using the same naming scheme is inappropriate.
Instead, let's namespace these flags similarly to what has already been
done in ntfsprogs/libntfs earlier. This avoids any possible conflicts
with system constants.
The values of the flags themselves are kept the same as earlier, so
backward compatibility is retained.
Defined new options --new-serial and --new-half-serial to set a new
random serial number when cloning or restoring a file system.
Useful for mounting the original and the cloned file system at the
same time.
Clearing of user data was wrong when extracting the metadata into a
special format image. In this situation the clearing has to be done
without mounting the file system.
When extracting the metadata, unused data at the end of MFT records is
supposed to be cleared. This was done for the base record of each file,
but not for the extent records.
Logging of fixup errors for uninitialized inodes cause unnecessary
worries and suspicion of malfunctions in ntfs-3g. This patch silences
these loggings in ntfsclone and ntfsresize which have to analyze all
inodes, including the uninitialized ones.
When creating a partition image, ntfsclone write an extra byte to
describe each cluster, this causes two unneeded ntfs-3g calls per cluster,
and inefficiency when imaging to ntfs.
A recent patch added copying the backup boot sector when cloning,
saving or restoring a partition, but when the total number of sectors is
not a multiple of the number of sectors per cluster, the last cluster
containing the backup boot sector is shorter than usual.
When this happens, the present patch avoids overflowing from partition
when accessing the last cluster.