- /* Construct debugfs command line. */
- snprintf(cmd, cmdsz, "%s -c -R 'dump /%s %s/mountdata' '%s'",
- DEBUGFS, MOUNT_DATA_FILE, tmpdir, dev);
-
- ret = run_command(cmd, cmdsz);
- if (ret)
- verrprint("%s: Unable to dump %s dir (%d)\n",
- progname, MOUNT_CONFIGS_DIR, ret);
-
- sprintf(filepnm, "%s/mountdata", tmpdir);
- filep = fopen(filepnm, "r");
- if (filep) {
- size_t num_read;
- vprint("Reading %s\n", MOUNT_DATA_FILE);
- num_read = fread(mo_ldd, sizeof(*mo_ldd), 1, filep);
- if (num_read < 1 && ferror(filep)) {
- fprintf(stderr, "%s: Unable to read from file %s: %s\n",
- progname, filepnm, strerror(errno));
+ if (!backfs) {
+ retval = ext2fs_open(dev, open_flags, 0, 0,
+ unix_io_manager, &backfs);
+ if (retval) {
+ fprintf(stderr, "Unable to open fs on %s\n", dev);
+ goto read_label;