LVM questions

spacefighter

Member
Mar 24, 2011
14
0
21
I have a basic home setup and am going to swap out a few hard drives (1TB’s) used for media and file backup for a single larger disk (8TB). Before I have always passed the disks through to Win VMs, logic being if lost the Proxmox OS I could just boot the disks up in another windows box and be good. It’s not my only backups or for production so it worked well for me.

Moving to the larger single disk I would create a LVM and create a storage disk for each VM form that. Is that the best method?

My question is if something was to happen, crash or accidental delete of the VM can I reassign that data storage to a new vm and find my files? Can I physically move the disk to a new Proxmox install and recover it somewhat easily?

Sorry I only have a basic understanding of how it all works. Just don’t want to create a bigger problem down the road.

Thanks!
 
Hi,

Proxmox VE creates the LV (Logical Volumes) for you.
The naming schema is "vm-<VMID>-disk-<Disk NO>"
There are two pitfalls with reassignment.
First, if you destroy a VM, all disk will also be destroyed.
Second, you have to rename the LV to use it in another VM.
Theoretically, you can use it without renaming but this will make trouble if a VM is created with the same VMID as the disk has.

Or you create the LV by your self and must manage it self.
 
Hi,

Proxmox VE creates the LV (Logical Volumes) for you.
The naming schema is "vm-<VMID>-disk-<Disk NO>"
There are two pitfalls with reassignment.
First, if you destroy a VM, all disk will also be destroyed.
Second, you have to rename the LV to use it in another VM.
Theoretically, you can use it without renaming but this will make trouble if a VM is created with the same VMID as the disk has.

Or you create the LV by your self and must manage it self.

Hi !

On the topic of naming,
Is it possible to create LV with arbitrary names ( eg: "my-precious-data.raw) and attach/detach them to vm or lxc mountpoint ?
e.g.: keep a 2nd volume for data and being able to move it from VM to VM ?

Thanks in advance ,
EC
 
Hi Etienne Charlier,

Is it possible to create LV with arbitrary names ( eg: "my-precious-data.raw) and attach/detach them to vm or lxc mountpoint ?
Yes, but then you have to manage it yourself.
This means no Snapshot on ThinLVM, no storage migration,...
And you can't use the GUI to add the Disk to the VM.

For example, this would add a disk
Code:
qm set <VMID> --scsi0 <Path to LV>

for more information see
Code:
qm help set
pct help set
https://pve.proxmox.com/wiki/Manual:_qm.conf
https://pve.proxmox.com/wiki/Manual:_pct.conf
 
Hi Etienne Charlier,


Yes, but then you have to manage it yourself.
This means no Snapshot on ThinLVM, no storage migration,...
And you can't use the GUI to add the Disk to the VM.

For example, this would add a disk
Code:
qm set <VMID> --scsi0 <Path to LV>

for more information see
Code:
qm help set
pct help set
https://pve.proxmox.com/wiki/Manual:_qm.conf
https://pve.proxmox.com/wiki/Manual:_pct.conf
Thanks a lot for the hint !
I'll try on a test infra !
Take care
EC