Local-lvm (storage) and VM format

Jun 4, 2013
24
1
3
Gbely, Slovakia
As I said before, its block device, you cannot use fdisk. If you rly need old type storage, you can install fresh proxmox 4.2, during installation set the root partition (10-15GB enough). After install remove thinpool "lvremove pve/data", then create classic lvm "lvcreate -l 100%FREE pve/data", format lvm "mke2fs /dev/pve/data" next add "/dev/pve/data /var/lib/vz ext4 defaults 0 1" to /etc/fstab, last reboot or remount ...

p.s. untested, at your own risk
 
  • Like
Reactions: jhwireit

kinetica

New Member
May 9, 2014
22
0
1
I tried the same solution, just in order to understand better "Prox past LVM" and "Prox present LVM-thin".
There are some command in order to map the situation:

- lsblk
- pvs
- vgs
- lvs
- lvdisplay

after I removed the LVM-thin:
- lvremove /dev/pve/data
- lvdisplay
- lsblk

After I created the classic LVM
- lvcreate -L 598G -n data pve (in may case the volume is 589Gbyte)
- lsblk

After I have formatted the volume
- mkfs.ext4 /dev/pve/data

And I have added one line to the fstab
-/dev/pve/data /var/lib/vz ext4 defaults 0 1

mount -a


It's work for me.
But since that I am gonna study better LVM-thin
Bye
 
Hello people, I know that when directly use the VM disk on the physical hardware (/dev/mapper/vm-id-disk.raw) improved performance, but the Proxmox could leave the default management via lvm in / var / lib / vz and have options to move the disk in thin format.
At this point I have a partition / dev / sda3 2.5 TB and not know how to use it to move the VM's NFS storage for my local disk. Please provide a step by step to create LVM as in previous versions of Proxmox.
 
Antoniormjr, I would agree with you. It would be great if Proxmox could make it an option you could select at install, so that the end user could choose between storage methods desired.

