[SOLVED] Messed up migration to new SSD

tombond

New Member
Jun 28, 2023
12
2
3
Hi, tbh. I still don't know at which point I messed up but this is my current situation:

I had a 250GB SATA SSD on which I had several LXC's and VM's. Because I ran out of storage I bought a 1TB M.2 SSD and installed it next to the SATA SSD. My plan was to install Proxmox on the new M.2 and then migrate everything over from the other drive.

Since I had both drives connected during the installation I guess I must have messed something up because now I can boot the new Proxmox installation but I have no idea how to access the data on the old drive. If I disconnect the M.2 and just boot from the SATA it can see the data but then it tells "gave up waiting for root file system device" and shows an initramfs prompt.

I had remote backups of some of my containers and I was able to restore them perfectly fine but I am still missing some lesser used containers and VMs I would still like to recover.

Is there a way how I can either mount my old drive so that I can access the data from within the new installation? Or can I somehow repair the old installation so that I can boot without the M.2, create some additional backups and then go back to the new drive?

PS: As you can see below, during the new installation it renamed my old pve to pve-OLD-D6EE7AA4 but it can still see the drive and its partitions.
PPS: I have tried to mount the drives using kpartx (https://ronamosa.io/docs/engineer/LAB/proxmox-lvm-mount/) but that didn't work either. I ran the command but nothing happened.


1727632479454.png

1727632485531.png
 
Ok so I think I solved it myself for the biggest part.

I did two things:

For LXC using local data storage (e.g. config files) I mounted the old partition (mount /dev/mapper/XYZ /mnt), copied the files to my local computer, unmounted (umount /mnt), mounted the partition of the new LXC and copied the files back. Sounds simple but as I was saying before, kpartx wasn't working as I expected. It took me some time to realize that it didn't work because the drives were already mapped and I just had to mount them...

For LXC using a database I realized that I could mount the entire LVM-Thin in the Datacenter/Storage menu, so I called it "old-lvm". I could then open the conf file of the respective LXC (in /etc/pve/lxc) and change the path of the rootfs from "local-lvm" to "old-lvm". After I rebooted the LXC the data was available again and so I could tell Proxmox to create a regular Backup. Then I removed the LXC and restored the backup to the local-lvm again. Now I have my old data on my new drive.
 
Last edited:
  • Like
Reactions: waltar

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!