Question regarding LVM groups

  • Thread starter Thread starter Fab
  • Start date Start date
F

Fab

Guest
Hello,
I am wondering if it is possible to somehow mount a LVM group in Proxmox to be able to access directly its contents.
I created a LVM group, added it to the Proxmox storages, and now I would need to “get inside” in order to be able to create fixed size HDDs.
I’d also like to be able to simply browse, copy, upload files into the LVM group like in VMWare.
Is it possible?
 
no, you cannot mount a block device multiple times, you will get data corruption. but this is not Proxmox specific, you can´t to this unless you got a cluster filesystem.
 
Thanks Tom.

So it means no chance to create fixed size HDDs in a LVM group.. ?
 
I do not understand this question, pls explain.
 
Thanks Tom.

So it means no chance to create fixed size HDDs in a LVM group.. ?
Of course - you can't create an unfixed sized lv on an lvm!
If you create an lv on a lvm, you defined the fixed size for that lv - and for the vm it's looks like a fixed sized disk.
But you are able to extend further the lv if you need more space.

See "man lvm", "vgdisplay" and "lvdisplay".

Udo
 
Thanks guys for your answers.

Please excuse me, I think I did not explain properly what I meant by fixed size disk (remaining habits of VMWare...).

In Proxmox, when I create a 20GB disk, of course the size is fixed for the VM to 20GB.

But on the Promox file system, the disk file is what I would call auto-extended. It means, if I actually write 5GB on the virtual disk, the file will be only 5GB.

I would like to avoid this. It means, when I create a 20GB disk, I would like the HDD file to already use the whole 20GB space to avoid future fragmentation and storage overload.

For this, I have this command: dd if=/dev/zero of=vm-disk-id.raw bs=1024k count=20000

Unfortunately, if I am able to run it in a directory, I don't know how to create such HDD inside of a LVM group.

This is the reason why I was trying to access somehow the content of my LVM group.
 
if you use block device like LVM there is not need for this.
 
Thanks guys for your answers.

Please excuse me, I think I did not explain properly what I meant by fixed size disk (remaining habits of VMWare...).

In Proxmox, when I create a 20GB disk, of course the size is fixed for the VM to 20GB.

But on the Promox file system, the disk file is what I would call auto-extended. It means, if I actually write 5GB on the virtual disk, the file will be only 5GB.

I would like to avoid this. It means, when I create a 20GB disk, I would like the HDD file to already use the whole 20GB space to avoid future fragmentation and storage overload.

For this, I have this command: dd if=/dev/zero of=vm-disk-id.raw bs=1024k count=20000

Unfortunately, if I am able to run it in a directory, I don't know how to create such HDD inside of a LVM group.

This is the reason why I was trying to access somehow the content of my LVM group.
Hi,
and where is the problem?
Like I wrote before, see "man lvm", lvdisplay and so on. A 20GB lv use 20GB space inside the vg. Look with lvdisplay: (in this case a 40GB lv)
Code:
   --- Logical volume ---
  LV Name                /dev/a_sas_r0/vm-108-disk-1
  VG Name                a_sas_r0
  LV UUID                ClhPX3-O6kZ-O5Cu-s9M9-5LDj-ZdpO-scbaFI
  LV Write Access        read/write
  LV Status              available
  # open                 1
  LV Size                40,00 GB
  Current LE             10240
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           251:35

Udo
 
Thanks again guys, I see you are losing patience, sorry for it.

@ Tom > yes, sorry, I did not check it properly. I must have selected the wrong storage during my tests but all is OK actually. Mea culpa.

@ udo > I already RTFM before posting this question

So I have all my answers
- Disks files have fixed size like I wanted in the LVM groups
- Not possible to "mount" a LVM group to access contents

Cheers