Duplicate a dying SSD (LVM-Thin) drive with new identical SSD

Jan 24, 2022
3
0
1
52
Hello,

I've inherited a ProxMox server. It currently has approximately 10 VM's running on it. But I got an alert that one of the SSD drives (only two in the entire server) that houses the VM's is dying. So I bought a brand new SSD same size same make model, everything. But currently I have it connected to the server using USB. My question, is there a way I can replicate or duplicate the old SSD and copy all of that data (vm's) to the new drive. I don't know how to format the new drive or anything, I am a noob, sorry. Was hoping to use Clonezilla but that didn't work, not sure how the old drive is formatted, but could clone it. Was hoping that maybe there is a linux command I could use? Any help would be greatly appreciated. Thanks, Bill
 
Caution: data loss is possible if you execute procedure incorrectly. If you are not confident in success and this is a valuable environment, I recommend reaching out to a consultant.

Based only on the information you provided, the high level approach would be to:
- stop all VMs
- stop proxmox services:
systemctl stop pvedaemon
systemctl stop pveproxy
systemctl stop pvestatd
- unmount the disk (it should not be mounted)
- use "dd" to copy the context of the disk. The most basic command line: dd if=/dev/INPUTBADDEVICE of=/dev/NEWDEVICEONUSB bs=8k
- shutdown the server, remove old disk, connect the new one.
- boot the server.

References:
https://linuxhint.com/clone-disk-using-dd-linux/
https://www.cyberciti.biz/faq/linux-mount-an-lvm-volume-partition-command/

Good luck


Ultra low latency all-NVME shared storage for Proxmox - https://www.blockbridge.com/proxmox
 
  • Like
Reactions: btodd71
If that SSD is just a normal disk without raid, not used for booting or something like that and it is only storing VMs/LXCs I think the easiet would be to create new LVM-Thin storage on the new SSD and then just move the VMs/LXCs from the old to the new storage. Both can be done in webUI.
 
Last edited:
If that SSD is just storing VMs/LXCs and isn't for example used for boot the I think the easiet would be to create new LVM-Thin storage on the new SSD and then just move the VMs/LXCs from the old to the new storage. Both can be done in webUI.
how hard is it to just create lvm-thin storage? Because yeah, probably just move those VM's if that is pretty easy?
 
Its just clicking buttons in the webUI.
YourNode -> Disks –> select your new Disk –> Wipe (this will delete everything on that disk so make sure to wipe the correct one). I think wiping disks is a new PVE7 feature. If you are running a older version you might need to manually remove all existing partitions on your new disk first (fdisk, wipefs or parted can be used in CLI for that). Then YourNode -> Disks -> LVM-Thin –> Create Thin Pool. Select your new wiped disk there.
After that you should have a new LVM-Thin Storage on the new Disk. And when selecting YourNode -> YourVM -> Hardware there should be a Move disk button which you can use to move the virtual disks from the old storage to your new LVM-Thin storage.
 
Last edited:
If that SSD is just a normal disk without raid, not used for booting or something like that and it is only storing VMs/LXCs I think the easiet would be to create new LVM-Thin storage on the new SSD and then just move the VMs/LXCs from the old to the new storage. Both can be done in webUI.
Unless OP plans to stay on a disk connected to USB, they still need to open up the server and replace the disk. Either method is valid, however I think the "migration" one also depends on the version of PVE that OP inherited. Not all options could be available.
As usual, there are a lot of variables.


Ultra low latency all-NVME shared storage for Proxmox - https://www.blockbridge.com/proxmox
 
Currently we are running 6.4-13 so not sure the WebGUI has all of those features. I may just look into using DD method. But had wanted to try something possibly easier. :)
 

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!