Extra data partition (LVM or not)

Place to discuss Fedora and/or Red Hat
Post Reply
insomnia
programmer
programmer
Posts: 123
Joined: Thu Feb 05, 2004 6:58 pm
Location: Belgium, Antwerp

Extra data partition (LVM or not)

Post by insomnia » Tue Jan 16, 2007 8:56 pm

I have to wipe a windows partion at work and make an extra data partition with it.
I personally don't use LVM at home since I change partitions on a monthly base and find LVM overcomplicated. At work I just use a default fedora install including LVM.

Question:
What's the best way to add an extra data partition?

1. The old way:
mounting the partition and adding a "LABEL=" in /etc/fstab
I assume this is still possible with the rest of the filesystem being LVM...?

2. Resizing the LVM and make /home use all extra space:
This worked once for me using Void's howto, but failed horribly a second time.

User avatar
Void Main
Site Admin
Site Admin
Posts: 5716
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Post by Void Main » Tue Jan 16, 2007 9:48 pm

A logical volume is not a file system, just another container level between the physical partition level and the file system level. You use lvm to create physical volumes on raw disk partitions and then use one or more physical volume to create a logical volume where you will create your file system. You still have partitions and you still have file systems but one advantage of putting a file system on a logical volume rather than directly on a raw partition is a logical volume can span multiple partitions on multiple drives. It can be resized or moved around between physical disks on the fly why the system is in use.

If you could provide more information about what you are trying to do and where you are running into problems I might be able to help. Give as many details as possible.

insomnia
programmer
programmer
Posts: 123
Joined: Thu Feb 05, 2004 6:58 pm
Location: Belgium, Antwerp

Post by insomnia » Fri Jan 19, 2007 8:14 pm

Thanks :)
I've been sick since posting that (just a flue), so that will be something for next week.
I understand all basics about LVM but just find it a pain to use.
Still no easy to use tool for it?

Some other questions,
So..., your howto will work for adding an other harddrive as well?
Does LVM handles partitions and their content the exact same way if they're not on the same drive?
Can I mix ext3 with xfs without any extra trouble(seems weird)?

User avatar
Void Main
Site Admin
Site Admin
Posts: 5716
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Post by Void Main » Sat Jan 20, 2007 8:12 am

insomnia wrote:Still no easy to use tool for it?
That's funny, I thought the lvm command WAS an easy to use tool. :) Do you mean graphical tool? The Fedora disk setup is graphical but I don't know of any other graphical tool for it but then I have never looked for one. Just type "lvm" to go to the lvm command line and then type "help" to see all the lvm commands. Use the HOWTO or the man page (each of those commands should have their own page) for more information.
Some other questions,
So..., your howto will work for adding an other harddrive as well?
Yes, just use your partition name on the other drive instead of whatever partition name I used in the HOWTO (sdb1, hdb1, etc, rather than sda3). Also understand my HOWTO is quite old and I haven't gone through it step by step on a recent distro to see if anything has changed but it shouldn't be significant. The best advice I have is to go through to real LVM2 HOWTO and just understand what the commands do. You shouldn't need a step by step guide if you understand what the commands do. My HOWTO was just supposed to be a working example to help people get started with that understanding. Here is the HOWTO I am talking about:

http://www.tldp.org/HOWTO/LVM-HOWTO/index.html

That HOWTO even has some examples (It calls them "recipes").
Does LVM handles partitions and their content the exact same way if they're not on the same drive?
Yes, that's one of the beauties of LVM. The file system is on a logical volume instead of a raw partition and this logical volume can be moved around on physical partitions/disks without the OS even knowing there is any change. For instance, say you put your OS on an ext3 file system that was on a partition called /dev/hda1. There are several places (well at least /etc/fstab) where that partition name is important to the OS. If you move that file system to /dev/hdb2 for instance, your system all of a sudden won't boot because it will try to mount things on /dev/hda1.

Now, say instead of putting your file system on a raw partition you instead put your file system on a logical volume which in turn is on a raw partition. Now you have things mounted on something called /dev/logvol01 (or similar) rather than /dev/hda1 in your /etc/fstab. Now instead of moving the file system you move the logical volume to a new drive the logical volume name doesn't change. The OS has no idea that it has moved to a new physical disk. Nothing has to be changed in the /etc/fstab (and possibly other configuration files). Of course being able to span multiple disks is another benefit (spanning disks can also be done with RAID).
Can I mix ext3 with xfs without any extra trouble(seems weird)?
Yes you can, the ext3 file system goes on one logical volume and the xfs file system goes on another logical volume, just like the ext3 file system would go on one partition and the xfs file system would go on another parition, just like an ext3 file system can go in one data file and the xfs file system can go in another data file. A partition, a logical volume, or even a plain old file can be the container for a file system.

insomnia
programmer
programmer
Posts: 123
Joined: Thu Feb 05, 2004 6:58 pm
Location: Belgium, Antwerp

Post by insomnia » Tue Jan 30, 2007 8:15 am

Worked perfect (I'm even starting to like using LVM) :)
Thanks.

Post Reply