From 5593ee27110bffc68929b6337b1097f3450f9570 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Pierre=20Andr=C3=A9?= Date: Mon, 23 Jan 2012 17:11:46 +0100 Subject: [PATCH] fixed clearing the end of extents when extracting metadata 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. --- ntfsprogs/ntfsclone.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ntfsprogs/ntfsclone.c b/ntfsprogs/ntfsclone.c index 7d56cc6a..2e40f7b6 100644 --- a/ntfsprogs/ntfsclone.c +++ b/ntfsprogs/ntfsclone.c @@ -1407,8 +1407,13 @@ static int walk_clusters(ntfs_volume *volume, struct ntfs_walk_cluster *walk) walk->image->ni = ni; walk_attributes(walk); out: - if (wipe) { + if (wipe && !opt.metadata_image) { + int i; + wipe_unused_mft_data(ni); + for (i = 0; i < ni->nr_extents; ++i) { + wipe_unused_mft_data(ni->extent_nis[i]); + } mft_inode_write_with_same_usn(volume, ni); }