Linux Disk Setup Guide: LVM Spanning Across Two Disks (XFS)
This guide describes how to configure two new, unpartitioned disks (example: /dev/sdb and /dev/sdc) using LVM so they form a single storage pool (Volume Group) that spans both disks.
From that VG, we will create two logical volumes, format them with XFS, and mount them persistently.
1. Identify the New Disks
lsblk
Verify /dev/sdb and /dev/sdc are unused:
sudo fdisk -l /dev/sdb
sudo fdisk -l /dev/sdc
2. Create LVM Partitions on Both Disks
Repeat this process for both disks: /dev/sdb and /dev/sdc.
For each disk:
sudo fdisk /dev/sdb
Inside fdisk:
n # new partition
p # primary
1 # partition number
<enter> # default start
<enter> # default end (use full disk)
t # change type
8e # Linux LVM
w # write and exit
Repeat for /dev/sdc:
sudo fdisk /dev/sdc
Afterward, you should have:
/dev/sdb1/dev/sdc1
Both with partition type 8e (Linux LVM).
3. Create Physical Volumes (PVs)
sudo pvcreate /dev/sdb1
sudo pvcreate /dev/sdc1
Verify:
sudo pvs
4. Create a Volume Group (VG) that Spans Both Disks
Example VG name: vg_storage
sudo vgcreate vg_storage /dev/sdb1 /dev/sdc1
Verify:
sudo vgs
The VG now spans two physical disks.
5. Create Logical Volumes (LVs)
Here we will create two logical volumes inside the shared Volume Group.
Option A — Define specific sizes
Example:
sudo lvcreate -L 100G -n lv_data1 vg_storage
sudo lvcreate -L 200G -n lv_data2 vg_storage
Option B — Use all remaining space for LV2:
sudo lvcreate -L 100G -n lv_data1 vg_storage
sudo lvcreate -l 100%FREE -n lv_data2 vg_storage
Verify:
sudo lvs
Logical volumes created:
/dev/vg_storage/lv_data1/dev/vg_storage/lv_data2
6. Format Logical Volumes With XFS
Install XFS tools if required:
sudo yum install xfsprogs # RHEL/CentOS/Rocky
sudo apt install xfsprogs # Ubuntu/Debian
Format:
sudo mkfs.xfs /dev/vg_storage/lv_data1
sudo mkfs.xfs /dev/vg_storage/lv_data2
7. Create Mount Points
sudo mkdir -p /mnt/data1
sudo mkdir -p /mnt/data2
8. Mount the Logical Volumes
sudo mount /dev/vg_storage/lv_data1 /mnt/data1
sudo mount /dev/vg_storage/lv_data2 /mnt/data2
Verify:
df -h | grep data
9. Configure Persistent Mounting via /etc/fstab
9.1 Get UUIDs
sudo blkid /dev/vg_storage/lv_data1
sudo blkid /dev/vg_storage/lv_data2
9.2 Add entries to /etc/fstab
sudo nano /etc/fstab
Add lines:
UUID=<uuid1> /mnt/data1 xfs defaults 0 0
UUID=<uuid2> /mnt/data2 xfs defaults 0 0
Test:
sudo mount -a
If no errors appear, configuration is correct.
10. Reboot and Verify
sudo reboot
Then:
df -h | grep data
Both logical volumes should mount automatically.
Final Architecture Overview
Disk 1 → /dev/sdb1 (LVM PV)
Disk 2 → /dev/sdc1 (LVM PV)
\ /
\ /
\__________/
Volume Group (vg_storage)
├── Logical Volume: lv_data1 → XFS → /mnt/data1
└── Logical Volume: lv_data2 → XFS → /mnt/data2
The VG spans both disks, allowing LV sizes to grow beyond a single disk.