Where are my zfs volumes?

ChrisRedz

New Member
Dec 4, 2020
15
0
1
37
ZFS LIST will return the below but when I go the directory only subvolumes are present. Where are the vm disks?

1623957085173.png
 
Virtual disks are zvols (= block storage) and not filesystems like datasets. These aren't any files/folders you can browse because they are not part of any filesystem. If you want to manipulate them you need to do it with the zfs command.
 
Last edited:
Virtual disks are zvols (= block storage) and not filesystems like datasets. These aren't any files/folders you can browse.
For some reason the VM got corrupted and I was trying to see if I can mount it somewhere to recover the data

1623957514631.png

What can I do in this situation?
 
First I would check if your pool is healthy (zpool status). Next I would run a scrub so ZFS will check all data and search for corruptions (zpool scrub rpool).
Run zpool status again after scrub has finished to see if it encountered any errors. If your pool is a mirror or raidz it will be automatically repaired. If it is just a single disk/stripe or you aren't using ECC RAM ZFS can't do anything to repair it. In that case you might want to create a backup first (zfs send command or PVEs vzdump). You can move zvols by using "zfs send | zfs receive". I would only work with the copy to rescue stuff so you don't do more harm to the zvol.
 
Last edited:
First I would check if your pool is healthy (zpool status). Next I would run a scrub so ZFS will check all data and search for corruptions (zpool scrub rpool).
Run zpool status again after scrub has finished to see if it encountered any errors. If your pool is a mirror or raidz it will be automatically repaired. If it is just a single disk/stripe or you aren't using ECC RAM ZFS can't do anything to repair it. In that case you might want to create a backup first (zfs send command or PVEs vzdump). You can move zvols by using "zfs send | zfs receive". I would only work with the copy to rescue stuff so you don't do more harm to the zvol.
Done it with no errors... I am pretty desperate to get the data back from that machine and it got corrupted after a reboot

1623958209081.png
 
Scrub in process. 272 hours to go.
You need to wait some hours/days for the scrub to finish. Only after that you will see if there are errors found.
 
Last edited:
You can move zvols by using "zfs send | zfs receive". I would only work with the copy to rescue stuff so you don't do more harm to the zvol. Do you mean I could create a volume and mount it to extract data? Please laborate and THANKS A MILLION!
 
Do you mean I could create a volume and mount it to extract data? Please laborate and THANKS A MILLION!
A zvol is a block device like physical harddisk. So you can't mount a zvol but use it as a device to mount the partitions and its filesystems that are stored on that zvol. You could for example create a new VM, add a new zvol with the same size, use dd to copy everything on block level from the old zvol to the new zvol, start the VM and try to mount it there.
 
A zvol is a block device like physical harddisk. So you can't mount a zvol but use it as a device to mount the partitions and its filesystems that are stored on that zvol. You could for example create a new VM, add a new zvol with the same size, use dd to copy everything on block level from the old zvol to the new zvol, start the VM and try to mount it there.
So if I understood correctly:

1- Create VM
2- Create new zvol
3- dd if=/dev/zvol/almacen/vm-108-disk-0 of=newzvol
4- Mount new zvol to new VM

Is that right?
 
Yeah that way you shouldn't destroy stuff while doing stuff to rescue data from that zvol.

Another option would be to create a backup of the VM (PVE buildin backup functionality) and restore that backup but with another VMID (so that you basically get a second copy of that VM instead of replacing the old VM). Then you can upload a Live Linux ISO and insert it into the virtual CD drive of that copied VM, boot from the Live CD and try to mount that virtual HDD.
 
Whats the lsblk and fdisk -l output inside the VM? Did you really tried to mount the right partition with the right filesystem you setup the original VM with?
 
root@pm1:~# dd if=/dev/zvol/almacen/vm-108-disk-0 of=/dev/zvol/almacen/vm-155-disk-2
67108864+0 registros leídos
67108864+0 registros escritos
34359738368 bytes (34 GB, 32 GiB) copied, 646,636 s, 53,1 MB/s

The disk is sbd but doesn show any partition

1623967544894.png1623967934710.png
 

Attachments

  • 1623967603321.png
    1623967603321.png
    15.6 KB · Views: 8
Last edited:

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!