If you have different needs and are already in a position where you are starting again then of course you can make different choices. Unde the traditional partioning model, it is extremely difficult to resize or move a partition on a running system. Generally it requires an outage, or risks data loss. LVM solves those issues. If you need an extremely storage are, you can use LVM to expand a logical volume across multiple disks.
There are arguments for and against having differnt partions for different sub-directories. I have done both. One of the issues that arises is growth of a filesystem beyond the capacity of its partition.
While there are somewhat safe options in some cases, LVM provides a safe path to expanding partions logical volumes on a running system. There are lots of options for swap, but generally you want to be able to swap quickly.
Fortunately, modern memory management relies less on swapping processes and more on paging. Accessing a swap file will normally have a higher overhead than accessing a swap partition or logical volume. This is less of a consideraion on systems with sufficient memory to avoid active use of the swap space.
While in some cases LVM may increase the overhead in finding the location of a block on disk, a contiguous logical volume on a sigle disk should have the same overhead as a partition. In the cases where LVM does increase the overhead, other trade-offs may provide better file system performance. Understanding the trade-offs should be part of the planning process for using a more complicated LVM configuration.
Sign up to join this community. The best answers are voted up and rise to the top. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Learn more. Why use LVM? 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. As we have already mentioned that the concept of using LVM is very much similar to virtualization; therefore, its working is also more or less the same as virtualization.
We will try to understand the working of LVM by creating an example scenario. Generally, we have a physical device that is divided into multiple partitions. All these partitions have a file system installed on them which can be used to manage these partitions. However, we know that we can have multiple physical devices as well rather than having just a single physical device.
In this case, each of these physical devices has its own partitions and the respective file systems. The management of all of these partitions can become a mess if handled as it is. This is where the concept of logical volume management comes into play. It allows you to aggregate all the partitions of different physical devices into a single logical volume group from where they can be managed centrally. This volume group is a combination of used and unused disk space.
Note : XFS filesystems are not actually shrunk. Instead, back up the content and then restore it to a newly-resized LV. You can use the xfsdump utility to accomplish this. The ext4 filesystem can be reduced. That's the filesystem I focus on in this section. As we saw above with extending the filesystem, the volume must be unmounted.
The exact command will vary depending on your LV name. Next, use the resize2fs command to reduce the filesystem size. It is recommended that you run fsck on ext4 filesystems before shrinking them.
It is also recommended that you back up the data on the LV in case something unexpected occurs. Note : You cannot shrink a filesystem to a size smaller than the amount of data stored on it. Use the lvreduce command to shrink the storage space allocated to the LV. This returns the potential storage capacity to the VG. It is critical to realize that the above command sets the sales-lv at 2T. It does not remove two terabytes from the existing LV. It configures the LV at two terabytes.
It is possible to tell lvreduce to subtract an amount of space from the existing capacity by using a very similar command:. In this case, I added a - dash before the 2T size, indicating I want that quantity of space subtracted from the existing sales-lv capacity. The difference between the two commands is small but important. You now have the returned capacity to the VG for use in another LV. You can use the extend commands discussed earlier to reallocate this capacity. The VG can also be shrunk.
Capacity can also be easily reallocated with LVM. You can reduce capacity in one VG and add it to another. This is accomplished by shrinking the filesystem and then removing the LV from the VG.
Let's say you have a server with 10 TB of capacity. Using the above processes, you have created two LVs of 5 TB each. This is far more flexibility than traditional partitioning offers. LVM also supports RAID configurations, mirroring, and other advanced settings that make it an even more attractive solution. Take a skills assessment today.
Logical Volume Manager is a great way to add flexibility to your storage needs, and it's really not much more complicated than traditional drive management. There is great documentation at Red Hat's site , and the official training courses cover it very effectively, as well.
One of the things that I appreciate about LVM is the logical command structure. 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
0コメント