qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Matti Hameister <1847793@bugs.launchpad.net>
To: qemu-devel@nongnu.org
Subject: [Bug 1847793] Re: qemu 4.1.0 - Corrupt guest filesystem after new vm install
Date: Wed, 30 Oct 2019 11:56:36 -0000	[thread overview]
Message-ID: <157243659639.29370.12703072921528821189.malone@soybean.canonical.com> (raw)
In-Reply-To: 157080798335.681.12255731732435282400.malonedeb@chaenomeles.canonical.com

I have the same (related?) issue and wanted to add my experience with it. I had 3 qemu qcow2 VM running on ArchLinux. I never used snapshots or something like it. Just normal start&shutdown. 2 of these VMs were also ArchLinux running on ext4. Both of these VMs had a data corruption inside the quest. The data being corrupted were files I had not touched in month (large tar archives). One guest was running on a SSD with discard, the other VM was running on a normal hard drive without any discard.
The last VM was a Windows 10 VM. While the VM was running fine, after "fixing" the image issues with qemu-img -r all hdd.qcow2 the Windows 10 installation was unbootable and beyond repair with normal Windows tools.

While the VMs are running I saw these lines printed by qemu (for all VMs
in question):

qcow2_free_clusters failed: Invalid argument
qcow2_free_clusters failed: Invalid argument
qcow2_free_clusters failed: Invalid argument

I recreated my VMs and I now chose btrfs as a filesystem. No issues yet
on the image. I also recreated the Windows 10 VM. It worked fine a
couple of days. Today I checked the image, after I saw the free_clusters
lines above again:

Many many lines like this:
Leaked cluster 260703 refcount=1 reference=0                                                   
ERROR cluster 260739 refcount=0 reference=1 
ERROR OFLAG_COPIED data cluster: l2_entry=800000038ec10000 refcount=0

638 errors were found on the image.
Data may be corrupted, or further writes to the image may corrupt it.

339 leaked clusters were found on the image.
This means waste of disk space, but no harm to data.
314734/4096000 = 7.68% allocated, 26.70% fragmented, 0.00% compressed clusters
Image end offset: 21138374656

The installation itself still works but I don't know if there are any
silently corrupted files in there.

QEMU 4.1.0 from ArchLinux
Host-Filesystem is ext4
Start-Parameter (the same on all VMs):

qemu-system-x86_64 -cpu Haswell-noTSX -M q35 -enable-kvm -smp
4,cores=4,threads=1,sockets=1 -net nic,model=virtio -net
user,hostname=WindowsKVM.local -drive
if=none,id=hd,file=hdd.qcow2,discard=unmap -device virtio-scsi-
pci,id=scsi --enable-kvm -device scsi-hd,drive=hd -m 4096 -drive
if=pflash,format=raw,readonly,file=/usr/share/ovmf/x64/OVMF_CODE.fd
-drive if=pflash,format=raw,file=./OVMF_VARS.fd -vga std -drive
file=Windows10ISO/Windows.iso,index=0,media=cdrom -drive file=virtio-
win-0.1.173.iso,index=1,media=cdrom -no-quit

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1847793

Title:
  qemu 4.1.0 - Corrupt guest filesystem after new vm install

Status in QEMU:
  New

Bug description:
  When I install a new vm with qemu 4.1.0 all the guest filesystems are
  corrupt. The first boot from the install dvd iso is ok and the
  installer work fine. But the guest system hangs after the installer
  finishes and I reboot the guest. I can see the grub boot menue but the
  system cannot load the initramfs.

  Testet with:
  - RedHat Enterprise Linux 7.5, 7.6 and 7.7 (RedHat uses xfs for the /boot and / partition)
  Guided install with the graphical installer, no lvm selected.
  - Debian Stable/Buster (Debian uses ext4 for / and /home partition)
  Guidet install with the graphical installer and default options.

  Used commandline to create the vm disk image:
  qemu-img create -f qcow2 /volumes/disk2-part2/vmdisks/vmtest10-1.qcow2 20G

  Used qemu commandline for vm installation:
  #!/bin/sh
  # vmtest10 Installation
  #
  /usr/bin/qemu-system-x86_64  -cpu SandyBridge-IBRS \
      -soundhw hda \
      -M q35 \
      -k de \
      -vga qxl \
      -machine accel=kvm \
      -m 4096 \
      -display gtk \
      -drive file=/volumes/disk2-part2/images/debian-10.0.0-amd64-DVD-1.iso,if=ide,media=cdrom \
      -drive file=/volumes/disk2-part2/images/vmtest10-1.qcow2,if=virtio,media=disk,cache=writeback \
      -boot once=d,menu=off \
      -device virtio-net-pci,mac=52:54:00:2c:02:6c,netdev=vlan0 \
      -netdev bridge,br=br0,id=vlan0 \
      -rtc base=localtime \
      -name "vmtest10" \
      -usb -device usb-tablet \
      -spice disable-ticketing \
      -device virtio-serial-pci \
      -device virtserialport,chardev=spicechannel0,name=com.redhat.spice.0 \
      -chardev spicevmc,id=spicechannel0,name=vdagent $*

  Host OS:
  Archlinux (last updated at 10.10.2019)
  Linux testing 5.3.5-arch1-1-ARCH #1 SMP PREEMPT Mon Oct 7 19:03:08 UTC 2019 x86_64 GNU/Linux
  No libvirt in use.

  
  With qemu 4.0.0 it works fine without any errors.

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1847793/+subscriptions


  parent reply	other threads:[~2019-10-30 12:12 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-11 15:33 [Bug 1847793] [NEW] qemu 4.1.0 - Corrupt guest filesystem after new vm install Claus Paetow
2019-10-14 14:51 ` [Bug 1847793] " Dr. David Alan Gilbert
2019-10-16 12:46 ` Claus Paetow
2019-10-16 13:17 ` Dr. David Alan Gilbert
2019-10-16 13:28 ` Max Reitz
2019-10-16 15:41 ` psyhomb
2019-10-17  9:15 ` Laszlo Ersek (Red Hat)
2019-10-21  8:46 ` Max Reitz
2019-10-21 12:23 ` Simon John
2019-10-24 14:20 ` Max Reitz
2019-10-30 11:56 ` Matti Hameister [this message]
2019-10-30 16:59 ` Max Reitz
2019-10-31 13:55 ` Claus Paetow
2019-11-04 11:50 ` Wayne
2019-11-05 11:41 ` Max Reitz
2020-08-12 11:47 ` Laszlo Ersek (Red Hat)
2021-04-22  7:42 ` Thomas Huth
2021-06-22  4:18 ` Launchpad Bug Tracker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=157243659639.29370.12703072921528821189.malone@soybean.canonical.com \
    --to=1847793@bugs.launchpad.net \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).