PDA

View Full Version : LVM vs Specific Partitions



LouArnold
29th October 2007, 07:22 AM
For a beginner with Linux who is starting software development (C++, Java, etc) with it, should logical partitions be used (LVM) or "hard" partitions (swap, root boot, home, tmp, var, etc.)?

sej7278
29th October 2007, 09:19 AM
i wouldn't bother with lvm unless you have a lot of hard disks and regularly add more and like to resize partitions a lot.

on a laptop for instance lvm is completely pointless.

Dan
29th October 2007, 11:02 AM
I, personally, have no use for LVM!

leigh123linux
29th October 2007, 11:32 AM
You don't need all these partitions


"hard" partitions (swap, root boot, home, tmp, var, etc.)?

You only need

swap
root
home

and perhaps

usr

sej7278
29th October 2007, 12:53 PM
You don't need all these partitions

You only need

swap
root
home

and perhaps

usr

well you only really need swap and / (root)

if you like to upgrade a lot, then having /home on its own partition is useful.

/var is sometimes helpful to have on its own partition on servers which may have a lot of logs - you don't want to fill your root partition because syslog's gone nuts!

i don't bother with a seperate /boot partition anymore, there used to be a reason for it....?

personally i have swap, / and then each data drive gets its own /data1, /data2 etc; no lvm - i don't fancy losing almost a terrabyte of data as a single bit gets swapped in an lv.

Dan
29th October 2007, 01:06 PM
LOL! Lou, it looks like you're going to get as many different opinions as there are possibilities, so let me add my dribble to the mess.

I use all ext3 except the swap and DATA partition, and I create;

boot
/ (root)
home
swap

And if I have the room or the need to be remotely Windows compatible, a single DATA partition formatted as FAT32


Dan

A.Serbinski
29th October 2007, 03:20 PM
If you have *too much* memory and don't need to hibernate, you can even get by without SWAP. If you do need swap though, its better to put your swap on a separate disk from everything else - the hit on performance is much lower for when it starts swapping.

Ric-O-Matic
29th October 2007, 05:41 PM
Hi Lou,

With LVM you may resize a filesystem without unmounting it, and without loosing data (in fact you may increase the size of an ext3 file system without unmounting it).
If you have enough free physical extents on a volume group, you may extend the size of the logical volume (with lvextend) and them resize the ext3 file system (with rezise2fs).
(In fact I didn't know that it is possible, I just found it in the man page ; I think that we still had to umount the file system to resize it. I will try tonight on a system wihth a volume group where all physical extents are not allocated yet).

So you may have only 2 physical partitions, the first one for /boot, and the second one for a large volume group on the rest of the hard disk.
You may then define 2 logical volumes on that volume group, the first one for the swap, and the second one for / file system. But don't let Fedora use all the space available on the VG for /. Maybe 6-8 Mb will be sufficient to start.

You may then define other logical volumes on wich you mount the filesystems you need for your development projects, once again with just the size you think sufficient for your need, and keeping free physical extents available for future use.

lazlow
29th October 2007, 06:27 PM
The big problem with LVM is when it screws up. Recovering data (on any system) is a PITA. LVM is just another layer for something to go wrong. LVM (for most people) buys you very little. Almost everything LVM can do can be done without it, one just has to jump through a couple more hoops. I THINK most of use have determined (by the burnt finger method) that LVM fails in the risk/reward department.

Good Luck
Lazlow

sej7278
29th October 2007, 10:51 PM
If you have *too much* memory and don't need to hibernate, you can even get by without SWAP. If you do need swap though, its better to put your swap on a separate disk from everything else - the hit on performance is much lower for when it starts swapping.

CAN YOU?! i really didn't know you could do without swap.

but surely swap acts like a cache or buffer to some degree - i.e. if you do a huge find or grep, that executes in ram, then the result gets moved into swap to free the ram, then if you do the same grep/find again, its instantly available.

i dunno. interesting though.

so now we've done the partition thing can we start arguing about the best filesystems.* :D



*ext3 and jfs

gary1975
29th October 2007, 11:25 PM
I agree with Lazlow. I got burnt badly when I erased my LVM partition accidentally and couldn't recover my files. Now, I'm back to good old ext3 partitions.

Seve
30th October 2007, 12:01 AM
Hello:
My personal opinion only :)
I agree with Lazlow and Dan, I have no great love for LVM for a desktop installation.

sej7278
And, yes there have been many folks who have run without a swap. Of course, everyone's configuration and demands on their system are different.
I wouldn't recommend it but if you like [for chuckles] you can edit your /etc/fstab and disable the swap and run your installation and see how it goes.

Seve

Dies
30th October 2007, 12:09 AM
CAN YOU?! i really didn't know you could do without swap.


Yup, if you pay attention you'll notice it never gets used. Unless of course you're really short on memory.


@ Lou

Oh yeah, sorry, add me to the "LVM SUCKS!" crowd. :D

shess01
30th October 2007, 12:10 AM
Same here. Lost my LVM partitioned FC6 drive just as I was about to make the move to FC7. I ask, again, why in the HELL is LVM the default partition choice in Anaconda. Man, what a bonehead move.... On servers in an IT environment, sure, great. But the regular Joe with Fedora installed on the desktop /laptop daily driver should probably stay away from LVM.

