LVM questions
LVM questions
I am planning to reinstall centos 7. One of the reasons is I did not add LMV before because did not really understand what it was and decided to go for regular partitions. I understand LMV now and I know how to create Group Volume(s) from physical volumes, logical volumes etc.
I would also like to test something and I want to leave about 10-20GB of disk space for an extra primary partition that would not be covered by LVM; I would like to install another linux distro on that partition. Later, I plan to get rid of the other system and extend /home partition. I have added a picture to illustrate what I mean:
- grey areas are primary partitions for /boot folders of two distros I would like to install
- green space is for LMV
- the group volume will be split into system folder /, swap, /home and another system folder / for the other distro.
I have two questions. If I decide to get rid of the other primary partition, is it difficult to extend the Group Volume of LMV to cover remaining free space? I would also like to remove the other yellow LV (right) and extend /home directory. Is it hard to reconfigure LVM?
The second question is about the other linux distribution. Can the other system recognise my LMV configuration I made while installing the first system, such as Group Volume and logical volumesf?
Thanks
I would also like to test something and I want to leave about 10-20GB of disk space for an extra primary partition that would not be covered by LVM; I would like to install another linux distro on that partition. Later, I plan to get rid of the other system and extend /home partition. I have added a picture to illustrate what I mean:
- grey areas are primary partitions for /boot folders of two distros I would like to install
- green space is for LMV
- the group volume will be split into system folder /, swap, /home and another system folder / for the other distro.
I have two questions. If I decide to get rid of the other primary partition, is it difficult to extend the Group Volume of LMV to cover remaining free space? I would also like to remove the other yellow LV (right) and extend /home directory. Is it hard to reconfigure LVM?
The second question is about the other linux distribution. Can the other system recognise my LMV configuration I made while installing the first system, such as Group Volume and logical volumesf?
Thanks
- Attachments
-
- lvm50.png (4.26 KiB) Viewed 1555 times
Re: LVM questions
Don't do that. You are betting yourself for a world of hurt.FranekW wrote:- the group volume will be split into system folder /, swap, /home and another system folder / for the other distro.
Do not share PVs between different installs (therefore, do not share VGs and/or LVs between different installs).
If you are using a MBR-style partition table, it would be better to do this:
sda1, primary -> /boot for Distro-1
sda2, primary -> /boot for Distro-2
sda3, primary -> PV for LVM for Distro-1
sda4, primary -> PV for LVM for Distro-2
Then, when you are done testing Distro-2, just add sda2 and sda4 as additional PVs to the VG for Distro-1, and grow some LV of Distro-1 to use that free space.
Re: LVM questions
Thanks for pointing out the issue with different systems using the same LVM.
I tested LVM in CentOS 7 installed in virtual box with LVM. I only tested how to extend space, so I added a new virtual drive, created PV, then extended both Volume Group and then LV. It seems easy to do
I tested LVM in CentOS 7 installed in virtual box with LVM. I only tested how to extend space, so I added a new virtual drive, created PV, then extended both Volume Group and then LV. It seems easy to do
Re: LVM questions
Yes, it's very easy to do once you get the hang of it.FranekW wrote:Thanks for pointing out the issue with different systems using the same LVM.
I tested LVM in CentOS 7 installed in virtual box with LVM. I only tested how to extend space, so I added a new virtual drive, created PV, then extended both Volume Group and then LV. It seems easy to do
I guess that you also did a resize2fs afterwards, in order to grow the filesystem(s) residing on the already grown LV, right?
Going the other way (i.e., reducing the space consumed by LVM) is also possible, but much more involved because the resize2fs can only to operate off-line when reducing filesystems. Luckily, reducing the space consumed by LVM is not a common real-world need.
-
- Posts: 2019
- Joined: 2015/02/17 15:14:33
- Location: Bulgaria
- Contact:
Re: LVM questions
Resizing logical volumes is far safer if you use the '-r' option.
For example, lvreduce will even ask you to 'umount' the volume before proceeding further.
For example, lvreduce will even ask you to 'umount' the volume before proceeding further.
Re: LVM questions
Yes, I have used resize2fs. I followed a blog and this command was the last to execute. I had to check other websites to make sure this would need to be run. I was surprised by the last step. I did not know about changing file systems explicitly after changing size of a partition. I also read resize2sf should be run first if we going to shrink partitions.InitOrNot wrote:I guess that you also did a resize2fs afterwards, in order to grow the filesystem(s) residing on the already grown LV, right?
Going the other way (i.e., reducing the space consumed by LVM) is also possible, but much more involved because the resize2fs can only to operate off-line when reducing filesystems. Luckily, reducing the space consumed by LVM is not a common real-world need.
thanks for the cluehunter86_bg wrote:Resizing logical volumes is far safer if you use the '-r' option.
For example, lvreduce will even ask you to 'umount' the volume before proceeding further.
EDIT.
I have just read on Unix & Linux SE website about '-r' option. It seems the best way to do as it automatically resizes a file system. 'lvextend' does not have it, though.
Last edited by FranekW on 2017/06/21 09:26:34, edited 1 time in total.
Re: LVM questions
lvextend has a -r option.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke
Re: LVM questions
Thanks. Yes, it does. I was not at computer while writing the last post and found some strange man website regarding 'lvextend'.