PDA

View Full Version : LVM and another Linux Install


pythagorean
1st September 2010, 04:38 PM
I have been using Ubuntu for about a year and I decided to switch to Fedora just to see how it goes with getting everything in my system working again. I would say that with Ubuntu and Fedora installations I have installed and reinstalled 15 times, which I mention because I am not new to installing linux. I have used GParted to partition and resize my HD numerous times and reinstalled linux on a partition and so on. I know how to do all of that without any problems.

NOW HERE IS WHAT HAPPENED... I installed Fedora on my Desktop which I had partitioned into a 190 GB partition onto which Windows is installed and then I had another 30 GB partition onto which I chose to install Fedora. I chose the "replace existing Linux systems" in anaconda... and what resulted was a 30 GB partition with Fedora that is now showing up as LVM. I have never seen an LVM partition and I am not sure if I can use GPARTED to resize it without destroying it. I have used GPARTED to resize Linux partitions before, but they were never showing up as LVM. The forums on GPARTED only show info from about a year or two ago.

Here is what I want to do (and reading around on forums doesn't really give a good explanation of whether it is possible)...

Is it possible to install Linux Mint into that 30 GB Fedora LVM partition by just resizing the Fedora part of the volume? So, the question is this:

How can I resize the Fedora part of the LVM volume and then install Mint into that LVM partition?

If Fedora was on an ordinary 30 GB partition I would have no problem with using GPARTED to chop that in half and then use the 15 GB I freed up to install Mint. I just don't want to destroy the Fedora stuff by messing around the with the LVM partition so I would like to hear from others who have worked around this issue and please don't link to the ordinary LVM howto's you get through a simple google search as I have already read them and I don't find them too illuminating.

plarsen
1st September 2010, 06:10 PM
Yes - LVM is default with Fedora. And there's good reasons for that. Instead of fighting LVM, take a little time to learn how to use it. It'll save you a lot of time and give you the flexibility you need as you move forward.

LVM moves you away from physical partitions - so no more gparted. That said, you must ensure that what-ever you use to mount/use your LVM is all LVM2 and about the same release or you may encounter funny problems. But there's nothing wrong in having multiple linux installations in a dual-boot configuration use the same VG.

If you have free space on your hdd, you can add that to your VG. Then you simply add LVs for each system you want on there. Btw. remember you need a boot partition (real partition) on there regardless for (legacy) grub. Each LV is your "partition" that you install on. The VG represents your storage in a logical way. It can be comprised of many physical devices but it presents the space as a single logical unit. That way when you add another HDD you don't really have to worry how to expand your partitions or how to split your data storage. It's all one nice big logical storage pool.

To add the additional space, simply create a physical partition that makes up the rest of your hdd. Then pvcreate it, and then do a vgextend to add it to your VG. That's it. Even if the partitions aren't contiguous your system will present the space as contiguous.

If you DO NOT have the space, and need to take some of the 30G away from Fedora and give it to another system, you resize the LV. Remember to first resize the file system and since you're reducing it, you have to use your recovery mode to do that. After the filesystem is resized, you resize the LV. Then you create another LV for the other system and install to that using it's LVM aware installer. That should be it.

pythagorean
1st September 2010, 06:50 PM

Very thoughtful reply and I appreciate it. I was mostly just curious about whether you could put another OS into the LVM partition with Fedora once LVM took the whole partition over. I have Windows 7 on a 270 GB partition and then I have a 30 GB partition (now) that I put Fedora into. But I really don't need 30 GB for a Linux system. I usually keep Linux in a 10 GB partition... so I guess I am going to try to create some space inside that LVM and put another Linux distro in there.

It was all just simpler when I was able to use GParted. Learning curve.

plarsen
1st September 2010, 09:51 PM
I thought I covered that. Yes, you can definitely share the LVM between two linux distributions. The only "butt" here is the LVM version supported by the two distributions. If they are fairly close and you're not doing anything special (a default install doesn't) you can definitely do that.

To make that happen, reduce the size of the LV you have fedora on currently - and as I pointed out, you'll have to resize the FS from a recovery mode where the FS is not active because you're reducing it's size. Once done, you do an "lvreduce" or "lvresize" so reduce the LV for that file system to fit the new smaller FS, and you now have room to add another LV for any other thing you feel like.

SlowJet
3rd September 2010, 10:22 PM
I do not think LVM was designed to be used by more than one version of Linux per PV-VG-LV combonations. There are now many deps on LVM2 for keeping the f/s's sync'd and clean.

LVM2 is updated a few times during each FN.

LVM stands for Logical Volume Manager. The PV (Physical Volume is the only piece that uses the disk partion, but is meant to use the whoule disk and therefore no partition is needed (grub2 needs to be available to boot from an LV to get around this problem for EXT4, BTRFS will be another animal to tame, coming soon.)

Custom partitioning can be seclected during install and all the tools needed to create, delete, edit partitions, LVM parts, formatting is available, sizing, f/s type is available with mouse and edit boxes, dropdown lists.

Piece of cake, easy as pie.

SJ

plarsen
3rd September 2010, 10:33 PM
The LVM doesn't deal with file systems at all. It's just a device mapper. It translates disk addresses that's it. As long as the two OSes are not running concurrently, as long as it's LVM2 and you're pretty close on the minor release, there shouldn't be an issue. Now, if you add snapshots, mirroring or striping - yeah, you're asking for trouble trying to manage that across OSes and LVM releases.

You're quite right - LVM is optional. But not choosing it should be done very carefully. It makes life a lot easier when it comes to managing your disk space and allocation.

SlowJet
3rd September 2010, 10:43 PM
I think you are guessing, but yes, the VG and PV may stay compatible for some time across 2 versions of Fedora, but when it changes, game over for the old FN-x LV's.
(Lately, LVM has not been compatable across f12, f13, or f14 or f15.)
Probaly why there can be multiple PV / disk.

SJ