Managing LVM Volume Groups: Setup and Configuration
LVM (Logical Volume Manager) lets you combine multiple physical disks into flexible storage pools. This guide covers creating a volume group from multiple disk partitions—a common setup for servers that need flexible storage allocation across Xen guests, databases, or other demanding workloads.
Prerequisites
This assumes you have two or more unformatted disk devices available. In this example, we’ll use /dev/sdb and /dev/sdc. Identify your disks using:
lsblk
or for more detail:
sudo fdisk -l
Warning: The commands that follow will overwrite partition tables. Double-check device names before proceeding. Misidentifying devices can result in data loss.
Creating Partitions
Use fdisk or parted to partition your disks. For /dev/sdb:
sudo fdisk /dev/sdb
Inside the fdisk prompt:
- Press
nto create a new partition - Select
pfor primary (orefor extended if needed) - Choose partition number (usually
1) - Accept default first sector
- For last sector, press Enter to use the entire remaining space (or specify a size like
+500G) - Press
wto write and exit
For modern systems, parted is often cleaner:
sudo parted /dev/sdb mklabel gpt
sudo parted /dev/sdb mkpart primary 0% 100%
Repeat for /dev/sdc:
sudo fdisk /dev/sdc
Verify the new partitions exist:
lsblk
You should see /dev/sdb1 and /dev/sdc1.
Initialize Partitions for LVM
Before creating the volume group, mark these partitions as LVM physical volumes:
sudo pvcreate /dev/sdb1 /dev/sdc1
Verify physical volumes were created:
sudo pvs
Output will show device name, size, and allocation status.
Create the Volume Group
Combine the physical volumes into a single volume group. We’ll call it vg_xen:
sudo vgcreate vg_xen /dev/sdb1 /dev/sdc1
Check the new volume group:
sudo vgs
You’ll see the total size (sum of both physical volumes minus LVM metadata overhead), free space, and extent information.
Activate the Volume Group
On modern systems, vgcreate automatically activates the group. On boot, LVM should be enabled by default. To manually activate:
sudo vgscan --mknodes
sudo vgchange -ay vg_xen
Verify activation:
sudo lvs
Extending the Volume Group
If you add a third disk /dev/sdd later:
sudo fdisk /dev/sdd
# (create /dev/sdd1 following the same steps above)
sudo pvcreate /dev/sdd1
sudo vgextend vg_xen /dev/sdd1
Check the updated group:
sudo vgs
The total size should now reflect all three physical volumes.
Creating Logical Volumes
Once you have a volume group, create logical volumes from it:
sudo lvcreate -L 50G -n lv_xen_guest1 vg_xen
This creates a 50GB logical volume named lv_xen_guest1. It appears as /dev/vg_xen/lv_xen_guest1 or /dev/mapper/vg_xen-lv_xen_guest1.
Format and mount:
sudo mkfs.ext4 /dev/vg_xen/lv_xen_guest1
sudo mount /dev/vg_xen/lv_xen_guest1 /mnt/xen_guest1
Monitoring and Troubleshooting
Check physical volume status:
sudo pvdisplay
Display detailed volume group info:
sudo vgdisplay vg_xen
If a physical volume fails, check for missing devices:
sudo vgreduce --removemissing vg_xen
For persistent mounting across reboots, add to /etc/fstab:
/dev/vg_xen/lv_xen_guest1 /mnt/xen_guest1 ext4 defaults 0 2
Ensure the lvm2 package is installed and the lvm2 service is enabled:
sudo systemctl enable lvm2-monitor.service
sudo systemctl start lvm2-monitor.service
LVM metadata is stored at the beginning of each physical volume, so backing up your configuration is good practice:
sudo vgcfgbackup vg_xen -f /root/vg_xen.backup
2026 Comprehensive Guide: Best Practices
This extended guide covers Managing LVM Volume Groups: Setup and Configuration with advanced techniques and troubleshooting tips for 2026. Following modern best practices ensures reliable, maintainable, and secure systems.
Advanced Implementation Strategies
For complex deployments, consider these approaches: Infrastructure as Code for reproducible environments, container-based isolation for dependency management, and CI/CD pipelines for automated testing and deployment. Always document your custom configurations and maintain separate development, staging, and production environments.
Security and Hardening
Security is foundational to all system administration. Implement layered defense: network segmentation, host-based firewalls, intrusion detection, and regular security audits. Use SSH key-based authentication instead of passwords. Encrypt sensitive data at rest and in transit. Follow the principle of least privilege for access controls.
Performance Optimization
- Monitor resources continuously with tools like top, htop, iotop
- Profile application performance before and after optimizations
- Use caching strategically: application caches, database query caching, CDN for static assets
- Optimize database queries with proper indexing and query analysis
- Implement connection pooling for network services
Troubleshooting Methodology
Follow a systematic approach to debugging: reproduce the issue, isolate variables, check logs, test fixes. Keep detailed logs and document solutions found. For intermittent issues, add monitoring and alerting. Use verbose modes and debug flags when needed.
Related Tools and Utilities
These tools complement the techniques covered in this article:
- System monitoring: htop, vmstat, iostat, dstat for resource tracking
- Network analysis: tcpdump, wireshark, netstat, ss for connectivity debugging
- Log management: journalctl, tail, less for log analysis
- File operations: find, locate, fd, tree for efficient searching
- Package management: dnf, apt, rpm, zypper for package operations
Integration with Modern Workflows
Modern operations emphasize automation, observability, and version control. Use orchestration tools like Ansible, Terraform, or Kubernetes for infrastructure. Implement centralized logging and metrics. Maintain comprehensive documentation for all systems and processes.
Quick Reference Summary
This comprehensive guide provides extended knowledge for Managing LVM Volume Groups: Setup and Configuration. For specialized requirements, refer to official documentation. Practice in test environments before production deployment. Keep backups of critical configurations and data.

Dear Zhiqiang Ma,
I have small doubt, I have created Volume group(vg) and mount the vg(volume group) in /mnt and stored the some file.
It is possible to move the Vg partition to another server, Please let me know ?
Thanks for advance.
BY
Mike
Yes, you can.
This tutorials ( http://www.fclose.com/b/linux/2611/duplicating-and-backing-up-lvm-backed-xen-domu-from-a-remote-server/ ) actually includes the duplicating of a LVM partition/volume from a remote server to the local server. You can check it and ignore the parts that are related to Xen VMs.
Oh.. Thanks for your reply.