please help me resize new drive

applejuice

Active Member
Oct 13, 2019
7
0
41
63
I am sorry if this is a dumb question covered in the documentation or already answered in the forums, but I have looked and can't find any answer I understand. I just purchased a 2TB nvme drive for my proxmox machine, used clonezilla to clone the original 128GB ssd to the new 2TB nvme. even though I got stuck in a loop when using clonezilla, I pulled the power cord at just the right time after "cloned success" and rebooted successfully to new drive. as I feared, it did not automatically expand the LVM partition (that's what I wanted, right?) how do I expand my partition the right way with proxmox? thanks.

Screen Shot 2022-05-02 at 6.18.13 PM.png
 
Last edited:
You need to do that on your own using the CLI. First you need to expand your partition that stores the LVM (for example using fdisk or parted using the CLI or you boot into a gparted ISO to have a GUI). Then you have to extend the VG of the LVM using the vgextend command. Then extend the LVs using the lvextend command. Then you can use growfs or resize2fs or something similar to extend the filesystem of the root LV.

Might be easier to just install a new fresh PVE and then restore the guests from backups.
 
Last edited:
You need to do that on your own using the CLI. First you need to expand your partition that stores the LVM (for example using fdisk or parted using the CLI or you boot into a gparted ISO to have a GUI). Then you have to extend the VG of the LVM using the vgextend command. Then extend the LVs using the lvextent command. Then you can use growfs or resize2fs or something similar to extend the filesystem of the root LV.

Might be easier to just install a new fresh PVE and then restore the guests from backups.
thanks, but that is way over may pay grade. If I knew how to do any of what you just said, I probably wouldn't have asked the question in the first place.
 
I am sorry if this is a dumb question covered in the documentation or already answered in the forums, but I have looked and can't find any answer I understand. I just purchased a 2TB nvme drive for my proxmox machine, used clonezilla to clone the original 128GB ssd to the new 2TB nvme. even though I got stuck in a loop when using clonezilla, I pulled the power cord at just the right time after "cloned success" and rebooted successfully to new drive. as I feared, it did not automatically expand the LVM partition (that's what I wanted, right?) how do I expand my partition the right way with proxmox? thanks.
There are four steps you need to do.
  1. Resize partition to 100%
    • You can do this via fdisk. Run fdisk on /dev/nvme0n1, note the start sector of partition 3, delete partition 3, create a new partition 3, set the end sector to the last available sector and don't remove LVM2_member signature! Then change type of the newly created partition to 30 (Linux LVM) and write the changes to disk.
  2. Notify the OS of the partition changes or simply reboot the server.
    • Code:
      partx -u /dev/nvme0n1p3
  3. Grow the physical volume of your LVM.
    • Code:
      pvresize /dev/nvme0n1p3
  4. Expand your locical volume.
    • Use all the new space
      Code:
      lvresize -L +100%FREE pve/data
      or only 100 GB
      Code:
      lvextend -L+100G pve/data
 
Last edited:
  • Like
Reactions: Crabe919
After searching for hours this is what helped me out after swapping to a bigger drive!
Many thanks
 
...
4. Expand your locical volume.
  • Use all the new space
    Code:
    lvresize -L +100%FREE pve/data
    or only 100 GB
    Code:
    lvextend -L+100G pve/data

This was very helpful, though to resize by a percentage, I needed to use the lowercase "-l" option:
Bash:
lvresize -l +100%FREE pve/data
 

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!