virt-v2v/0002-convert-Use-e2fsck-n-flag-when-checking-ext2-3-4-fil.patch
Richard W.M. Jones c2d8e8a08a Run filesystem check before and after conversion
Further fix required for ext2/3/4 guests

related: RHEL-91931
2025-05-20 14:49:53 +01:00

61 lines
2.1 KiB
Diff
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

From db1908226ce901b73953732edcba8a20087422c4 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
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.