Working with LVM (Large Volume Management)

2 réponses [Dernière contribution]
strypey
Hors ligne
A rejoint: 05/14/2015

We recently had a discussion about LVM as a tangent on another thead, started by me saying:
"Finally, if you let them do automatic partitioning, some GNU-Linux distros will create LVM partitions. In theory, these make it easier to resize partitions etc, but GParted doesn't seem to be able to work with them, and I've found them to be a headache. Before using LVM as part of a production system, I suggest setting up some LVM partitions on a spare drive and getting confident with the commands that work with them."
https://trisquel.info/en/forum/how-do-i-stop-distro-hopping#comment-122645

When I installed Trisquel 7 on my desktop box (click my avatar and scroll down for the specs), I let the installer do the partitioning. Here's the partition scheme I ended up with (see attached file for screenshot of Gparted where I got this info):
- ext4 primary partition: 18.63GB
- extended partition: 130.38GB (the rest of the disk)
- lvm2 pv "partition": 130.38GB (same size as the extended)

A few points to note:
- the LVM "partition" is mounted as /home
- no swap partition has been created (although there may be swap space configured in the primary partition?)
- the scare quotes around "partition" are there because in the discussion that follow on from my comment above, Magic Banana insisted this is not a partition, despite the fact that it appears to behave like one (listed in GParted as a partition, takes up space on disk etc).

So, let's say I want to carve off some space to install a second OS. Normally I would simply use GParted (or its underlying command-line tool GNU Parted) to resize a partition with sufficient free space, and create my new partition(s). But GParted doesn't know how to resize LVM "partitions", and neither does it know how to delete them. My understanding of what the Trisquel installer has done is that it has added the extended partition to LVM as a "Physical Volume" (thus the "pv"), effectively making it an LVM partition that can only be managed with LVM tools. Here are some n00b-friendly instructions for working with LVM using the command-line, which I've found helpful when I end up in this situation:
https://www.howtogeek.com/howto/40702/how-to-manage-and-use-lvm-logical-volume-management-in-ubuntu/

Mangy Dog pointed out this tool on the thread linked above, which I'm going to try out now:
"There's a pretty good graphical utility for configuring your Logical Volumes, this tool helps to understand (not that easy !) and visualize these LVM Volumes :

--system-config-lvm
"

Pièce jointeTaille
Screenshot from 2017-11-13 18:12:15.png88.99 Ko
strypey
Hors ligne
A rejoint: 05/14/2015

So I tried to use the --system-config-lvm utility that Mangy Dog suggested. I have no idea how to start, and after about half an hour of web searches I'm none the wiser. Is this a program, or a tool within another program that I have to use it with? Is it part of Trisquel 7, or do I need to install it first? Help?

Magic Banana

I am a member!

I am a translator!

Hors ligne
A rejoint: 07/24/2010

It is a separate program. Install the package named "system-config-lvm". Here is documentation about it: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/storage_administration_guide/s1-system-config-lvm

Here is how to create an LVM2 Logical Volume for swap (through commands in a terminal, i.e., without "system-config-lvm"): https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/storage_administration_guide/ch-swapspace#swap-creating-lvm2