From db1908226ce901b73953732edcba8a20087422c4 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 20 May 2025 08:23:39 +0100 Subject: [PATCH] convert: Use e2fsck -n flag when checking ext2/3/4 filesystems MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When checking the fedora-30 image from virt-builder: $ virt-v2v -i disk fedora-30.img -o null ... [ 68.4] Checking filesystem integrity before conversion virt-v2v: error: libguestfs error: e2fsck: e2fsck 1.47.1 (20-May-2024) e2fsck: need terminal for interactive repairs Use the e2fsck -n flag to avoid this problem. This flag is described as: -n Open the file system read-only, and assume an answer of `no' to all questions. Allows e2fsck to be used non-interactively. This option may not be specified at the same time as the -p or -y op‐ tions. Updates: commit 78ffb68d4f1ef8af776c24537feaf832fd3ec7e9 Updates: https://issues.redhat.com/browse/RHEL-91931 --- convert/convert.ml | 2 +- m4/guestfs-libraries.m4 | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/convert/convert.ml b/convert/convert.ml index 0ed7a884..a6e0d532 100644 --- a/convert/convert.ml +++ b/convert/convert.ml @@ -258,7 +258,7 @@ and do_fsck g = ); | dev, "ext4" -> - g#e2fsck dev (* ~correct:false is the default *) + g#e2fsck ~forceno:true dev | dev, "xfs" -> if g#xfs_repair ~nomodify:true dev <> 0 then diff --git a/m4/guestfs-libraries.m4 b/m4/guestfs-libraries.m4 index 4f5b745a..fa13e0f6 100644 --- a/m4/guestfs-libraries.m4 +++ b/m4/guestfs-libraries.m4 @@ -21,7 +21,8 @@ dnl Of course we need libguestfs. dnl dnl We need libguestfs 1.55.6 for guestfs_sh_out. dnl We need libguestfs 1.55.12 for guestfs_btrfs_scrub_full. -PKG_CHECK_MODULES([LIBGUESTFS], [libguestfs >= 1.55.12]) +dnl We need libguestfs 1.55.13 for guestfs_e2fsck FORCENO flag. +PKG_CHECK_MODULES([LIBGUESTFS], [libguestfs >= 1.55.13]) printf "libguestfs version is "; $PKG_CONFIG --modversion libguestfs dnl And libnbd.