Newly Added Physical Hard Drive and Local Storage Method in PVE 6.x

Publish: 2022-10-09 | Modify: 2022-10-09

Recently, I added a 2.5-inch SATA hard drive to my Tianbao Mini Host. After installing the hardware, I need to add it to PVE 6.x for virtual machine usage. Here is a brief guide on how to do it.

Creating LVM Physical Volume and Volume Group

First, use the fdisk -l command to find the newly added hard drive, for example, /dev/sda in my case.

Next, partition the hard drive by running the command: fdisk /dev/sda, and enter:

# Create a GPT partition table
Command (m for help): g
# Create a new partition
Command (m for help): n
# Press Enter for the defaults
# When you see this, enter 't' to change the partition type
Command (m for help): t
# When you see this, enter '31' to convert it to an LVM volume
Partition type (type L to list all types): 31
# Then save by entering 'w'
Command (m for help): w

Continue to create the physical volume:

pvcreate /dev/sda1

Continue to create the volume group:

# vg2-pve is the name of the volume group, you can modify it
vgcreate vg2-pve /dev/sda1

Adding Storage in PVE 6.x

Then, in "PVE 6.x backend - Datacenter - Storage - LVM", add the new storage. This way, when adding a hard disk to a virtual machine, you can select it.

This article partially references: PVE Add Physical Hard Disk Operation Notes


Comments