*
* Copyright (c) 2003-2006 Szabolcs Szakacsits
* Copyright (c) 2004-2006 Anton Altaparmakov
- * Copyright (c) 2010-2015 Jean-Pierre Andre
+ * Copyright (c) 2010-2016 Jean-Pierre Andre
* Special image format support copyright (c) 2004 Per Olofsson
*
* Clone NTFS data and/or metadata to a sparse file, image, device or stdout.
int new_serial;
int metadata_image;
int preserve_timestamps;
+ int full_logfile;
int restore_image;
char *output;
char *volume;
" -t, --preserve-timestamps Do not clear the timestamps\n"
" -q, --quiet Do not display any progress bars\n"
" -f, --force Force to progress (DANGEROUS)\n"
+ " --full-logfile Include the full logfile in metadata output\n"
" -h, --help Display this help\n"
#ifdef DEBUG
" -d, --debug Show debug information\n"
"Efficiently clone, image, restore or rescue an NTFS Volume.\n\n"
"Copyright (c) 2003-2006 Szabolcs Szakacsits\n"
"Copyright (c) 2004-2006 Anton Altaparmakov\n"
- "Copyright (c) 2010-2015 Jean-Pierre Andre\n\n");
+ "Copyright (c) 2010-2016 Jean-Pierre Andre\n\n");
fprintf(stderr, "%s\n%s%s", ntfs_gpl, ntfs_bugs, ntfs_home);
exit(0);
}
{ "rescue", no_argument, NULL, 'R' },
{ "new-serial", no_argument, NULL, 'I' },
{ "new-half-serial", no_argument, NULL, 'i' },
+ { "full-logfile", no_argument, NULL, 'l' },
{ "save-image", no_argument, NULL, 's' },
{ "preserve-timestamps", no_argument, NULL, 't' },
{ "version", no_argument, NULL, 'V' },
case 'I': /* not proposed as a short option */
opt.new_serial |= 2;
break;
+ case 'l':
+ opt.full_logfile++;
+ break;
case 'm':
opt.metadata++;
break;
if (inode == FILE_BadClus && image->ctx->attr->type == AT_DATA)
return 0;
- if (inode != FILE_LogFile)
+ if ((inode != FILE_LogFile) || opt.full_logfile)
return rl->length;
if (image->ctx->attr->type == AT_DATA) {
* Normally avoided in order to get the original log file
* data, but needed when remounting the metadata of a
* volume improperly unmounted from Windows.
+ * If the full log file was requested, it must be kept
+ * as is, so we just remount read-only.
*/
if (!(new_mntflag & (NTFS_MNT_RDONLY | NTFS_MNT_RECOVER))) {
- Printf("Trying to recover...\n");
- vol = ntfs_mount(opt.volume,
+ if (opt.full_logfile) {
+ Printf("Retrying read-only to ignore"
+ " the log file...\n");
+ vol = ntfs_mount(opt.volume,
+ new_mntflag | NTFS_MNT_RDONLY);
+ } else {
+ Printf("Trying to recover...\n");
+ vol = ntfs_mount(opt.volume,
new_mntflag | NTFS_MNT_RECOVER);
+ }
Printf("... %s\n",(vol ? "Successful" : "Failed"));
}
if (!vol)