If a partition becomes full, it is not easy to expand the size of the partition. Even if the partition is moved to another hard drive, the original hard drive space has to be reallocated as a different partition or not used. To learn how to configure LVM during the installation process, refer to Section Where would you like to share this to?
Twitter Reddit Hacker News Facebook. Share link Tutorial share link. Sign Up. DigitalOcean home. Community Control Panel. Hacktoberfest Contribute to Open Source. By Justin Ellingwood Published on September 14, Introduction LVM , or Logical Volume Management, is a storage device management technology that gives users the power to pool and abstract the physical layout of component storage devices for easier and flexible administration. LVM Architecture and Terminology Before we dive into the actual LVM administrative commands, it is important to have a basic understanding of how LVM organizes storage devices and some of the terminology it employs.
Physical Volumes : LVM utility prefix : pv Description : Physical block devices or other disk-like devices for example, other devices created by device mapper, like RAID arrays are used by LVM as the raw building material for higher levels of abstraction. Physical volumes are regular storage devices. LVM writes a header to the device to allocate it for management. Volume Groups : LVM utility prefix : vg Description : LVM combines physical volumes into storage pools known as volume groups.
Volume groups abstract the characteristics of the underlying devices and function as a unified logical device with combined storage capacity of the component physical volumes. Logical Volumes : LVM utility prefix : lv Description : A volume group can be sliced up into any number of logical volumes.
Logical volumes are functionally equivalent to partitions on a physical disk, but with much more flexibility. Server storage capacity has been managed via disk drive sizes and partition configurations for decades. Clearly, those strategies work well and are reliable. However, there are many benefits to rethinking storage management on local servers. It also demonstrates some basic commands for each approach.
I use the phrase traditional storage management to describe the process of partitioning, formatting, and mounting storage capacity from a basic hard disk drive. Storage space is typically managed based on the maximum capacity of individual hard disk drives.
The result is that when a sysadmin thinks about storage, they do so based on each drive. For example, if a server has three hard disk drives of 1 TB each, the sysadmin considers the storage literally, I have three 1 TB drives to work with. Use fdisk or gparted to create one or more partitions. It's important to note that the partitions cannot consume more than the total 1 TB of disk capacity.
I won't cover the syntax for fdisk in this article, but assume I created a single partition that consumes the entire 1 TB disk. Create a filesystem on the new partition by using the mkfs command. XFS filesystems can easily be extended but not reduced. I'll expand on that idea further toward the end of the article.
The rest of this process is relatively standard. First, create a directory to serve as a mount point. Next, manually mount the partition to the mount point. Use the du command to confirm the storage space is accessible and of the expected size. Note : The -h option displays the output of du in capacity terms that are easy for humans to understand, such as GB or TB. Traditional storage capacity is based on individual disk capacity.
LVM uses a different concept. Storage space is managed by combining or pooling the capacity of the available drives. With traditional storage, three 1 TB disks are handled individually. Obviously, there needs to be a storage disk available. Just as we saw above, you must physically install a drive in the server. They have identifiers and metadata that describes each PV. It is interesting to note that, as opposed to RAID, PVs do not have to be the same size or or on disks that are the same speed.
You can mix and match drive types to create PVs. These two command examples are slightly different. The first command designates partition 1 on storage disk b as a PV. The second command sets the total capacity of storage disk c as a PV. Use the vgcreate command to create a new Volume Group. The VG must have at least one member.
It creates more borders less freedom Ask Question. Asked 2 years, 3 months ago. Active 2 years, 3 months ago. Viewed 2k times. I have a linux server which runs in a VM. The hypervisor is VMWare. It is great that you can do a lot of interesting things with LVM. But why? Swapping could get done into a file. If I use one block device with one filesystem it is less likely to run out of disk space. A reboot at night is always possible. Improve this question. Anon 1, 9 9 silver badges 23 23 bronze badges.
Add a comment. Active Oldest Votes. Using LVM in general enables several features. Just a couple: Extending a volume is one step and online: lvextend --resize. Partitioning is not required. Without LVM, the common use case of resizing root fs requires downtime and probably editing partition tables from a second system.
Snapshots are always available, even without such a feature on the storage system or hypervisor. Extreme use cases may require a volume backed by more one disk LUN. Rare these days.
But might as well standardize on the more flexible LVM. Improve this answer. John Mahowald John Mahowald Yes, the flexibility it potential offers is worth a lot even if you don't actually need it.
I often encountered systems with awkward, inflexible partitioning schemes that ran into problems that could be easily fixed if the were just using LVM.
0コメント