Creating a LVM thin pool on two NVMe disks is a great way to provide storage for virtual machines in a Proxmox Virtualization (PV) environment. In this guide, we will show you how to create a LVM thin pool for Proxmox.
Step 1: Preparing the NVMe Disks
The first step is to ensure that the two NVMe disks are properly installed on the system and recognized by the operating system. You can use the command lsblk to list all available disks on your system. Check that you have identified the NVMe disks that you want to use for the LVM thin pool.
Step 2: Creating a Physical Volume
To create an LVM thin pool, we first need to create a physical volume on each NVMe disk.
Use the pvcreate command to create a physical volume on each NVMe disk. For example, to create a physical volume on /dev/nvme0n1, run the following command:
sudo pvcreate /dev/nvme0n1
Repeat the above step for the other NVMe disk, using its device name.
Step 3: Creating a Volume Group
After creating physical volumes, we need to create a volume group that combines them into a single logical volume.
Use the vgcreate command to create a new volume group. For example, to create a volume group called mythinpool using the two physical volumes created in step 2, run the following command:
sudo vgcreate mythinpool /dev/nvme0n1 /dev/nvme1n1
Verify that the new volume group was created by running the command sudo vgdisplay.
Step 4: Creating a Logical Volume
Now that we have a volume group, we can create a logical volume using the lvcreate command.
Use the lvcreate command to create a new logical volume. For example, to create a logical volume called mythinpool_lv with a size of 100GB, run the following command:
sudo lvcreate -L 100G -n mythinpool_lv mythinpool
Verify that the new logical volume was created by running the command sudo lvdisplay.
Step 5: Creating a Thin Pool
Now that we have a logical volume, we can create a thin pool using the lvconvert command.
Use the lvconvert command to convert the logical volume to a thin pool. For example, to convert the logical volume mythinpool_lv to a thin pool, run the following command:
sudo lvconvert –type thin-pool mythinpool/mythinpool_lv
Verify that the new thin pool was created by running the command sudo lvdisplay.
Step 6: Using the Thin Pool
- After creating the thin pool, we can now use it to store virtual machines in Proxmox.
- Open the Proxmox web interface and go to the Datacenter view.
- Click on the Storage tab and then click the Add button to add a new storage device.
- In the Add: Storage dialog box, select LVM as the storage type and enter a name for the storage device.
- In the LVM section, select the thin pool you created in step 5 as the volume group and the logical volume.
- Click the Add button to create the new storage device.
Congratulations! You have now successfully created a LVM thin pool for Proxmox Virtualization. This will provide efficient storage for your virtual machines.