How to create local-lvm from root partition?

srotig

New Member
Mar 6, 2023
9
1
3
I've followed this blog post https://blog.evoluso.com/proxmox-remove-lvm-local-data/.
Basically, i wanted to wipe the local-lvm, however, i end up with resizing root partition.

I've run the following code:

Code:
1. Remove /dev/pve/data
lvremove /dev/pve/data

2. Resize root partition
lvresize -l +100%FREE /dev/pve/root

3. Completing
resize2fs /dev/mapper/pve-root

Now my local-lvm is merged into root partition.
1733164947358.png

I would like to rebuild the local-lvm, can someone support me to do this?

This is my current lsblk:
Code:
root@pve:~# lsblk
NAME         MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
sda            8:0    0 953.9G  0 disk
├─sda1         8:1    0  1007K  0 part
├─sda2         8:2    0   512M  0 part /boot/efi
└─sda3         8:3    0 953.4G  0 part
  ├─pve-swap 252:0    0     8G  0 lvm  [SWAP]
  └─pve-root 252:1    0 945.4G  0 lvm  /
sr0           11:0    1  1024M  0 rom

I would like to have 900GB for my local-lvm and have the remaining in the root partition.
Is this feasible?

Thanks
 
I've followed this blog post https://blog.evoluso.com/proxmox-remove-lvm-local-data/.
Basically, i wanted to wipe the local-lvm, however, i end up with resizing root partition.

Which is exactly the goal of the blog post. Why did you follow a blog post which isn't about your goal? And if you didn't got it at the point why did you follow something you don't understand?
I've run the following code:

Code:
1. Remove /dev/pve/data
lvremove /dev/pve/data

2. Resize root partition
lvresize -l +100%FREE /dev/pve/root

3. Completing
resize2fs /dev/mapper/pve-root

Now my local-lvm is merged into root partition.
View attachment 78579

I would like to rebuild the local-lvm, can someone support me to do this?

This is my current lsblk:
Code:
root@pve:~# lsblk
NAME         MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
sda            8:0    0 953.9G  0 disk
├─sda1         8:1    0  1007K  0 part
├─sda2         8:2    0   512M  0 part /boot/efi
└─sda3         8:3    0 953.4G  0 part
  ├─pve-swap 252:0    0     8G  0 lvm  [SWAP]
  └─pve-root 252:1    0 945.4G  0 lvm  /
sr0           11:0    1  1024M  0 rom

I would like to have 900GB for my local-lvm and have the remaining in the root partition.
Is this feasible?

Feasible yes, you could try to shrink pve-root and afterwards setup a new LVM-THIN VG. You should create backups of your configuration and everything else important before (you did make backups of your vms before running the commands didn't you).

However I think it would propably easier to backup your configuration, reinstall everything, restore the configuration and afterwards your VMs.

If you don't have backups too bad your VMs and LXCs are lost. Then however you don't have nothing much to loose in reinstalling ProxmoxVE (except configuration on the host level so make a backup of it before).
 
  • Like
Reactions: Kingneutron
You blindly followed a blog post that indicates "How to utilize a single LVM Volume / root LVM partition." That is not what you wanted.

I assume your PVE is a fresh-install, (otherwise you would not be doing any of those wild shenanigans), I would just re-install Proxmox, AFAIR you'll get a 96GB root & the rest lvm-thin. So just do that.
 

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!