mount a new LV as /var/lib/vz

m.ardito

Famous Member
Feb 17, 2010
1,473
19
103
Torino, Italy
Hi,

this is something I never did before, and need some info/help:
I installed pve 3.0 over a wheezy 7.1, which was partitioned like this:
- a boot partition (~500 MB)
- a swap partition (~5 GB)
- a free partition (~240 GB)

the free partition was added as PV to lvm
tha PV was added to a "pve" VG
two LVs were created on the "pve" VG
- "root" (~8GB)
- "data" (~210GB)

this was before installing pve over debian, so i thought to prepare those two typical pve LVs, to use them after pve install:
i was able to mount /root on pve-root, but since there weas no /var/lib/vz folder, i left pve-data unused

then I installed pve, went smoothly, and now I have:
Code:
pveversion -v
pve-manager: 3.0-23 (pve-manager/3.0/957f0862)
running kernel: 2.6.32-20-pve
proxmox-ve-2.6.32: 3.0-100
pve-kernel-2.6.32-20-pve: 2.6.32-100
lvm2: 2.02.95-pve3
clvm: 2.02.95-pve3
corosync-pve: 1.4.5-1
openais-pve: 1.1.4-3
libqb0: 0.11.1-2
redhat-cluster-pve: 3.2.0-2
resource-agents-pve: 3.9.2-4
fence-agents-pve: 4.0.0-1
pve-cluster: 3.0-4
qemu-server: 3.0-20
pve-firmware: 1.0-22
libpve-common-perl: 3.0-4
libpve-access-control: 3.0-4
libpve-storage-perl: 3.0-8
vncterm: 1.1-4
vzctl: 4.0-1pve3
vzprocps: 2.0.11-2
vzquota: 3.1-2
pve-qemu-kvm: 1.4-13
ksm-control-daemon: 1.1-1

now of course /var/lib/vz is too small, and wish to mount it on the pve-data LV waiting there:

I have currently no vm/ct created atm, so what is the best procedure? I thought I could simply
- mount pve-data elsewhere,
- move everything from /var/lib/vz there,
- remove /var/lib/vz,
- mount pve-data as /var/lib/vz?
- update fstab/mtab?

Should this work or there's a better way?

Should I have done the whole procedure differently/better, how?

Any suggestions welcome,

Thank you,
Marco
 
Last edited:
Hi,

this is something I never did before, and need some info/help:
I installed pve 3.0 over a wheezy 7.1, which was partitioned like this:
- a boot partition (~500 MB)
- a swap partition (~5 GB)
- a free partition (~240 GB)

the free partition was added as PV to lvm
tha PV was added to a "pve" VG
two LVs were created on the "pve" VG
- "root" (~8GB)
- "data" (~210GB)

this was before installing pve over debian, so i thought to prepare those two typical pve LVs, to use them after pve install:
i was able to mount /root on pve-root, but since there weas no /var/lib/vz folder, i left pve-data unused

then I installed pve, went smoothly, and now I have:
Code:
pveversion -v
pve-manager: 3.0-23 (pve-manager/3.0/957f0862)
running kernel: 2.6.32-20-pve
proxmox-ve-2.6.32: 3.0-100
pve-kernel-2.6.32-20-pve: 2.6.32-100
lvm2: 2.02.95-pve3
clvm: 2.02.95-pve3
corosync-pve: 1.4.5-1
openais-pve: 1.1.4-3
libqb0: 0.11.1-2
redhat-cluster-pve: 3.2.0-2
resource-agents-pve: 3.9.2-4
fence-agents-pve: 4.0.0-1
pve-cluster: 3.0-4
qemu-server: 3.0-20
pve-firmware: 1.0-22
libpve-common-perl: 3.0-4
libpve-access-control: 3.0-4
libpve-storage-perl: 3.0-8
vncterm: 1.1-4
vzctl: 4.0-1pve3
vzprocps: 2.0.11-2
vzquota: 3.1-2
pve-qemu-kvm: 1.4-13
ksm-control-daemon: 1.1-1

now of course /var/lib/vz is too small, and wish to mount it on the pve-data LV waiting there:

I have currently no vm/ct created atm, so what is the best procedure? I thought I could simply
- mount pve-data elsewhere,
- move everything from /var/lib/vz there,
- remove /var/lib/vz,
- mount pve-data as /var/lib/vz?
- update fstab/mtab?

Should this work or there's a better way?

Should I have done the whole procedure differently/better, how?

Any suggestions welcome,

