'mkfs.btrfs'). This is typically the system page size (4KiB on x86_64
machines).
+NOTE: The source filesystem should be clean, you are encouraged to run the
+'fsck' tool if you're not sure.
+
**REMOVE THE ORIGINAL FILESYSTEM METADATA**
By removing the 'ext2_saved' subvolume, all metadata of the original filesystem
}
memset(&dst->reserved, 0, sizeof(dst->reserved));
}
+static int check_filesystem_state(struct btrfs_convert_context *cctx)
+{
+ ext2_filsys fs = cctx->fs_data;
+
+ if (!(fs->super->s_state & EXT2_VALID_FS))
+ return 1;
+ else if (fs->super->s_state & EXT2_ERROR_FS)
+ return 1;
+ else
+ return 0;
+}
/*
* copy a single inode. do all the required works, such as cloning
ret = convert_open_fs(devname, &cctx);
if (ret)
goto fail;
+ ret = check_filesystem_state(&cctx);
+ if (ret)
+ warning(
+ "source filesystem is not clean, running filesystem check is recommended");
ret = convert_read_used_space(&cctx);
if (ret)
goto fail;