Proxmox – LVM-thin setup

To ensure you start from a formatted disk, the first step is to wipe any existing partition tables and data headers. Then, you’ll proceed with the LVM steps.

Assuming your new 3TB disk is identified as /dev/sdb (you must verify this with lsblk before proceeding), here is the complete, start-to-finish list of commands.


Complete Storage Setup for /dev/sdb

These commands will wipe the disk, set up the LVM structure, split the space into a 2.5TB LVM-Thin pool for VMs, and use the remaining space for a mounted Directory store.

Phase 1: Prepare the Disk and Create the Volume Group

StepCommandDescription
1. Wipe Disksudo wipefs -a /dev/sdbClears all existing signatures (partitions, filesystems, LVM) from the disk. Double-check the device name (/dev/sdb) first!
2. Create PVsudo pvcreate /dev/sdbInitializes the whole disk as a Physical Volume (PV) for LVM.
3. Create VGsudo vgcreate newvg /dev/sdbCreates a Volume Group (VG) named newvg using the entire new PV.

Phase 2: Create Logical Volumes (LV)

We now divide the space in the newvg pool.

StepCommandDescription
4. Create LVM-Thin Poolsudo lvcreate -L 2.5T -T -n vm_thin_pool newvgCreates the 2.5TB LVM-Thin Pool for your VM disk images.
5. Create Directory LVsudo lvcreate -l 98%FREE -n dir_store_lv newvgCreates a standard LV using 98% of the remaining free space (approx. 500GB) for file storage.

Phase 3: Prepare Directory Storage for Proxmox

The standard LV needs a filesystem and a permanent mount point.

StepCommandDescription
6. Format LVsudo mkfs.xfs /dev/newvg/dir_store_lvFormats the Directory LV with the XFS filesystem.
7. Create Mount Pointsudo mkdir -p /mnt/directory_storeCreates the specific location where the LV will be accessed on the Proxmox host.
8. Mount LVsudo mount /dev/newvg/dir_store_lv /mnt/directory_storeMounts the newly formatted LV.
9. Add to Fstab`echo “/dev/newvg/dir_store_lv /mnt/directory_store xfs defaults 0 2”sudo tee -a /etc/fstab`

Final Step: Configure in Proxmox GUI

After running the commands above, you must configure the storage pools in the Proxmox web interface:

  1. Go to Datacenter > Storage.
  2. Add the LVM-Thin Pool (Block Storage):
    • ID: New-VM-Storage
    • Volume Group: newvg
    • Thinpool: vm_thin_pool
    • Content: Check Disk image and Container.
  3. Add the Directory Storage (File Storage):
    • ID: File-Store
    • Directory: /mnt/directory_store (the mount point you created)
    • Content: Check ISO image, VZDump backup file, and Container template.


Posted

in

by

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.

This site uses Akismet to reduce spam. Learn how your comment data is processed.