Adding a new SSD to PVE
· 2 min read
My Proxmox host has two SSD slots, and I have only been using one. The existing SSD has 1TB of storage, but usage is already at 80%. Thus, I decided to buy a new 2TB SSD to extend the existing lvm.
Prerequisites
- A new SSD
- Installation Tools
01 Install SSD
Installing the SSD is straightforward.
- remove the case
- Stick thermal (silicon) tape if provided
- if you only have one, prioritise the top side with metallic sticker
- Insert into slot and screw it into place
02 Setup
Find name (path, actually) of new disk
Simply click on to Disks in the GUI to find, or use the following
sudo fdisk -l
Format the disk and create partition
sudo cfdisk /dev/sda # replace /dev/sda with disk path
- Replace
/dev/sda
with your disk path - Follow the following in the TUI (use arrows and enter to navigate)
- New -> Primary -> Specify size in MB
- Write
- Quit
Create volume from new partition
sudo pvcreate /dev/sda1
- Where
/dev/sda1
is your partition name- It is commonly prefixed with your disk name, so enter your disk path and press
<tab>
might work
- It is commonly prefixed with your disk name, so enter your disk path and press
Add new volume to existing LVM
sudo vgextend pve /dev/sda1
- Where
pve
is your LVM name- Find in PVE GUI: Disks > LVM
/dev/sda1
is the new partition name
03 Expand storage size of VMs
I like to use the following command to expand my VMs, execute in the PVE console, not the device console.
qm resize 100 scsi0 32G
- Replace
100
with the VM ID - Replace
scsi0
with target hard disk - Replace
32G
with the target size (NOTE: not the size to expand, the final size after the expansion)
Then, from the console of the target VM, expand the partition to use the newly added storage space. The method varies across distributions and initialisation methods.
- Ubuntu (setup from cloud-init):
sudo apt-get install cloud-initramfs-growroot
sudo reboot
- Ref: How to increase size of an ubuntu cloud image - Super User
- Ubuntu: