.B \-n
Dry-run; do not actually write blocks back to the filesystem.
.TP
+.BI \-o " offset"
+Specify the filesystem's
+.I offset
+(in bytes) from the beginning of the device or file.
+.TP
.B \-v
Report which block we're currently replaying.
.SH AUTHOR
__u32 key_crc, blk_crc, hdr_crc;
blk64_t lblk;
ext2_filsys fs;
+ __u64 offset;
+ char opt_offset_string[40] = { 0 };
#ifdef ENABLE_NLS
setlocale(LC_MESSAGES, "");
add_error_table(&et_ext2_error_table);
prg_name = argv[0];
- while ((c = getopt(argc, argv, "fhnvz:")) != EOF) {
+ while ((c = getopt(argc, argv, "fhno:vz:")) != EOF) {
switch (c) {
case 'f':
force = 1;
case 'n':
dry_run = 1;
break;
+ case 'o':
+ offset = strtoull(optarg, &buf, 0);
+ if (*buf) {
+ com_err(prg_name, 0,
+ _("illegal offset - %s"), optarg);
+ exit(1);
+ }
+ /* used to indicate that an offset was specified */
+ opt_offset_string[0] = 1;
+ break;
case 'v':
verbose = 1;
break;
exit(1);
}
+ if (*opt_offset_string) {
+ retval = snprintf(opt_offset_string, sizeof(opt_offset_string),
+ "offset=%llu", offset);
+ if (retval >= sizeof(opt_offset_string)) {
+ /* should not happen... */
+ com_err(prg_name, 0, _("specified offset is too large"));
+ exit(1);
+ }
+ io_channel_set_options(channel, opt_offset_string);
+ }
+
if (!force && check_filesystem(&undo_ctx, channel))
exit(1);