Recovering fdisk Formatted Drive and Running LXC

CalebSnell

Member
Jul 17, 2020
45
2
13
26
Hello everyone,

I was attempting to format a couple of unused ZFS drives by using fdisk (g then w), and just like it warns you not to, I wrote a blank GPT partition to the drive that stores my LXC images. This drive was originally partitioned with LVM, and all that seems to be intact. I only have one container that I care about, and thankfully it's still running with all the data accessible. What can I do to get this container back into a state where shutting it down won't delete all my data?

Some more information. Running "lsof | grep deleted" yields the following results:
Code:
root@mercury:~# lsof | grep deleted
none         929                              root  txt       REG                0,1    16840      30261 / (deleted)
lxc-start   1240                              root   14u      REG              253,0        0         13 /var/lib/lxc/100/rootfs/.lxc-keep (deleted)
smbd        1972                              root    2w      REG              253,0  1049107     524754 /var/log/samba/samba.log.old (deleted)
smbd        1972                              root    9w      REG              253,0  1049107     524754 /var/log/samba/samba.log.old (deleted)
cleanupd    1974                              root    2w      REG              253,0  1046790     525899 /var/log/samba/samba.log.old (deleted)
cleanupd    1974                              root   22w      REG              253,0  1046790     525899 /var/log/samba/samba.log.old (deleted)

Please let me know what additional information is needed. I've done some research but it seems to be meant for KVM VMs, so I wanted to see if there was a way specifically for LXC.

Thanks!
Caleb
 
After some more research I found some information about recovering the old partition by using Testdisk. Is that something anyone has used before?

The container is still running, so its seeming like it might be better to try recovering the disk image some way before trying to repair the partition. Let me know if more info would be helpful.

Thanks!
 

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!