Add new disk to Proxmox VM

Adding a new disk to an Ubuntu VM running on Proxmox can be achieved as follows:

  1. Click on the VM -> Hardware -> Add "Hard Disk". I always choose cahce or writeback for improved performance. Reboot your VM
  2. Run lsblk and you should see the new disk
  3. Create a new partition used gparted. The reason why we chose gparted is because fdisk only allows paritions of 2TB and we needed a 14TB partition:
gparted /dev/sdb
mklabel gpt
mkpart primary 0.00TB 14.00TB
quit

4. We use LVM to manage to the disk for simplicity. Create the physical volume:

pvcreate /dev/sdb1

5. Create the volume group:

vgcreate vgpool /dev/sdb1

6. Create the logical volume:

lvcreate -L 12.5TB -n logicalvolume vgpool

7. Format the logical volume:

mkfs -t ext4 /dev/vgpool/logicalvolume

8. Mount the logical volume:

mkdir /mnt/stuff
mount -t ext4 /dev/vgpool/logicalvolume /mnt/stuff

9. Mount the logical volume in fstab to persist reboots.

nano /etc/fstab

Paste the following:

/dev/vgpool/logicalvolume /mnt/stuff ext4 defaults 0 1