PVE resizing root / data

mokaz

Member
Nov 30, 2021
74
15
13
Hi there all,
Is there an easy way to resize both the root and data logical volumes?
Here are my details on that drive (hosting the PVE installation). I actually do not use the "data" logical volume at all and would rather allocate it's space to the "root" LV.
My goal being to have a bigger non thin "local" directory to store local backups and ISOs etc..

Code:
root@pve:~# lvs
  LV             VG         Attr       LSize   Pool       Origin Data%  Meta%  Move Log Cpy%Sync Convert
  ...                         
  data           pve        twi-aotz--  63.62g                   2.65   1.65                           
  root           pve        -wi-ao----  29.25g                                                         
  swap           pve        -wi-ao----   8.00g

Thanks for any hints.

Regards,
M.
 
You need to destroy that data LV (lvdestroy) and then extent your root LV (lvextend) and extend your ext4 filesystem (resize2fs).
But I would backup that system disk first using tools like clonezilla.
I actually do not use the "data" logical volume at all
According to lvs your data LV isn't empty.
 
Hey there, thanks a lot, I'll see what I'll do... indeed, one LXC stored on that data LV..
 
Dunuin, would simply resizing the DATA LV and expending the ROOT LV be less sensitive? I can leave with say grabbing 30 GB from the DATA LV really...
 
Dunuin, would simply resizing the DATA LV and expending the ROOT LV be less sensitive? I can leave with say grabbing 30 GB from the DATA LV really...
The "data" LV ia not a normal LV. It is a thin pool. As far as I know you can't shrink a thin pool. You can only destroy and recreate it with a smaller size.
 
Okiii here is what I've done (after having moved all the potential LV's hosted on the original DATA LV):


Code:
root@pve:~# lvremove /dev/pve/data -y
  Logical volume "data" successfully removed
 
root@pve:~# lvresize -L +33.62G /dev/pve/root
  Rounding size to boundary between physical extents: 33.62 GiB.
  Size of logical volume pve/root changed from 29.25 GiB (7488 extents) to 62.87 GiB (16095 extents).
  Logical volume pve/root successfully resized.

root@pve:~# resize2fs /dev/pve/root
resize2fs 1.46.5 (30-Dec-2021)
Filesystem at /dev/pve/root is mounted on /; on-line resizing required
old_desc_blocks = 4, new_desc_blocks = 8
The filesystem on /dev/pve/root is now 16481280 (4k) blocks long.

root@pve:~# lvcreate -L 30G -n data pve
  Logical volume "data" created.
root@pve:~# lvconvert --type thin-pool pve/data
  Thin pool volume with chunk size 64.00 KiB can address at most 15.81 TiB of data.
  WARNING: Converting pve/data to thin pool's data volume with metadata wiping.
  THIS WILL DESTROY CONTENT OF LOGICAL VOLUME (filesystem etc.)
Do you really want to convert pve/data? [y/n]: y
  Converted pve/data to thin pool.

root@pve:~# lvs
  LV             VG         Attr       LSize   Pool       Origin Data%  Meta%  Move Log Cpy%Sync Convert
  ...                            
  data           pve        twi-a-tz--  30.00g                   0.00   10.47                          
  root           pve        -wi-ao----  62.87g                                                        
  swap           pve        -wi-ao----   8.00g

Let's hope I'll reboot all fine =)

Thanks for your help,
Cheers,
M.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, 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 yours easily in our online shop.

Buy now!