Thank you,
Marco
Hi,
yes this is the normal procedure (but you don't have to delete /var/lib/vz, because you need the dir as mountpoint).
I prefer to update fstab first and use then an "mount /var/lib/vz" to see if all goes right.

Udo
 
Hi,
yes this is the normal procedure (but you don't have to delete /var/lib/vz, because you need the dir as mountpoint).
I prefer to update fstab first and use then an "mount /var/lib/vz" to see if all goes right.

Udo

yes, of course :-)

thanks, Udo
 
well, I just did it, first in fstab, as
Code:
/dev/pve/data /var/lib/vz            ext4    defaults          0       1
then mounted, then rebooted.

but I see , from the gui, that "local" storage (defined as /var/lib/vz), suddenly has
size: 33.33 GB
used: 1.86 GB
avail: 31.47 GB

1.86 GB used... ? by what?

Code:
df -h
Filesystem            Size  Used Avail Use% Mounted on
udev                   10M     0   10M   0% /dev
tmpfs                 200M  396K  200M   1% /run
/dev/mapper/pve-root  7.4G  1.1G  6.0G  15% /
tmpfs                 5.0M     0  5.0M   0% /run/lock
tmpfs                 1.4G   22M  1.4G   2% /run/shm
/dev/mapper/pve-data   34G  176M   32G   1% /var/lib/vz
/dev/md0              472M   34M  414M   8% /boot
/dev/fuse              30M   12K   30M   1% /etc/pve

and this is the /var/lib/vz content (just the default folder tree, I think):

Code:
ls -laR /var/lib/vz
/var/lib/vz:
total 48
drwxr-xr-x  9 root root  4096 Jun 21 11:13 .
drwxr-xr-x 44 root root  4096 Jun 20 13:37 ..
drwxr-xr-x  2 root root  4096 Jun 21 11:13 dump
drwxr-xr-x  2 root root  4096 Jun 21 11:13 images
drwxr-xr-x  2 root root  4096 Jun 21 11:20 lock
drwx------  2 root root 16384 Jun 21 11:10 lost+found
drwxr-xr-x  2 root root  4096 Jun 21 11:13 private
drwxr-xr-x  2 root root  4096 Jun 21 11:13 root
drwxr-xr-x  5 root root  4096 Jun 21 11:13 template

/var/lib/vz/dump:
total 8
drwxr-xr-x 2 root root 4096 Jun 21 11:13 .
drwxr-xr-x 9 root root 4096 Jun 21 11:13 ..

/var/lib/vz/images:
total 8
drwxr-xr-x 2 root root 4096 Jun 21 11:13 .
drwxr-xr-x 9 root root 4096 Jun 21 11:13 ..

/var/lib/vz/lock:
total 8
drwxr-xr-x 2 root root 4096 Jun 21 11:20 .
drwxr-xr-x 9 root root 4096 Jun 21 11:13 ..

/var/lib/vz/lost+found:
total 20
drwx------ 2 root root 16384 Jun 21 11:10 .
drwxr-xr-x 9 root root  4096 Jun 21 11:13 ..

/var/lib/vz/private:
total 8
drwxr-xr-x 2 root root 4096 Jun 21 11:13 .
drwxr-xr-x 9 root root 4096 Jun 21 11:13 ..

/var/lib/vz/root:
total 8
drwxr-xr-x 2 root root 4096 Jun 21 11:13 .
drwxr-xr-x 9 root root 4096 Jun 21 11:13 ..

/var/lib/vz/template:
total 20
drwxr-xr-x 5 root root 4096 Jun 21 11:13 .
drwxr-xr-x 9 root root 4096 Jun 21 11:13 ..
drwxr-xr-x 2 root root 4096 Jun 21 11:13 cache
drwxr-xr-x 2 root root 4096 Jun 21 11:13 iso
drwxr-xr-x 2 root root 4096 Jun 21 11:13 qemu

/var/lib/vz/template/cache:
total 8
drwxr-xr-x 2 root root 4096 Jun 21 11:13 .
drwxr-xr-x 5 root root 4096 Jun 21 11:13 ..

/var/lib/vz/template/iso:
total 8
drwxr-xr-x 2 root root 4096 Jun 21 11:13 .
drwxr-xr-x 5 root root 4096 Jun 21 11:13 ..

/var/lib/vz/template/qemu:
total 8
drwxr-xr-x 2 root root 4096 Jun 21 11:13 .
drwxr-xr-x 5 root root 4096 Jun 21 11:13 ..

what's wrong?

Marco