Quantcast
Channel: FedoraForum.org
Viewing all articles
Browse latest Browse all 36122

LVM -- Some Scenarios & General Questions

$
0
0
Hi everyone, newcomer to this forum, and Fedora in general, and I have a few questions on LVM, so please bear with me if I am asking something stupid.

I am trying to get my head around LVM and how it works. I have read articles and tutorials around the net and I am struggling to understand most of how it works. What is clearly evident is that it is quite difficult to work with without the GUI. The GUI helps, but when you are trying to resize your root VG, or specifically the bits within it, you need to use the rescue disc.

To help me understand LVM better, I have two questions, and some scenarios I would like to pose to see how they would be handled for reference. I apologise if I have the terminology wrong, I am still somewhat of a novice in LVM-world.

So, the questions.

First question: Why would you use LVM over static partitioning, and vice versa?

Second question: I have Fedora installed on a small experimental VirtualBox machine to play around with LVM before I commit to using LVM. As such I have several scenarios to ask thoughts on.

Firstly, I am using a basic layout, which the installer does. Something like this:

sda1 (boot partition)
sda2 (LVM partition)
\- lvm_vg
|--- lvm_swap (swap space)
\--- lvm_root (maps to /)

Scenario 1: The default setup is to use all the available space. Let us assume for this scenario, I want to reduce sda2, lets say by 30GB to allow me to multi-boot another operating system -- for example, Windows, or another linux distro. How would I do that?

Scenario 2: I image this layout -- let us assume it 100GB disk and dump it onto another disc, 500GB in size. The image only goes up to 100GB, so there is 400GB of free space. How do I expand the LVM partition to make use of the space. Can I put all of the free space into the root LV? Can I put some of the space into the swap and some into the root LV? How would I do these?

Scenario 3: Can I add another LV and map that to a mount point? For example, even though root (/) is mapped to lvm_root, can I have the mountpoint /home/ mapped to another LV, like this:

sda1 (boot partition)
sda2 (LVM partition)
\- lvm_vg
|--- lvm_swap (swap space)
|--- lvm_root (maps to /)
\--- lvm_home (maps to /home/)

Scenario 4: Is it possible to have an encrypted space as a PV, but not the whole VG, so the data being read or written to/from that space is encrypted/decrypted on the fly? If so, how do I do it? So something like:

sda1 (boot partition)
sda2 (LVM partition)
\- lvm_vg
|--- lvm_swap (swap space)
\--- lvm_root (maps to /)
sda3 (LVM partition, encrypted)
\- lvm_vg
\--- lvm_encryptedhome (maps to /home/encrypteduser)


Scenario 5: At the moment, the swap partition is before the root. What if the swap was after the partition, like this:

sda1 (boot partition)
sda2 (LVM partition)
\- lvm_vg
|--- lvm_root (maps to /)
\--- lvm_swap (swap space)
sda3 (LVM partition, encrypted)

And I wanted to move it to before the root partition. How would I do that? Also, how would I resize the swap -- either whilst moving it, or separately?

Viewing all articles
Browse latest Browse all 36122

Trending Articles