A few questions about resizing pve-data, expanding disks, etc

xilex

New Member
Apr 7, 2022
3
0
1
Hi everyone, I previously asked how to resize/expand pve-data inside Promox but was stuck after being unsuccessful. After revisiting the issue this weekend, I have some questions I hope someone can answer to clear up. The general situation is inside ESXi, I have Proxmox installed on a 60GB disk, then I expand that disk to 80GB (or other size), and I needed to get Proxmox to see it.

So after expanding disk size, I can see in lsblk that sda disk reflects the new size. But sda3 partition reflects old size.

Previously, a user pointed out I could use GPartEd Live CD to do that (link). This weekend, I saw another post that said I could install cloud-utils and run growpart /dev/sda 3 followed by pvresize /dev/sda3 (link). Does this accomplish the same thing (besides one is without Proxmox running, I believe safer, whereas the other is online)?

After that I could use lvextend -v -l +100%FREE /dev/pve/data to fill up all the free space into pve-data lvm. I saw another post (link) that used resize2fs /dev/mapper/pve-root when they were expanding the pve-root lvm. Is this needed with the commands I have run? Another question is if I use a command like lvextend -L+100G pve/data, will it stop me if I try to add more space than available space?

Lastly, I saw someone (link) use lvresize --poolmetadatasize +1GB pve/data. My question is how much do I need to expand --poolmetadatasize? Is it 1GB per 100GB?

Thank you.

@ 40gb disk
Code:
root@pve-test:~# lsblk
NAME               MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda                  8:0    0    40G  0 disk
├─sda1               8:1    0  1007K  0 part
├─sda2               8:2    0   512M  0 part
└─sda3               8:3    0  39.5G  0 part
  ├─pve-swap       253:0    0   4.9G  0 lvm  [SWAP]
  ├─pve-root       253:1    0   9.8G  0 lvm  /
  ├─pve-data_tmeta 253:2    0     1G  0 lvm 
  │ └─pve-data     253:4    0    18G  0 lvm 
  └─pve-data_tdata 253:3    0    18G  0 lvm 
    └─pve-data     253:4    0    18G  0 lvm 
sr0                 11:0    1 994.2M  0 rom

@ expand to 60gb disk
Code:
root@pve-test:~# lsblk
NAME               MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda                  8:0    0    60G  0 disk
├─sda1               8:1    0  1007K  0 part
├─sda2               8:2    0   512M  0 part
└─sda3               8:3    0  39.5G  0 part
  ├─pve-swap       253:0    0   4.9G  0 lvm  [SWAP]
  ├─pve-root       253:1    0   9.8G  0 lvm  /
  ├─pve-data_tmeta 253:2    0     1G  0 lvm 
  │ └─pve-data     253:4    0    18G  0 lvm 
  └─pve-data_tdata 253:3    0    18G  0 lvm 
    └─pve-data     253:4    0    18G  0 lvm 
sr0                 11:0    1 994.2M  0 rom

@ after running growpart /dev/sda 3 / pvresize /dev/sda3
Code:
root@pve-test:~# lsblk
NAME               MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda                  8:0    0    60G  0 disk
├─sda1               8:1    0  1007K  0 part
├─sda2               8:2    0   512M  0 part
└─sda3               8:3    0  59.5G  0 part
  ├─pve-swap       253:0    0   4.9G  0 lvm  [SWAP]
  ├─pve-root       253:1    0   9.8G  0 lvm  /
  ├─pve-data_tmeta 253:2    0     1G  0 lvm 
  │ └─pve-data     253:4    0  42.9G  0 lvm 
  └─pve-data_tdata 253:3    0  42.9G  0 lvm 
    └─pve-data     253:4    0  42.9G  0 lvm 
sr0                 11:0    1 994.2M  0 rom
 
Hi everyone, I previously asked how to resize/expand pve-data inside Promox but was stuck after being unsuccessful. After revisiting the issue this weekend, I have some questions I hope someone can answer to clear up. The general situation is inside ESXi, I have Proxmox installed on a 60GB disk, then I expand that disk to 80GB (or other size), and I needed to get Proxmox to see it.

So after expanding disk size, I can see in lsblk that sda disk reflects the new size. But sda3 partition reflects old size.

Previously, a user pointed out I could use GPartEd Live CD to do that (link). This weekend, I saw another post that said I could install cloud-utils and run growpart /dev/sda 3 followed by pvresize /dev/sda3 (link). Does this accomplish the same thing (besides one is without Proxmox running, I believe safer, whereas the other is online)?

After that I could use lvextend -v -l +100%FREE /dev/pve/data to fill up all the free space into pve-data lvm. I saw another post (link) that used resize2fs /dev/mapper/pve-root when they were expanding the pve-root lvm. Is this needed with the commands I have run? Another question is if I use a command like lvextend -L+100G pve/data, will it stop me if I try to add more space than available space?

Lastly, I saw someone (link) use lvresize --poolmetadatasize +1GB pve/data. My question is how much do I need to expand --poolmetadatasize? Is it 1GB per 100GB?

Thank you.

@ 40gb disk
Code:
root@pve-test:~# lsblk
NAME               MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda                  8:0    0    40G  0 disk
├─sda1               8:1    0  1007K  0 part
├─sda2               8:2    0   512M  0 part
└─sda3               8:3    0  39.5G  0 part
  ├─pve-swap       253:0    0   4.9G  0 lvm  [SWAP]
  ├─pve-root       253:1    0   9.8G  0 lvm  /
  ├─pve-data_tmeta 253:2    0     1G  0 lvm
  │ └─pve-data     253:4    0    18G  0 lvm
  └─pve-data_tdata 253:3    0    18G  0 lvm
    └─pve-data     253:4    0    18G  0 lvm
sr0                 11:0    1 994.2M  0 rom

@ expand to 60gb disk
Code:
root@pve-test:~# lsblk
NAME               MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda                  8:0    0    60G  0 disk
├─sda1               8:1    0  1007K  0 part
├─sda2               8:2    0   512M  0 part
└─sda3               8:3    0  39.5G  0 part
  ├─pve-swap       253:0    0   4.9G  0 lvm  [SWAP]
  ├─pve-root       253:1    0   9.8G  0 lvm  /
  ├─pve-data_tmeta 253:2    0     1G  0 lvm
  │ └─pve-data     253:4    0    18G  0 lvm
  └─pve-data_tdata 253:3    0    18G  0 lvm
    └─pve-data     253:4    0    18G  0 lvm
sr0                 11:0    1 994.2M  0 rom

@ after running growpart /dev/sda 3 / pvresize /dev/sda3
Code:
root@pve-test:~# lsblk
NAME               MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda                  8:0    0    60G  0 disk
├─sda1               8:1    0  1007K  0 part
├─sda2               8:2    0   512M  0 part
└─sda3               8:3    0  59.5G  0 part
  ├─pve-swap       253:0    0   4.9G  0 lvm  [SWAP]
  ├─pve-root       253:1    0   9.8G  0 lvm  /
  ├─pve-data_tmeta 253:2    0     1G  0 lvm
  │ └─pve-data     253:4    0  42.9G  0 lvm
  └─pve-data_tdata 253:3    0  42.9G  0 lvm
    └─pve-data     253:4    0  42.9G  0 lvm
sr0                 11:0    1 994.2M  0 rom

try these commands

1 - remove Local LVM
2 - run these three commands from node shell
- lvremove /dev/pve/data
- lvresize -l +100%FREE /dev/pve/root
- resize2fs /dev/mapper/pve-root