If you want to create three Logical Volumes (LVs) of sizes 1TB, 1TB, and 5TB on a single Volume Group (VG) for each disk, here’s how you can do it step by step.
# Create directories for each LV and mount them: sudo mkdir -p /mnt/nvme0/lv1 /mnt/nvme0/lv2 /mnt/nvme0/lv3 sudo mkdir -p /mnt/nvme1/lv1 /mnt/nvme1/lv2 /mnt/nvme1/lv3 sudo mkdir -p /mnt/nvme2/lv1 /mnt/nvme2/lv2 /mnt/nvme2/lv3
sudo mount /dev/vg_nvme0/lv1 /mnt/nvme0/lv1 sudo mount /dev/vg_nvme0/lv2 /mnt/nvme0/lv2 sudo mount /dev/vg_nvme0/lv3 /mnt/nvme0/lv3
sudo mount /dev/vg_nvme1/lv1 /mnt/nvme1/lv1 sudo mount /dev/vg_nvme1/lv2 /mnt/nvme1/lv2 sudo mount /dev/vg_nvme1/lv3 /mnt/nvme1/lv3
sudo mount /dev/vg_nvme2/lv1 /mnt/nvme2/lv1 sudo mount /dev/vg_nvme2/lv2 /mnt/nvme2/lv2 sudo mount /dev/vg_nvme2/lv3 /mnt/nvme2/lv3
7. Persist the Mounts
1 2 3 4 5 6 7 8 9 10 11 12
# Add the mounts to /etc/fstab for automatic remounting on boot: echo '/dev/vg_nvme0/lv1 /mnt/nvme0/lv1 xfs defaults 0 0' | sudo tee -a /etc/fstab echo '/dev/vg_nvme0/lv2 /mnt/nvme0/lv2 xfs defaults 0 0' | sudo tee -a /etc/fstab echo '/dev/vg_nvme0/lv3 /mnt/nvme0/lv3 xfs defaults 0 0' | sudo tee -a /etc/fstab
echo '/dev/vg_nvme1/lv1 /mnt/nvme1/lv1 xfs defaults 0 0' | sudo tee -a /etc/fstab echo '/dev/vg_nvme1/lv2 /mnt/nvme1/lv2 xfs defaults 0 0' | sudo tee -a /etc/fstab echo '/dev/vg_nvme1/lv3 /mnt/nvme1/lv3 xfs defaults 0 0' | sudo tee -a /etc/fstab
echo '/dev/vg_nvme2/lv1 /mnt/nvme2/lv1 xfs defaults 0 0' | sudo tee -a /etc/fstab echo '/dev/vg_nvme2/lv2 /mnt/nvme2/lv2 xfs defaults 0 0' | sudo tee -a /etc/fstab echo '/dev/vg_nvme2/lv3 /mnt/nvme2/lv3 xfs defaults 0 0' | sudo tee -a /etc/fstab