There are several ways you can add additional hard drives to Proxmox server. One the ways I did is to extend the existing volume group. There are the steps I took to accomplish this task.
- Add the additional hard drive (HDD or SSD) to your Proxmox server.
- I added my NVMe SSD 2TB to my server.
- You can see in the picture below its /dev/nvme0n1 device. If you don’t see your device click on Reload button on the top.
- Login into the Proxmox server GUI [https://ipaddress:8006] and go to Disk and select new disk. In my case its /dev/nvem0n1 and click on Wipe Disk
- Next, get the details of current physical disk and volume group
root@proxmoxa:~# pvs
PV VG Fmt Attr PSize PFree
/dev/sda3 pve lvm2 a-- <930.51g 16.00g
- Here you can see my physical disk is called
/dev/sda3
- we can get the attributes associated with this disk by running
pvdisplay
root@proxmoxa:~# pvdisplay
--- Physical volume ---
PV Name /dev/sda3
VG Name pve
PV Size 930.51 GiB / not usable 4.69 MiB
Allocatable yes
PE Size 4.00 MiB
Total PE 238210
Free PE 4096
Allocated PE 234114
PV UUID wPGkT3-NF8A-Eu5R-ndDM-q6Az-mhVC-7GbQtF
- From the above output you can see that my volume group name is pve and it has /dev/sda3 as its physical disk. Next we will look at the volume group (VG) information.
- For VG information we can use vgs & vgdisplay commands
- Pay attention to Alloc PE / Size which is <914.51 GiB. Once we create physical disk and extend our VG, you should see updated size.
root@proxmoxa:~# vgs
VG #PV #LV #SN Attr VSize VFree
pve 1 3 0 wz--n- <930.51g 16.00g
root@proxmoxa:~# vgdisplay
--- Volume group ---
VG Name pve
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 7
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 3
Open LV 2
Max PV 0
Cur PV 1
Act PV 1
VG Size <930.51 GiB
PE Size 4.00 MiB
Total PE 238210
Alloc PE / Size 234114 / <914.51 GiB
Free PE / Size 4096 / 16.00 GiB
VG UUID elhmJ6-0XtV-1cOf-W6L7-mZ1J-fkVW-5kXALl
- Now get the details about our new disk. Run
fdisk -l | grep '^Disk /dev/'
- From our output you can see we have
/dev/sda
which is our existing disk.dev/nvme0n1
is the one I added, this is our new disk - run the
lvmdiskscan
to see the disk that are currently available
root@proxmoxa:~# fdisk -l | grep '^Disk /dev/'
Disk /dev/sda: 931.51 GiB, 1000204886016 bytes, 1953525168 sectors
Disk /dev/nvme0n1: 1.86 TiB, 2048408248320 bytes, 4000797360 sectors
Disk /dev/mapper/pve-swap: 8 GiB, 8589934592 bytes, 16777216 sectors
Disk /dev/mapper/pve-root: 96 GiB, 103079215104 bytes, 201326592 sectors
# another option is to use the lvmdiskscan
root@proxmoxa:~# lvmdiskscan
/dev/nvme0n1 [ 1.86 TiB]
/dev/sda2 [ 1.00 GiB]
/dev/sda3 [ 930.51 GiB] LVM physical volume
0 disks
2 partitions
0 LVM physical volume whole disks
1 LVM physical volume
- Next step is to create physical volume on our new disk
/dev/nvme0n1
- when run the
lvmdiskscan
again afterpvcreate
command you will notices that we see two LVM physical volumes
root@proxmoxa:~# pvcreate /dev/nvme0n1
pvcreate /dev/nvme0n1
Physical volume "/dev/nvme0n1" successfully created.
# run the lvmdiskscan again
root@proxmoxa:~# lvmdiskscan
/dev/nvme0n1 [ 1.86 TiB] LVM physical volume
/dev/sda2 [ 1.00 GiB]
/dev/sda3 [ 930.51 GiB] LVM physical volume
0 disks
1 partition
0 LVM physical volume whole disks
2 LVM physical volumes
- Next, add the newly created physical volume
/dev/nvme0n1
to our volume grouppve
root@proxmoxa:~# vgextend pve /dev/nvme0n1
Volume group "pve" successfully extended
- Next, extend the
/dev/pve/data
root@proxmoxa:~# lvmdiskscan
/dev/nvme0n1 [ 1.86 TiB] LVM physical volume
/dev/sda2 [ 1.00 GiB]
/dev/sda3 [ 930.51 GiB] LVM physical volume
0 disks
1 partition
0 LVM physical volume whole disks
2 LVM physical volumes
root@proxmoxa:~# lvextend /dev/pve/data -L +1.86TB
Rounding size to boundary between physical extents: 1.86 TiB.
Size of logical volume pve/data_tdata changed from 794.30 GiB (203342 extents) to <2.64 TiB (690930 extents).
Logical volume pve/data successfully resized.
- Next, verify the volume group is extended to new size in our case it should be around
2.6TiB
- Alloc PE / Size 2.75 TiB
root@proxmoxa:~# vgdisplay
--- Volume group ---
VG Name pve
System ID
Format lvm2
Metadata Areas 2
Metadata Sequence No 9
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 3
Open LV 2
Max PV 0
Cur PV 2
Act PV 2
VG Size 2.77 TiB
PE Size 4.00 MiB
Total PE 726588
Alloc PE / Size 721702 / 2.75 TiB
Free PE / Size 4886 / <19.09 GiB
VG UUID elhmJ6-0XtV-1cOf-W6L7-mZ1J-fkVW-5kXALl