diff --git a/volumes/migrate-storage.md b/volumes/migrate-storage.md new file mode 100644 index 0000000..cb9a95e --- /dev/null +++ b/volumes/migrate-storage.md @@ -0,0 +1,43 @@ +# Migrate VM or LXC from one volume to another + +If you messed up and placed your VM or LXC on the wrong storage type, this will help for migrating to the correct storage. + +--- +## LXC volume migration + +For the sake of this example, we are using LXC vmid 205. + +Find the available storage name you want to migrate to first: +``` +pvesm status +``` + +Verify the name of the current volume the LXC is contained on: +``` +pct config 205 | grep rootfs +```` + +The output of my available volumes: +``` +root@pve:~# pvesm status +Name Type Status Total Used Available % +images dir active 121203372 93525632 21474812 77.16% +iso dir active 40195344 20347016 17774320 50.62% +local dir active 40195344 20347016 17774320 50.62% +local-lvm lvmthin active 55832576 0 55832576 0.00% +nvme lvmthin active 3873329152 1028756222 2844572929 26.56% +pi2 cifs active 13563452384 1357229972 12206222412 10.01% +smb cifs active 6188571648 860594176 5327977472 13.91% +``` + +Once you verify the lvmthin volume, in this case `nvme`, begin the migration: + +``` +pct shutdown 205 +pct move-volume 205 rootfs nvme +pct start 205 +``` + +1. Shutdown the container +2. Move the container volume to the new lvmthin storage device +3. Start the container \ No newline at end of file