1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
|
qcow2 - filesize 8.1Petabyte
problem :
Filesystem Size Used Avail Use% Mounted on
/dev/sdd1 120G 63G 57G 53% /storage/kvmstorage4ssd
# pwd
/storage/kvmstorage4ssd/images
# qemu-img info vsys19_ssd1.qcow2
image: vsys19_ssd1.qcow2
file format: qcow2
virtual size: 20G (21474836480 bytes)
disk size: 11G
cluster_size: 65536
Format specific information:
compat: 1.1
lazy refcounts: true
refcount bits: 16
corrupt: true
# ls -lah vsys19_*
-rw------- 1 root root 8.1P Nov 4 13:16 vsys19_ssd1.qcow2
# ls -la vsys19_*
-rw------- 1 root root 9007203702079488 Nov 4 13:16 vsys19_ssd1.qcow2
# qemu-img check vsys19_ssd1.qcow2
qemu-img: Check failed: File too large
# xfs_repair /dev/sdd1
Phase 1 - find and verify superblock...
Phase 2 - using internal log
- zero log...
- scan filesystem freespace and inode maps...
- found root inode chunk
Phase 3 - for each AG...
- scan and clear agi unlinked lists...
- process known inodes and perform inode discovery...
- agno = 0
- agno = 1
- agno = 2
- agno = 3
- process newly discovered inodes...
Phase 4 - check for duplicate blocks...
- setting up duplicate extent list...
- check for inodes claiming duplicate blocks...
- agno = 0
- agno = 1
- agno = 2
- agno = 3
Phase 5 - rebuild AG headers and trees...
- reset superblock...
Phase 6 - check inode connectivity...
- resetting contents of realtime bitmap and summary inodes
- traversing filesystem ...
- traversal finished ...
- moving disconnected inodes to lost+found ...
Phase 7 - verify and correct link counts...
done
# pwd
/storage/kvmstorage4ssd/images
<disk type='file' device='disk'>
<driver name='qemu' type='qcow2'/>
<source file='/storage/kvmstorage4ssd/images/vsys19_ssd1.qcow2'/>
<target dev='vdn' bus='virtio'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x0f' function='0x0'/>
</disk>
guest OS:
# uname -a
Linux vsys19 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt11-1 (2015-05-24) x86_64 GNU/Linux
cat /etc/debian_version
stretch/sid
Nov 4 01:23:26 vsys19 kernel: [7654313.024844] end_request: I/O error, dev vdk, sector 8691272
Nov 4 01:23:26 vsys19 kernel: [7654313.025328] EXT4-fs warning (device dm-1): ext4_end_bio:317: I/O error -5 writing to inode 262305 (offset 0 size 4202496 s
tarting block 1085897)
Nov 4 01:23:26 vsys19 kernel: [7654313.025334] Buffer I/O error on device dm-1, logical block 1085897
Nov 4 01:23:26 vsys19 kernel: [7654313.025488] Buffer I/O error on device dm-1, logical block 1085898
Nov 4 01:23:26 vsys19 kernel: [7654313.025632] Buffer I/O error on device dm-1, logical block 1085899
Nov 4 01:23:26 vsys19 kernel: [7654313.025776] Buffer I/O error on device dm-1, logical block 1085900
Nov 4 01:23:26 vsys19 kernel: [7654313.025920] Buffer I/O error on device dm-1, logical block 1085901
Nov 4 01:23:26 vsys19 kernel: [7654313.026064] Buffer I/O error on device dm-1, logical block 1085902
Nov 4 01:23:26 vsys19 kernel: [7654313.026207] Buffer I/O error on device dm-1, logical block 1085903
Nov 4 01:23:26 vsys19 kernel: [7654313.026350] Buffer I/O error on device dm-1, logical block 1085904
Nov 4 01:23:26 vsys19 kernel: [7654313.026500] Buffer I/O error on device dm-1, logical block 1085905
Nov 4 01:23:26 vsys19 kernel: [7654313.028837] Buffer I/O error on device dm-1, logical block 1085906
Nov 4 01:23:26 vsys19 kernel: [7654313.031122] end_request: I/O error, dev vdk, sector 8692280
Nov 4 01:23:26 vsys19 kernel: [7654313.031325] EXT4-fs warning (device dm-1): ext4_end_bio:317: I/O error -5 writing to inode 262305 (offset 0 size 4202496 starting block 1086023)
Nov 4 01:23:26 vsys19 kernel: [7654313.031388] end_request: I/O error, dev vdk, sector 8693288
Nov 4 01:23:26 vsys19 kernel: [7654313.031527] EXT4-fs warning (device dm-1): ext4_end_bio:317: I/O error -5 writing to inode 262305 (offset 0 size 4202496 starting block 1086149)
Nov 4 01:23:26 vsys19 kernel: [7654313.031598] end_request: I/O error, dev vdk, sector 8694296
Nov 4 01:23:26 vsys19 kernel: [7654313.031736] EXT4-fs warning (device dm-1): ext4_end_bio:317: I/O error -5 writing to inode 262305 (offset 0 size 4202496 starting block 1086275)
Nov 4 01:23:26 vsys19 kernel: [7654313.031798] end_request: I/O error, dev vdk, sector 8695304
Nov 4 01:23:26 vsys19 kernel: [7654313.031933] EXT4-fs warning (device dm-1): ext4_end_bio:317: I/O error -5 writing to inode 262305 (offset 0 size 4202496 starting block 1086401)
KVM host :
# cat /etc/debian_version
stretch/sid
Debian
# uname -a
Linux asus1 4.5.5-custom #1 SMP Sun May 22 21:14:57 CEST 2016 x86_64 GNU/Linux
# dpkg -l | grep -i qemu
ii ipxe-qemu 1.0.0+git-20150424.a25a16d-1 all PXE boot firmware - ROM images for qemu
ii qemu 1:2.5+dfsg-5+b1 amd64 fast processor emulator
ii qemu-kvm 1:2.5+dfsg-5+b1 amd64 QEMU Full virtualization on x86 hardware
ii qemu-slof 20151103+dfsg-2 all Slimline Open Firmware -- QEMU PowerPC version
ii qemu-system 1:2.5+dfsg-5+b1 amd64 QEMU full system emulation binaries
ii qemu-system-arm 1:2.5+dfsg-5+b1 amd64 QEMU full system emulation binaries (arm)
ii qemu-system-common 1:2.5+dfsg-5+b1 amd64 QEMU full system emulation binaries (common files)
ii qemu-system-mips 1:2.5+dfsg-5+b1 amd64 QEMU full system emulation binaries (mips)
ii qemu-system-misc 1:2.5+dfsg-5+b1 amd64 QEMU full system emulation binaries (miscelaneous)
ii qemu-system-ppc 1:2.5+dfsg-5+b1 amd64 QEMU full system emulation binaries (ppc)
ii qemu-system-sparc 1:2.5+dfsg-5+b1 amd64 QEMU full system emulation binaries (sparc)
ii qemu-system-x86 1:2.5+dfsg-5+b1 amd64 QEMU full system emulation binaries (x86)
ii qemu-user 1:2.5+dfsg-5+b1 amd64 QEMU user mode emulation binaries
ii qemu-user-binfmt 1:2.5+dfsg-5+b1 amd64 QEMU user mode binfmt registration for qemu-user
ii qemu-utils 1:2.5+dfsg-5+b1 amd64 QEMU utilities
ii qemubuilder 0.80 amd64 pbuilder using QEMU as backend
thereis any chance to fix this qcow2 image?
Seems like you are using the QEMU from your Linux distribution (Debian?). If you want to have support for that version, you should use the bug tracker from your distro instead. Otherwise, can you please try again with the latest version from http://wiki.qemu-project.org/Download to see whether the bug is already fixed there? Thanks!
Hi,
I don't know how you got that image in that state and thus I won't consider this a bug report (there are ways to break qcow2 images which aren't caused by bugs in qemu), but regarding your question to save the data on the image, have you tried qemu-img convert to copy the image's contents to a new file? Since qemu-img info can still read the file, qemu-img convert should be able to do the same.
Max
# qemu-img convert -f qcow2 -O qcow2 vsys19_ssd1.qcow2 1.qcow2
qcow2: Image is corrupt: Data cluster offset 0x10001091b0400 unaligned (L2 offset: 0x1000e0000, L2 index: 0x90c); further non-fatal corruption events will be suppressed
Well, that's too bad. At least it's non-fatal, which means that qemu will only refuse to read that single cluster (still, it will stop convert from working because that requires the whole image to be readable).
So another idea would be to use qemu-nbd and the nbd kernel module to bind the image to a block device under /dev and then use dd to copy as much data off as possible; or to use qemu-img dd which will be part of qemu 2.8 (it only has a subset of dd's functionality, but it does support skip and count, so it's enough to copy around the corrupted clusters).
Apart from that, we do want to improve qemu-img check in the future so that it can repair more types of corruption (such as the one you're facing), but it's not yet being worked on.
Max
[Expired for QEMU because there has been no activity for 60 days.]
|