Help about partition layout Proxmox 1.7

johjoh

Member
Feb 4, 2011
43
0
6
Hi, I need help to modify the partitioning layout that ProxMox create automatically.

I have one controller hardware RAID, with 2 separated RAID volume:
- the first of 145 GB
- the second of 900 GB
when I have installed Proxmox it taken only /dev/sda, is there a way to change the layout from:
/dev/pve/swap on pve on /dev/sda2 16.88 GB
/dev/pve/root on pve on /dev/sda2 33.75 GB
/dev/pve/data on pve on /dev/sda2 80.56 GB

to:
/dev/pve/swap on pve on /dev/sda2 16.88 GB
/dev/pve/root on pve all remaining on /dev/sda2
and
/dev/pve/data on pve2 on /dev/sdb1 all space

Someone can explane me how to change?
Thank you
 
Hi, I need help to modify the partitioning layout that ProxMox create automatically.

I have one controller hardware RAID, with 2 separated RAID volume:
- the first of 145 GB
- the second of 900 GB
when I have installed Proxmox it taken only /dev/sda, is there a way to change the layout from:
/dev/pve/swap on pve on /dev/sda2 16.88 GB
/dev/pve/root on pve on /dev/sda2 33.75 GB
/dev/pve/data on pve on /dev/sda2 80.56 GB

to:
/dev/pve/swap on pve on /dev/sda2 16.88 GB
/dev/pve/root on pve all remaining on /dev/sda2
and
/dev/pve/data on pve2 on /dev/sdb1 all space

Someone can explane me how to change?
Thank you
Hi,
with a little trick it's easy. But you should know a little bit about lvm (man lvm).
I assume, that you don't have much things on /var/lib/vz
Code:
# first shutdown all VMs
# then backup /var/lib/vz/
cd /var/lib/vz
tar cvf /root/var_lib_vz.tar .
cd
umount /var/lib/vz
#
# look on your lvm:
pvdisplay
vgdisplay
lvdisplay
 # now remove data
lvchange -a n /dev/pve/data
lvremove /dev/pve/data
#
# create an dummy lv which occupied the whole space. Look for free extents:
vgdisplay
lvcreate -l 28596 -n dummy pve               # in this case the vg has 28596 free extends
#
# control:
vgdisplay

# if there no free extends, simply add sdb1
# create partitiontable on sdb with partition 1 type 8e
pvcreate /dev/sdb1
vgextend pve /dev/sdb1

# control:
vgdisplay

# now create new data:
lvcreate -l XXXXXX -n data pve
mkfs.ext3 /dev/pve/data
mount /var/lib/vz
cd /var/lib/vz
tar xvf /root/var_lib_vz. tar

# remove dummy-lv
lvremove /dev/pve/dummy

After that, you can use the space in the vg pve, but leave min. 4G free for backup (snapshot).

Udo
 
Thank you UDO, thank you UDO, thank you UDO, thank you UDO, thank you UDO, thank you UDO, thank you UDO, thank you UDO!
You're simply the best!

Only a last question how to extend /dev/pve/root to use the remaining space, instead of creating /dev/pve/dummy and after remove /dev/pve/dummy?
The final result would be:
/dev/pve/swap 16.88 GB of /dev/sda2
/dev/pve/root 33.75+80.56 GB of /dev/sda2

/dev/pve/data 100% of /dev/sdb1

Thank you again
 
...
Only a last question how to extend /dev/pve/root to use the remaining space, instead of creating /dev/pve/dummy and after remove /dev/pve/dummy?
...
Hi,
you can expand a logical volume. Look with vgdisplay how much free space you have and then expand like this (in this case add 20GB to root):
Code:
df -k /dev/pve/root
vgdisplay pve
lvextend -L +20G /dev/pve/root
resize2fs /dev/pve/root
df -k /dev/pve/root
But be sure, that you leave min. 4GB free (a little bit more is not bad) or you run in trouble with backup.
To expand (online) is very easy - shrinking not (without data-loss).

Udo