Restore destroyed CT subvolume on ZFS

mproxk

Member
Jun 2, 2019
12
1
8
39
I did a restore of a CT that uses also a mount point. There is a warning but I did not expect that it will touch the mount point. After CT restore, the subvolume is destroyed.

Code:
zpool history data2 -il



2022-07-04.15:53:54 [txg:9806] destroy data2/subvol-121-disk-0 (165) (bptree, mintxg=1) [on silver]
2022-07-04.15:54:02 zfs destroy -r data2/subvol-121-disk-0 [user 0 (root) on silver:linux]
2022-07-04.16:30:22 [txg:10215] scan setup func=1 mintxg=0 maxtxg=10215 [on silver]
2022-07-04.16:30:37 zpool scrub data2 [user 0 (root) on silver:linux]



I want data2/subvol-121-disk-0 back.

There is something like "using special zpool import with -T option" but not sure how to use it

I run a scrub manually at the end.
 

Pifouney

Member
Oct 17, 2021
105
6
18
33
Hi,

zfs destroy cannot be cancelled .... if you haven't backup, sorry to say that it's dead :(
 

leesteken

Famous Member
May 31, 2020
1,740
354
88
ZFS is Copy-on-Write, so it might be possible (by using -T to select an older version of the filesystem). If you have written to the filesystem afterwards, it becomes more unlikely to be recoverable. I'm sorry but I have no experience with it and I don't know how to use the -T option.
EDIT: If nobody knows how to do it here, you might want to try a ZFS or *BSD (FreeBSD has support ZFS for a longer time) mailinglist or forum.
 
Last edited:

mproxk

Member
Jun 2, 2019
12
1
8
39
I tried but nothing is happening, no writes after that, just scrub.

I was scared that after I did "move" instead of copy the subvolume from ZFS disk without compression to a ZFS disk with compression, that the free space went from 4GB to 90GB.

But the volume function fine and no corrupted files, I will do file compare from a backup later.
 

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 your own in 60 seconds.

Buy now!