A.Serbinski
30th October 2007, 02:55 AM
I wouldn't recommend it but if you like [for chuckles] you can edit your /etc/fstab and disable the swap and run your installation and see how it goes.
Thats probably not the best way to test out swapless operation. Better to issue the command "swapoff -a" as root to disable swap *temporarily* (ie, until next reboot or until you issue the command "swapon -a".

@sej7278: regarding swap as cache, no. Not much point in caching disk to disk, since data would have to be read from disk either way. The simplest way to think of swap is that it is a temporary storage of memory pages that are (hopefully) not immediately needed in order to free up real memory for data that IS currently needed. There is also no caching of a huge find or grep since you can't tell if the result will be the same between runs.

JN4OldSchool
30th October 2007, 03:09 AM
One more for LVM sucks, but in all fairness, (and before slowjet catches wind of this thread), I havent used LVM enough to understand it. But my reasoning is if there is no reason there is no need. I am sure it serves its purpose and is a "better" way of doing things in some cases. My home desktop is just not one of those cases. Just my 2 and I'm sticking to it.

houndhen
30th October 2007, 02:27 PM
New to linux. Trying to find a distro that will work on my new pc and not overwhelm me with complexity but still allow me to learn linux.

Had XP and opensuse dual booted on my new pc. I couldn't let well enough alone and had to try and install Fedora 7. :rolleyes: My system got completely messed up so bad that I couldn't boot from my XP cd and try to fix the mbr. Used a live cd and erased all of the linux, booted with the xp disk and fixed the mbr. At least I salvaged one out of three installs. Re-installed opensuse on my 250gb hard drive.

When I did the prior Fedora install it did its thing and set up LVM. How to I stop the install from setting up LVM? I didn't like it and like lazlow said, "it just adds another layer for something to go wrong."

Before when I tried to install I had to load cd into memory to get it to install. If I just booted to the live cd the install shortcut never worked. It would act like it was going to but then would just quit.


thanks,
houndhen

After I posted I found a post that answered my question.

LouArnold
30th October 2007, 02:46 PM
Withdrawn! I'll resubmit as another thread, sometime anyway.

OK...I had no idea LVM wasn't liked. I did read that some things shouldn't be under LVM.

Now perhaps some partition sizes.. Partitions on a percentage of disk size - some fixed of course (eg swap = 2x memory)...
1) For a server system 512 MB memory. Web server and database.
2) A workstation for software development (both C++ and Java)
3) A workstation for an office suite only.

stoat
30th October 2007, 03:13 PM
How to I stop the install from setting up LVM?Hello houndhen,

To install Fedora without LVM, watch for and select the partition option Create custom layout. The next page is the Disk Druid which you can use to create your partitions any way you like using standard Linux partitions.

To install Fedora without it disturbing your master boot record and your existing boot loader setup like it did, watch for and select the boot loader option Configure advanced boot loader options. On the next page choose to install GRUB in the first sector of the the Fedora boot partition. After Fedora is installed, you can add Fedora to the menu of whatever boot loader you are using (Fedora will not boot until you do that if GRUB is installed that way).

Finally, don't reply or ask about any of this here. Start your own thread or you may upset the OP here (too late :)). Besides, this post is getting long and fewer eyes will see your questions here.

LouArnold
30th October 2007, 05:40 PM
Good point, stoat.
I withdrew my post on partition sizes. I'll start a new thread and see what happens.

stoat
30th October 2007, 08:13 PM
I withdrew my post on partition sizes. I'll start a new thread and see what happens.Hello LouArnold,

Actually, it was you that I was worried about being offended by another poster asking for help with his problem in your thread. This is your thread. You are the OP (original poster). I figure you can ask whatever you want here. I'm glad you were not agitated by the diversion created by me and houndhen.

lsatenstein
31st October 2007, 04:29 AM
Being niave, when I started with linux , i let anaconda take the whole disk, and let it use lvm. I can say that lvm never caused a problem.
After some experience, I redid my install, making two partitions (xp and linux), with lvm on the second partition. I made a /home a /boot, and reserved space for samba as /data. The rest were part of lvm.

What is nice about lvm, if quotas are not used, then you can increase a /home or whatever quite easily. It is difficult to do that with non lvm partitions. I really cannot say if there is significantly more overhead for using lvm then for not using it. Several unix gurus recommend it, even for home use.

Leslie

LouArnold
31st October 2007, 02:16 PM
Hello LouArnold,

Actually, it was you that I was worried about being offended by another poster asking for help with his problem in your thread. This is your thread. You are the OP (original poster). I figure you can ask whatever you want here. I'm glad you were not agitated by the diversion created by me and houndhen.

Naaahh, the "new" problem never even registered with me. It seemed a good place to talk about it, and I was interested in it anyway. But thank you for being considerate.

PatMcLJr
31st October 2007, 02:21 PM
I would say LVM is all that bad. It has it's place. It's like a train, can be very reliable and useful but when it crashes, not to pretty. For me it's best used when you want your file system to span over two or more drives and don't want to be locked into fixed size mount points. I do keep my /home on a separate partition with ext3 what with having the burnt finger and all. I also have a swap partition, but I only have 512 on this box and it does swap, especially when it's been up for a while.

Best of Luck,
Pat Jr.

bradchaus
1st November 2007, 12:22 AM
i use LVM, but only because I run a raid 5 system. on a single disk i wouldnt bother. no problems with LVM however.