Use old Proxmox disk as Storage for new installation

fabri01

New Member
Nov 3, 2023
6
0
1
Hi, I've reinstalled Proxmox VE 8.3 on a new SSD (250GB).
Before this, I had Proxmox installed on a 1TB hard disk. This hard disk contained both the operating system and all the VM and container images. The previous installation was done via debian and the disk had an ext4 partition. Now I would like to be able to access the VMs that I had on the other disk. The idea is to mount the disk and access the VM disks. I followed a guide found here on the forum: I tried to mount the disk with fstab and then add it as storage from the WebUI and finally run pvesm set YourStorageID --is_mountpoint yes. Now in the WebUI I see the storage but I don't see any VM Disk.

Can anyone help me? I would like to use the VMs of the old disk without having to migrate or backup, is it possible?
Thanks

Code:
lsblk: the old disk is sdb2
NAME                            MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
sda                               8:0    0 223.6G  0 disk
├─sda1                            8:1    0  1007K  0 part
├─sda2                            8:2    0     1G  0 part
└─sda3                            8:3    0 222.6G  0 part
  ├─pve-swap                    252:0    0     8G  0 lvm  [SWAP]
  ├─pve-root                    252:1    0  65.6G  0 lvm  /
  ├─pve-data_tmeta              252:2    0   1.3G  0 lvm 
  │ └─pve-data-tpool            252:4    0 130.3G  0 lvm 
  │   ├─pve-data                252:5    0 130.3G  1 lvm 
  │   ├─pve-vm--100--disk--0    252:6    0     1G  0 lvm 
  │   ├─pve-vm--101--disk--0    252:7    0     8G  0 lvm 
  │   ├─pve-vm--9000--disk--0   252:8    0     8G  0 lvm 
  │   ├─pve-vm--9000--cloudinit 252:9    0     4M  0 lvm 
  │   ├─pve-vm--1000--disk--0   252:10   0     8G  0 lvm 
  │   ├─pve-vm--1000--cloudinit 252:11   0     4M  0 lvm 
  │   ├─pve-vm--1001--disk--0   252:12   0    12G  0 lvm 
  │   ├─pve-vm--1001--cloudinit 252:13   0     4M  0 lvm 
  │   ├─pve-vm--102--disk--0    252:14   0     4G  0 lvm 
  │   └─pve-vm--103--disk--0    252:15   0     5G  0 lvm 
  └─pve-data_tdata              252:3    0 130.3G  0 lvm 
    └─pve-data-tpool            252:4    0 130.3G  0 lvm 
      ├─pve-data                252:5    0 130.3G  1 lvm 
      ├─pve-vm--100--disk--0    252:6    0     1G  0 lvm 
      ├─pve-vm--101--disk--0    252:7    0     8G  0 lvm 
      ├─pve-vm--9000--disk--0   252:8    0     8G  0 lvm 
      ├─pve-vm--9000--cloudinit 252:9    0     4M  0 lvm 
      ├─pve-vm--1000--disk--0   252:10   0     8G  0 lvm 
      ├─pve-vm--1000--cloudinit 252:11   0     4M  0 lvm 
      ├─pve-vm--1001--disk--0   252:12   0    12G  0 lvm 
      ├─pve-vm--1001--cloudinit 252:13   0     4M  0 lvm 
      ├─pve-vm--102--disk--0    252:14   0     4G  0 lvm 
      └─pve-vm--103--disk--0    252:15   0     5G  0 lvm 
sdb                               8:16   0 931.5G  0 disk
├─sdb1                            8:17   0   512M  0 part
├─sdb2                            8:18   0 930.1G  0 part /mnt/old-disk
└─sdb3                            8:19   0   977M  0 part


storage.cfg on new installation
dir: local
    path /var/lib/vz
    content backup,vztmpl,iso

lvmthin: local-lvm
    thinpool data
    vgname pve
    content rootdir,images

dir: old
    path /mnt/old-disk
    content images,rootdir
    is_mountpoint yes
    prune-backups keep-all=1
    shared 0
 
You also need the VM configuration files which are in the /etc/pve/qemu-server (or /etc/pve/lxc) directories of your old installation. However, you can only access those files when you boot the old installation (since they are not actually files but in a database).
You need to copy the VM/container configuration files (from the old installation) to the new /etc/pve/qemu-server (or /etc/pve/lxc) directories (which you can only access when booting the new installation) and edit them manually to use the old storage.
 
  • Like
Reactions: fabri01
You also need the VM configuration files which are in the /etc/pve/qemu-server (or /etc/pve/lxc) directories of your old installation. However, you can only access those files when you boot the old installation (since they are not actually files but in a database).
You need to copy the VM/container configuration files (from the old installation) to the new /etc/pve/qemu-server (or /etc/pve/lxc) directories (which you can only access when booting the new installation) and edit them manually to use the old storage.
Ok, I will try. Now I've changed the storage.cfg and I can see all VM Disk and CT volumes on the WebUI, but I don't know how to use them

Code:
dir: local
    path /var/lib/vz
    content iso,backup,vztmpl

lvmthin: local-lvm
    thinpool data
    vgname pve
    content rootdir,images

dir: HDD
    path /mnt/old-disk/var/lib/vz
    content import,snippets,iso,backup,vztmpl,images,rootdir
    prune-backups keep-all=1
    shared 0
 
Ok, I will try. Now I've changed the storage.cfg and I can see all VM Disk and CT volumes on the WebUI, but I don't know how to use them
A VM consists of virtual disks and a configuration file. You need to copy the configurations files from the old installation to the new installation (which I wrote in the post you replied to).

For example: boot the old Proxmox installation and copy the files in /etc/pve/qemu-server/ and /etc/pve/lxc/ to /var/lib/vz/ (in the old installation). Then boot the new Proxmxo installation and copy the configuration files from /mnt/old-disk/var/lib/vz/ to the corresponding locations in /etc/pve/qemu-server/ and /etc/pve/lxc/ (in the new installation).
 
  • Like
Reactions: fabri01
A VM consists of virtual disks and a configuration file. You need to copy the configurations files from the old installation to the new installation (which I wrote in the post you replied to).

For example: boot the old Proxmox installation and copy the files in /etc/pve/qemu-server/ and /etc/pve/lxc/ to /var/lib/vz/ (in the old installation). Then boot the new Proxmxo installation and copy the configuration files from /mnt/old-disk/var/lib/vz/ to the corresponding locations in /etc/pve/qemu-server/ and /etc/pve/lxc/ (in the new installation).
Thanks, this worked!
Is it possible to delete old Proxmox OS installation from the disk in order to use it only as Storage without wiping the disk?
 
Is it possible to delete old Proxmox OS installation from the disk in order to use it only as Storage without wiping the disk?
You can delete all other files if you like. But would it not be easier to first move all the virtual disks that are stored there to the new storage (Disk Action > Move Storage) in the Proxmox web GUI) and then just reformat the drive with the storage type that you want?
 
You can delete all other files if you like. But would it not be easier to first move all the virtual disks that are stored there to the new storage (Disk Action > Move Storage) in the Proxmox web GUI) and then just reformat the drive with the storage type that you want?
No, the problem is that the new SSD is only 200GB while the old HDD is 1TB.
 
Can you still attach the old disk (on a sata port or maybe via an external usb enclosure)? I think the easiest variant would have been to boot one last time from the old disk, backup all vms with the native backup to vzdumps, reboot with the new disk and restore the vms from the backup.
 

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!