From 4979c1d6c9d223963902647ef90aa599d5632ffc Mon Sep 17 00:00:00 2001 From: xiaoyuliang Date: Fri, 1 Mar 2024 10:22:57 +0800 Subject: [PATCH] Fix the Windows image can only be mounted in read-only mode. --- ...-3g-to-fix-disk-mounted-read-only-er.patch | 42 +++++++++++++++++++ libguestfs.spec | 8 +++- 2 files changed, 48 insertions(+), 2 deletions(-) create mode 100644 0001-add-package-ntfs-3g-to-fix-disk-mounted-read-only-er.patch diff --git a/0001-add-package-ntfs-3g-to-fix-disk-mounted-read-only-er.patch b/0001-add-package-ntfs-3g-to-fix-disk-mounted-read-only-er.patch new file mode 100644 index 0000000..f3570e6 --- /dev/null +++ b/0001-add-package-ntfs-3g-to-fix-disk-mounted-read-only-er.patch @@ -0,0 +1,42 @@ +From 73ab648afb6518b5be14a842ecffeb80119f70e8 Mon Sep 17 00:00:00 2001 +From: xiaoyuliang +Date: Wed, 6 Sep 2023 11:16:31 +0800 +Subject: [PATCH] add package ntfs-3g to fix disk mounted read-only error in + Windwos v2v + +error as: + +command: mount '/dev/sda1' '/sysroot//'^M +[ 3.258427][ T290] ntfs: volume version 3.1.^M +libguestfs: trace: v2v: mount = 0 +libguestfs: trace: v2v: touch "/ozcf9clt" +guestfsd: => mount (0x1) took 0.01 secs^M +guestfsd: <= touch (0x3) request length 56 bytes^M +guestfsd: error: open: /ozcf9clt: Read-only file system^M +guestfsd: => touch (0x3) took 0.00 secslibguestfs: trace: v2v: touch = -1 (error) + +virt-v2v: error: filesystem was mounted read-only, even though we asked for +it to be mounted read-write. This usually means that the filesystem was +not cleanly unmounted. Possible causes include trying to convert a guest +which is running, or using Windows Hibernation or Fast Restart. + +Original error message: touch: open: /ozcf9clt: Read-only file system + +--- + appliance/packagelist.in | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/appliance/packagelist.in b/appliance/packagelist.in +index 762bdc2..eadb9de 100644 +--- a/appliance/packagelist.in ++++ b/appliance/packagelist.in +@@ -287,6 +287,7 @@ libtirpc + pcre + libselinux + yara ++ntfs-3g + + dnl tools needed by virt-dib + ifelse(REDHAT,1, +-- +2.33.0 diff --git a/libguestfs.spec b/libguestfs.spec index 1a0fbba..9b1a342 100644 --- a/libguestfs.spec +++ b/libguestfs.spec @@ -4,7 +4,7 @@ Name: libguestfs Version: 1.40.2 -Release: 19 +Release: 20 Epoch: 1 Summary: A set of tools for accessing and modifying virtual machine (VM) disk images License: LGPLv2+ @@ -21,6 +21,7 @@ Patch0005: Fix-verbose-error.patch Patch0006: 0001-tests-Use-explicit-backing-format-for-all-backing-di.patch Patch0007: add-some-package-to-fix-run-error.patch Patch0008: lib-Autodetect-backing-format-for-qemu-img-create-b.patch +Patch0009: 0001-add-package-ntfs-3g-to-fix-disk-mounted-read-only-er.patch BuildRequires: gcc-c++, rpcgen, libtirpc-devel, supermin-devel >= 5.1.18, hivex-devel >= 1.2.7-7, ocaml-hivex-devel, perl(Pod::Simple), perl(Pod::Man) BuildRequires: /usr/bin/pod2text, po4a, augeas-devel >= 1.7.0, readline-devel, genisoimage, libxml2-devel, createrepo, glibc-static, libselinux-utils @@ -39,7 +40,7 @@ BuildRequires: systemd, tar, udev, util-linux, vim-minimal, which, xfsprogs, yaj %ifarch x86_64 BuildRequires: syslinux syslinux-extlinux %endif -Requires: supermin >= 5.1.18, augeas-libs%{?_isa} >= 1.7.0, libacl%{?_isa}, libcap%{?_isa}, hivex%{?_isa}, pcre%{?_isa}, libselinux%{?_isa}, systemd-libs%{?_isa} +Requires: supermin >= 5.1.18, augeas-libs%{?_isa} >= 1.7.0, libacl%{?_isa}, libcap%{?_isa}, hivex%{?_isa}, pcre%{?_isa}, libselinux%{?_isa}, systemd-libs%{?_isa} ntfs-3g Requires: yajl%{?_isa}, libdb-utils, fuse, /usr/bin/qemu-img, libvirt-daemon-kvm >= 0.10.2-3, selinux-policy >= 3.11.1-63, bundled(gnulib), /usr/bin/hexedit, binutils Requires: /usr/bin/less, /usr/bin/vi, gnupg2, xz, curl, perl(Sys::Virt), perl(Win::Hivex) >= 1.2.7, gawk, gzip, unzip, /usr/bin/virsh Suggests: osinfo-db @@ -373,6 +374,9 @@ install -m 0644 utils/boot-benchmark/boot-benchmark.1 $RPM_BUILD_ROOT%{_mandir}/ %exclude %{_mandir}/man1/virt-tar.1* %changelog +* Fri Mar 1 2024 xiaoyuliang - 1:1.40.2-20 +- add package ntfs-3g to fix disk mounted read-only error in Windwos v2v. + * Tue Dec 5 2023 yuxiating - 1:1.40.2-19 - Autodetect backing format for qemu-img create -b -- Gitee