Lines Matching defs:image

6  * Special image format support copyright (c) 2004 Per Olofsson
8 * Clone NTFS data and/or metadata to a sparse file, image, device or stdout.
149 ntfs_walk_clusters_ctx *image;
169 #define IMAGE_MAGIC "\0ntfsclone-image"
178 * stupidly used the volume version as the image version... )-: I hope NTFS
182 * NOTE: Only bump the minor version if the image format and header are still
303 " Efficiently clone NTFS to a sparse file, image, device or standard output.\n"
307 " -s, --save-image Save to the special image format\n"
308 " -r, --restore-image Restore from the special image format\n"
318 " If FILE is '-' then send the image to the standard output. If SOURCE is '-'\n"
319 " and --restore-image is used then read the image from the standard input.\n"
338 { "restore-image", no_argument, NULL, 'r' },
341 { "save-image", no_argument, NULL, 's' },
407 err_exit("Saving only metadata to an image is not "
411 err_exit("Restoring only metadata from an image is not "
422 err_exit("Saving and restoring an image at the same time "
491 static s64 is_critical_metadata(ntfs_walk_clusters_ctx *image, runlist *rl)
493 s64 inode = image->ni->mft_no;
498 if (inode == FILE_BadClus && image->ctx->attr->type == AT_DATA)
504 if (image->ctx->attr->type == AT_DATA) {
518 if (image->ctx->attr->type != AT_DATA)
655 static void dump_clusters(ntfs_walk_clusters_ctx *image, runlist *rl)
662 if (!(len = is_critical_metadata(image, rl)))
681 Printf("Saving NTFS to image ...\n");
741 Printf("Restoring NTFS from image ...\n");
771 err_exit("Invalid command code in image\n");
945 static void wipe_timestamps(ntfs_walk_clusters_ctx *image)
947 ATTR_RECORD *a = image->ctx->attr;
960 static void wipe_resident_data(ntfs_walk_clusters_ctx *image)
967 a = image->ctx->attr;
970 if (image->ni->mft_no <= LAST_METADATA_INODE)
986 static void clone_logfile_parts(ntfs_walk_clusters_ctx *image, runlist *rl)
992 vcn = offset / image->ni->vol->cluster_size;
1014 ctx = walk->image->ctx;
1019 wipe_resident_data(walk->image);
1020 wipe_timestamps(walk->image);
1025 if (wipe && walk->image->ctx->attr->type == AT_INDEX_ALLOCATION)
1026 wipe_index_allocation_timestamps(walk->image->ni, a);
1046 dump_clusters(walk->image, rl + i);
1056 walk->image->inuse += lcn_length;
1059 walk->image->ni->mft_no == FILE_LogFile &&
1060 walk->image->ctx->attr->type == AT_DATA)
1061 clone_logfile_parts(walk->image, rl);
1071 if (!(ctx = ntfs_attr_get_search_ctx(walk->image->ni, NULL)))
1078 walk->image->ctx = ctx;
1285 walk->image->ni = ni;
1360 Printf("Ntfsclone image version: %d.%d\n",
1372 Printf("Offset to image data : %u (0x%x) bytes\n",
1522 "efficient --save-image option of ntfsclone. Use "
1523 "the --restore-image option to restore the image.\n");
1574 "by using the more efficient --save-image "
1575 "option\nof ntfsclone. Use the --restore-image "
1576 "option to restore the image.\n");
1591 perr_exit("failed to open image");
1596 err_exit("Input file is not an image! (invalid magic)\n");
1601 Printf("Old image format detected. If the image was created "
1604 "ntfsclone to recreate the image.\n");
1622 err_exit("Do not know how to handle image format "
1627 /* Read the image header data offset. */
1693 "NTFS image (%lld).\n", dest_size, input_size);
1740 static void ignore_bad_clusters(ntfs_walk_clusters_ctx *image)
1764 image->inuse--;
1815 ntfs_walk_clusters_ctx image;
1820 /* print to stderr, stdout can be an NTFS image ... */
1868 memset(&image, 0, sizeof(image));
1869 backup_clusters.image = &image;
1873 print_disk_usage("", vol->cluster_size, vol->nr_clusters, image.inuse);
1875 check_dest_free_space(vol->cluster_size * image.inuse);
1877 ignore_bad_clusters(&image);
1880 initialise_image_hdr(device_size, image.inuse);
1885 s64 nr_clusters_to_save = image.inuse;
1903 memset(&image, 0, sizeof(image));
1904 backup_clusters.image = &image;