Qcow2 image read only

Frédéric SPIERS

New Member
Nov 7, 2018
5
0
1
35
Hi everybody,

I have a problem with one of my VM which is a OpenMediaVault NAS distribution. 2 logical HDD are attached to this VM (2x 3TB WD Caviar Red) as qcow2 images inside proxmox.
This morning, after rebooting my VM, I couldn't start it anymore since Proxmox told me that HDD1 qcow2 image is set as read only access.

Code:
kvm: -drive file=/mnt/HDD1/images/104/vm-104-disk-1.qcow2,if=none,id=drive-virtio1,format=qcow2,cache=none,aio=native,detect-zeroes=on: Could not open '/mnt/HDD1/images/104/vm-104-disk-1.qcow2': Read-only file system
TASK ERROR: start failed: command '/usr/bin/kvm -id 104 -name OMV4deb9 -chardev 'socket,id=qmp,path=/var/run/qemu-server/104.qmp,server,nowait' -mon 'chardev=qmp,mode=control' -chardev 'socket,id=qmp-event,path=/var/run/qemu-server/104-event.qmp,server,nowait' -mon 'chardev=qmp-event,mode=control' -pidfile /var/run/qemu-server/104.pid -daemonize -smbios 'type=1,uuid=481fa223-045e-4e3e-8020-24463523ace6' -smp '2,sockets=1,cores=2,maxcpus=2' -nodefaults -boot 'menu=on,strict=on,reboot-timeout=1000,splash=/usr/share/qemu-server/bootsplash.jpg' -vga std -vnc unix:/var/run/qemu-server/104.vnc,x509,password -cpu kvm64,+lahf_lm,+sep,+kvm_pv_unhalt,+kvm_pv_eoi,enforce -m 2048 -device 'pci-bridge,id=pci.2,chassis_nr=2,bus=pci.0,addr=0x1f' -device 'pci-bridge,id=pci.1,chassis_nr=1,bus=pci.0,addr=0x1e' -device 'piix3-usb-uhci,id=uhci,bus=pci.0,addr=0x1.0x2' -device 'usb-tablet,id=tablet,bus=uhci.0,port=1' -device 'virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3' -iscsi 'initiator-name=iqn.1993-08.org.debian:01:46ebb72cdfc6' -drive 'file=/var/lib/vz/template/iso/debian-9.1.0-amd64-netinst.iso,if=none,id=drive-ide2,media=cdrom,aio=threads' -device 'ide-cd,bus=ide.1,unit=0,drive=drive-ide2,id=ide2,bootindex=200' -drive 'file=/dev/pve/vm-104-disk-1,if=none,id=drive-virtio0,format=raw,cache=none,aio=native,detect-zeroes=on' -device 'virtio-blk-pci,drive=drive-virtio0,id=virtio0,bus=pci.0,addr=0xa,bootindex=100' -drive 'file=/mnt/HDD1/images/104/vm-104-disk-1.qcow2,if=none,id=drive-virtio1,format=qcow2,cache=none,aio=native,detect-zeroes=on' -device 'virtio-blk-pci,drive=drive-virtio1,id=virtio1,bus=pci.0,addr=0xb' -drive 'file=/mnt/HDD2/images/104/vm-104-disk-1.qcow2,if=none,id=drive-virtio2,format=qcow2,cache=none,aio=native,detect-zeroes=on' -device 'virtio-blk-pci,drive=drive-virtio2,id=virtio2,bus=pci.0,addr=0xc' -netdev 'type=tap,id=net0,ifname=tap104i0,script=/var/lib/qemu-server/pve-bridge,downscript=/var/lib/qemu-server/pve-bridgedown,vhost=on' -device 'virtio-net-pci,mac=0A:DA:5B:0C:35:BF,netdev=net0,bus=pci.0,addr=0x12,id=net0,bootindex=300'' failed: exit code 1

I don't really know what to do with this error... I don't want to delete that qcow2 image since there are a lot of files in it. I'd like to be able to re-attach this image and boot properly.

Please help me :p
 
the error message says the filesystem is read only, i would check what is going on with your mountpoint /mnt/HDD1 (broken disk maybe?)
 
Yes, this is what I am afraid of. But unfortunately, I am far from my server. Server is in France and I am currently in UAE for business untill February. Do you a way to check if my disk is broken or not ?
 
* Usually a broken disk shows up in the `dmesg` output.
* You could also check the smartstats using `smartctl` (the manpage explains it quite well) and run a smart self-test
 
Indeed, dmesg command executed on my Proxmox server shows problems with /dev/sdb partition. /dev/sdb is one actually one of my WD caviar red 3TB disk.

dmesg proxmox.PNG
 
Looks like the disk indeed is dying - try getting a new one connected (via remote hands/somebody with physical access to the server) and try getting your data save - depending on the gravity of the problem I'd try rsync (filesystem still mounted and you don't get too many errors), dd (probably will result in an error ), ddrescue (tries continuing after an error occurred).
 
Ok thank you for advices. I am currently saving the qcow2 image to another drive and I will ask somebody to access the server and change the hard drive.
Is it easy to re-map the qcow2 image to a new VM by the way ?
 
You could rename the qcow2 on the storage to have the correct id, and adapt that in the new vms config, or (probably easier) - just use:
`qm importdisk` (see `man qm`)

Hope that helps - and good luck with the recovery!
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!