I just replaced a server, and clean installed 4.2 and struggled with understanding were my vm data was; I am a novice when it comes to Linux. However, I figured out that if I fresh installed 4.1, and then did a upgrade to 4.2 from the repository; it would leave the old directory based file system as it was (/var/lib/vz/images/###). Once upgraded, then I just restored my backups from my NAS to the new pve4.2 and everything was where I expected it to be. And I could control if I wanted them .qcow2, .vmdk, or .raw (just like before)...
 

LnxBil

Well-Known Member
Feb 21, 2015
4,231
411
83
Germany
Only to hear another side of the story:

I really like it that the space is not mounted automatically because this is the first thing I always change on a non-ZFS-based install. So I really like the new option. I never use VM images as files on a filesystem, because of the unnecessary additional layer of software and slowness.
 
LnxBil,

I'm sure the new option is better, especially if there is a performance improvement. My production installation(s) have always been just straight out of the box (ext3), with no fancy file system modifications; in which they have always worked great! I got nervous when I installed 4.2 and couldn't find my data, that's why I rolled back and updated. I just need to do a lot more reading about ZFS and lvm-thin provisioning, so that I know what to do in case of a problem :)
 

Carlos Trevino

New Member
Jun 7, 2016
19
0
1
40
Good morning Guys!!! I was reading your post, and i'm agree with artisticab, with the new proxmox 4.2 I can't find my raw disk for each virtual machine, then i got nervous too because if my Physical Disk fail what can we do to recover at least the raw disk for a manually restore!.. Question guys where i can find the proxmox 4.1 i need to pay for a suscription? Regards from Mexico!!!
 

fabian

Proxmox Staff Member
Staff member
Jan 7, 2016
3,472
540
113
The disks are available as logical volumes. You can simply mount, dd, .. them, they are just not available as image files. If your physical disks fails, you have to be lucky to be able to recover the VM disk, no matter how it is stored on the physical disk. That's what backups are for ;)
 

Carlos Trevino

New Member
Jun 7, 2016
19
0
1
40
Oh, great Fabian!! then if i connect my physical disk to my PC Can I see the logical volume and there I will find each disk for my machines and can i recover any data? i'm a beginner using proxmox!
 

fabian

Proxmox Staff Member
Staff member
Jan 7, 2016
3,472
540
113
if the disk is not corrupted and your are talking about linux, then yes, you can access the logical volumes on any recent linux distribution.
 

nur

New Member
Jun 8, 2016
1
0
1
29
I install proxmox by this instruction - https://pve.proxmox.com/wiki/Install_Proxmox_VE_on_Debian_Jessie
but after reboot I have a problem


root@VirtB:/home/nur# cat /etc/fstab
# <file system> <mount point> <type> <options> <dump> <pass>
/dev/mapper/pve-root / ext4 errors=remount-ro 0 1
/dev/mapper/pve-swap none swap sw 0 0
/dev/pve/data /var/lib/vz ext4 defaults 0 1
root@VirtB:/home/nur# mount -a
root@VirtB:/home/nur# mount
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
************
lxcfs on /var/lib/lxcfs type fuse.lxcfs (rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other)
/dev/fuse on /etc/pve type fuse (rw,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other)
/dev/mapper/pve-data on /var/lib/vz type ext4 (rw,relatime,stripe=256,data=ordered)

after reboot the system don't started and waits to pressing CTRL+D
I have to edit fstab, comment the line with "/dev/pve/data"
then the system can to boot

what is this, and what I have to do?



root@VirtB:/home/nur# lvs
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
data pve twi-aotz-- 9,84t 0,00 2,26
root pve -wi-ao---- 1,07t
swap pve -wi-ao---- 8,00g
root@VirtB:/home/nur# lvscan
ACTIVE '/dev/pve/swap' [8,00 GiB] inherit
ACTIVE '/dev/pve/root' [1,07 TiB] inherit
ACTIVE '/dev/pve/data' [9,84 TiB] inherit
root@VirtB:/home/nur# vgscan
Reading all physical volumes. This may take a while...
Found volume group "pve" using metadata type lvm2
root@VirtB:/home/nur# pvscan
PV /dev/sda3 VG pve lvm2 [1,82 TiB / 0 free]
PV /dev/sdb1 VG pve lvm2 [1,82 TiB / 0 free]
PV /dev/sdc1 VG pve lvm2 [1,82 TiB / 0 free]
PV /dev/sdd1 VG pve lvm2 [1,82 TiB / 0 free]
PV /dev/sde1 VG pve lvm2 [1,82 TiB / 0 free]
PV /dev/sdf1 VG pve lvm2 [1,82 TiB / 0 free]
Total: 6 [10,92 TiB] / in use: 6 [10,92 TiB] / in no VG: 0 [0 ]
 

Carlos Trevino

New Member
Jun 7, 2016
19
0
1
40
Thank you Fabian!!! Thank you Artisticab, Now i'm installing an Ubuntu to mount my proxmox drive to test if i can see the logical volume and extract files from my Virtual Machines, i'll let you know, Regards!!!
 

Carlos Trevino

New Member
Jun 7, 2016
19
0
1
40
Hi Fabian, I'm working trying to mount the logical volume to see my virtual disk but i can't, I type in terminal Sudo lvdisplay and i see the logical volume
LV Path /dev/pve/vm-300-disk-1
LV Name vm-300-disk-1
LV Size 80.0 gb

And i try to mount
sudo mount /dev/pve/vm-300-disk-1 /media/prox/
and i received the message
Special device /dev/pve/vm-300-disk-1 does not exists
I tryied too
vgchange -ay /dev/pve/vm-300-disk-1
Invalid Grupo Name
I can only see mounted my swap and root partition but not shown lvmthin
I'm using Ubuntu
:(
Regards!
 
Last edited:

LnxBil

Well-Known Member
Feb 21, 2015
4,231
411
83
Germany
Please post the output of lvs as root. I suspect, you have to active the volumes.

Also: Please read about backup concepts in Proxmox. There is no need to do what you're doing with ubuntu in real live.
 

Carlos Trevino

New Member
Jun 7, 2016
19
0
1
40
Hi LnxBil ,I'm testing the new LVM thin from Proxmox 4.2 before use it in a production enviroment in this new version you can't see the raw disk like image because now promox use a logical volume, then i'm just trying to mount this logical volume in a linux distro to see if i can get the files i have in my virtual machine,
And yes I active the volumes using sudo vgchange -ay and i can see the root volume and my swap volume but not the lvmthin but is there because if I run this command Sudo lvdisplay i see my virtual machine disk
LV Path /dev/pve/vm-300-disk-1
LV Name vm-300-disk-1
LV Size 80.0 gb

then i try to mount it with
sudo mount /dev/pve/vm-300-disk-1 /media/prox/

and I received the message
Special device /dev/pve/vm-300-disk-1 does not exists

: ´(
 

LnxBil

Well-Known Member
Feb 21, 2015
4,231
411
83
Germany
Hi Carlos,

I'm aware of that, yet it works as it should for Debian Jessie Livesystem. Yes, this is PVE 4.2 and thinprovisioned.

Code:
root@debian ~ > lvs
  LV            VG   Attr       LSize  Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  data          pve  twi---tz-- 16,38g                                                   
  root          pve  -wi-------  7,75g                                                   
  swap          pve  -wi-------  3,88g                                                   
  vm-100-disk-1 pve  Vwi---tz-- 32,00g data

root@debian ~ > vgchange -ay
  4 logical volume(s) in volume group "pve" now active

root@debian ~ > ls -l /dev/pve
total 0
lrwxrwxrwx 1 root root 7 Jun  9 14:56 root -> ../dm-1
lrwxrwxrwx 1 root root 7 Jun  9 14:56 swap -> ../dm-0
lrwxrwxrwx 1 root root 7 Jun  9 14:56 vm-100-disk-1 -> ../dm-6
 

Carlos Trevino

New Member
Jun 7, 2016
19
0
1
40
Hi LnxBil, I did it using Debian but i received some errors after vgchange -ay , then I start proxmox thinking that instalation was worng or corrupted but not, proxmox started OK, but i dont know why i cant active the "vm-300-disk-1 pve"

upload_2016-6-9_16-28-19.png

Regards
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE 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 your own in 60 seconds.

Buy now!