reduce the size of pve volume group

tincboy

Renowned Member
Apr 13, 2010
466
6
83
I've a fresh server with Proxmox 1.7 installed,
I can see that pve volume group occupaies the whole available space on primary disk,
How can I reduce it's size and create my own volume group ( I use a specific volume group with specific name for my LVMs )
 
I've a fresh server with Proxmox 1.7 installed,
I can see that pve volume group occupaies the whole available space on primary disk,
How can I reduce it's size and create my own volume group ( I use a specific volume group with specific name for my LVMs )
Hi,
i do this in this way (be sure to have an valid backup):
connect an external disk, boot a live-cd (like grml).
mount pve-root - tar the content to the external disk
mount pve-data - tar the content to the external disk
umount pve-root and pve-data,
vgchange -a n pve
vgremove pve
pvremove -ff /dev/sda2

new partitiontable with fdisk (leave sda1 untouched, remove sda2 and crate a new sda2+sda3 - type 8e).
Code:
pvcreate /dev/sda2
pvcreate /dev/sda3
vgcreate -s 4M pve /dev/sda2
lvcreate -C y -n swap -L 8G pve
lvcreate -n root -L 20G pve
lvcreate -n data -L 100G pve

# leave min. 4G free in vg pve!

mkfs.ext3 /dev/pve/root
mkfs.ext3 /dev/pve/data
mkswap -f /dev/pve/swap
mount pve-root and data again and restore the content from the external disk.
reboot - and then you can create your vg on sda3.

Udo
 
Thanks,
As the server is in a data center it's a little bit hard for me to do what you suggest.
What about just reducing the size of data on pve and use the free part of pve for my own LVMs (I'll fix my script to work with pve as main volume group name) , does it require any data to be backup/restored or any special configuration?
 
Thanks,
As the server is in a data center it's a little bit hard for me to do what you suggest.
What about just reducing the size of data on pve and use the free part of pve for my own LVMs (I'll fix my script to work with pve as main volume group name) , does it require any data to be backup/restored or any special configuration?
I mean using these commands while the Proxmox is runing as OS: ( and absolutly while we've no VM on the server )

lvresize -L -400GB /dev/mapper/pve-root
e2fsck -f /dev/mapper/pve-root
resize2fs -p /dev/mapper/pve-root
 
I mean using these commands while the Proxmox is runing as OS: ( and absolutly while we've no VM on the server )
Hi,
I think you can't do an online resize (with less space) of pve-root. (for this it's better to use the boot-flag maxroot=nn during install).
But you can umount pve-data and shrink this partition.
For backup (snapshot) it's nessesary to leave 4GB free in the volume group.

Udo
 
Thanks,
But you can umount pve-data and shrink this partition.
Do you mean I can umount pve-data while the Proxmox is running as OS and then reduce the size with same commands I mentioned in my last post?
for this it's better to use the boot-flag maxroot=nn during install
How can I use custom flag during the install? I didn't find any option for that in installation process.

Thanks for your attention.
 
Thanks,

Do you mean I can umount pve-data while the Proxmox is running as OS and then reduce the size with same commands I mentioned in my last post?
Yes, if no VM are running
How can I use custom flag during the install? I didn't find any option for that in installation process.

Thanks for your attention.
In the Grub line:
Code:
linux maxroot=20 swapspace=8
should work
 
Thanks,

Do you mean I can umount pve-data while the Proxmox is running as OS and then reduce the size with same commands I mentioned in my last post?
...
BTW, I'm have no experience with shrinking filesystems - what i will say is: i don't know if your command works well (my yes at the posting before mean the unmounting).

Udo
 
Thanks,
the first command was successful but the second command shows an error and wants to remove a superblock
Code:
e2fsck -f /dev/mapper/pve-data
e2fsck 1.41.3 (12-Oct-2008)
Superblock has an invalid ext3 journal (inode 8).
Clear<y>?
And when typing no the operation aborts.
Do you have any suggestion?