Categories
PORADY

Naprawianie obrazu dysku Qcow2

Prawdopodobnie mój obraz ucierpiał z powodu dużego obciążenia operacjami I/O mimo, iż miałem Virtio-SCSI: https://forum.proxmox.com/threads/qcow2-corruption-after-snapshot-or-heavy-disk-i-o.32865/

qemu-img check disk.qcow2

ERROR OFLAG_COPIED data cluster: l2_entry=8cfdb0000 refcount=1

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

424996 leaked clusters were found on the image.
This means waste of disk space, but no harm to data.
524288/524288 = 100.00% allocated, 10.45% fragmented, 0.00% compressed clusters
Image end offset: 41744859136

If -r is specified, qemu-img tries to repair any inconsistencies found during the check. -r leaks repairs only cluster leaks, whereas -r all fixes all kinds of errors, with a higher risk of choosing the wrong fix or hiding corruption that has already occurred.

qemu-img check -r all disk.qcow2

Repairing OFLAG_COPIED data cluster: l2_entry=8000000885b30000 refcount=2
The following inconsistencies were found and repaired:

    424996 leaked clusters
    36838 corruptions

Double checking the fixed image now...
No errors were found on the image.
524288/524288 = 100.00% allocated, 10.45% fragmented, 0.00% compressed clusters
Image end offset: 41744859136

UWAGA! Lepiej zrobić najpierw opcję LEAKS, a potem w ostateczności ALL.

qemu-img check disk.qcow2

No errors were found on the image.
524288/524288 = 100.00% allocated, 10.45% fragmented, 0.00% compressed clusters
Image end offset: 41744859136

Link do manuala: https://www.qemu.org/documentation/

Categories
PORADY

Proxmox problem z Kernel Samepage Merging

Co jakiś czas jedna z wirtualek przestawała działać. Problemem okazał się KSM. Możliwe, że jakiś bug. Rozwiązanie problemu jest banalne. Wystarczy wyłączyć KSM.

systemctl disable ksmtuned

Poniżej wycinek z logów wirtualki.

Jan 29 10:21:20 plus kernel: kworker/0:0: page allocation failure: order:0, mode:0x310da
Jan 29 10:21:20 plus kernel: CPU: 0 PID: 25322 Comm: kworker/0:0 Not tainted 3.10.0-957.1.3.el7.x86_64 #1
Jan 29 10:21:20 plus kernel: Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.10.2-0-g5f4c7b1-prebuilt.qemu-project.org 04/01/2014
Jan 29 10:21:20 plus kernel: Workqueue: events_freezable update_balloon_size_func [virtio_balloon]
Jan 29 10:21:20 plus kernel: Call Trace:
Jan 29 10:21:20 plus kernel: [<ffffffffb8361e41>] dump_stack+0x19/0x1b
Jan 29 10:21:20 plus kernel: [<ffffffffb7dbcaa0>] warn_alloc_failed+0x110/0x180
Jan 29 10:21:20 plus kernel: [<ffffffffb835d44e>] __alloc_pages_slowpath+0x6b6/0x724
Jan 29 10:21:20 plus kernel: [<ffffffffb7dc1105>] __alloc_pages_nodemask+0x405/0x420
Jan 29 10:21:20 plus kernel: [<ffffffffb7e0df68>] alloc_pages_current+0x98/0x110
Jan 29 10:21:20 plus kernel: [<ffffffffb7e3dc55>] balloon_page_alloc+0x15/0x20
Jan 29 10:21:20 plus kernel: [<ffffffffc0475811>] update_balloon_size_func+0xb1/0x290 [virtio_balloon]
Jan 29 10:21:20 plus kernel: [<ffffffffb7cb9d4f>] process_one_work+0x17f/0x440
Jan 29 10:21:20 plus kernel: [<ffffffffb7cbade6>] worker_thread+0x126/0x3c0
Jan 29 10:21:20 plus kernel: [<ffffffffb7cbacc0>] ? manage_workers.isra.25+0x2a0/0x2a0
Jan 29 10:21:20 plus kernel: [<ffffffffb7cc1c31>] kthread+0xd1/0xe0
Jan 29 10:21:20 plus kernel: [<ffffffffb7cc1b60>] ? insert_kthread_work+0x40/0x40
Jan 29 10:21:20 plus kernel: [<ffffffffb8374c37>] ret_from_fork_nospec_begin+0x21/0x21
Jan 29 10:21:20 plus kernel: [<ffffffffb7cc1b60>] ? insert_kthread_work+0x40/0x40