how to restore a container from an old ssd?

Mam0n

New Member
Mar 14, 2023
9
1
3
I wonder if you could help

I had proxmox
My computer broke down, the motherboard burned out, proxmox was installed on the computer.

I installed proxmox on a new computer to a new ssd, but my old ssd was renamed to pve-OLD-B081029B during installation.

How to recover data from old ssd?
the old ssd had proxmox and a container with nextcloud installed
 
could you post the output of the following commands (in code tags):

Code:
pvs
vgs
lvs

thanks!
 
root@pve:~# pvs
PV VG Fmt Attr PSize PFree
/dev/sda3 pve lvm2 a-- <118.74g 14.75g
/dev/sdb3 pve-OLD-B081029B lvm2 a-- <446.63g 0

root@pve:~# vgs
VG #PV #LV #SN Attr VSize VFree
pve 1 5 0 wz--n- <118.74g 14.75g
pve-OLD-B081029B 1 2 0 wz--n- <446.63g 0

root@pve:~# lvs
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
data pve twi-aotz-- 54.64g 6.21 1.70
root pve -wi-ao---- 39.80g
swap pve -wi-ao---- <7.55g
vm-100-disk-0 pve Vwi-aotz-- 8.00g data 32.13
vm-105-disk-0 pve Vwi-a-tz-- 8.00g data 10.27
root pve-OLD-B081029B -wi-ao---- <438.63g
swap pve-OLD-B081029B -wi-a----- 8.00g
root@pve:~#
 
okay, so there is a 'root' LV on the old disk that might contain what you want. you should be able to mount that somewhere to access the data, e.g.:

Code:
mkdir /mnt/old_root
mount /dev/pve-OLD-B081029B/root /mnt/old_root
 
okay, so there is a 'root' LV on the old disk that might contain what you want. you should be able to mount that somewhere to access the data, e.g.:

Code:
mkdir /mnt/old_root
mount /dev/pve-OLD-B081029B/root /mnt/old_root
Code:
sdb                              8:16   0 447.1G  0 disk
├─sdb1                           8:17   0  1007K  0 part
├─sdb2                           8:18   0   512M  0 part
└─sdb3                           8:19   0 446.6G  0 part
  ├─pve--OLD--B081029B-swap    253:0    0     8G  0 lvm
  └─pve--OLD--B081029B-root    253:2    0 438.6G  0 lvm  /mnt/old_root
I have mounted it, but when I go to the
/mnt/old_root
I don't see nextcloud files there
 
I don't know how your old disk was configured - maybe take a look in /mnt/old_root/var/lib/vz ?
 
I don't know how your old disk was configured - maybe take a look in /mnt/old_root/var/lib/vz ?
it was the main drive, local (pve)
proxmox was installed on it and the nextcloud container was also on it
 
i did a search all over the disk but didn't find the nextcloud files at all, as if the container files are hidden for me

but i found /mnt/old_root/var/lib/vz/images/102/vm-102-disk-0.raw
400gb size

could this be my container?
 
Last edited:
that is a guest volume created for a guest with ID 102, so could be the rootfs of your nextcloud container.
 
I'd make a backup before doing any experiments, but if it is a regular container rootfs, it should just contain an ext4 filesystem and be mountable.
 
I'd make a backup before doing any experiments, but if it is a regular container rootfs, it should just contain an ext4 filesystem and be mountable.
could You explain in more detail, I'm a beginner and I don't understand what exactly to do
 
what do you want to achieve? do you want to restore some of the files in that volume? or do you want to re-create the container? do you have any backups of the container?
 
what do you want to achieve? do you want to restore some of the files in that volume? or do you want to re-create the container? do you have any backups of the container?
no, unfortunately I didn’t have time to make any backups, I just need to get files from there from the nextcloud folder.
 
then

Code:
mkdir /mnt/old_volume
mount /mnt/old_root/var/lib/vz/images/102/vm-102-disk-0.raw /mnt/old_volume

should do the trick - I'd still advices creating a backup copy of the .raw file before that!
 
  • Like
Reactions: Kingneutron
then

Code:
mkdir /mnt/old_volume
mount /mnt/old_root/var/lib/vz/images/102/vm-102-disk-0.raw /mnt/old_volume

should do the trick - I'd still advices creating a backup copy of the .raw file before that!
Fabian thank you so much! Everything turned out exactly as you suggested!
Thank you!!!
 
  • Like
Reactions: fabian
Sorry for adding my question to this.
I have a similar issue but I want to copy my old vm config files to my new instalation

my pve-OLD-xxxx/root is successfully mounted but I can not find any *.conf file in the folder
/mnt/oldroot/etc/pve

it is just empty

If I look in /mnt/oldroot/etc/lxc there is only a default.conf.

Where can I find my old conf files? Tje ZFS with the VM "HDDs" is already mounted succesfully.
 
I have no idea where the config files have been gone?
Can it be that the fresh installed NVMI deleted these config files?

Is it possible to extract the config file of an older vm/lxc backup?
 
you can extract the config from a backup ("pvesm extractconfig ...", also available on the UI). the contents of /etc/pve are in an sqlite DB in /var/lib/pve-cluster , you can also expose them in a live-cd/chroot by starting "pmxcfs -l" (inside the chroot)
 

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!