LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Do I need LVM? (https://www.linuxquestions.org/questions/linux-newbie-8/do-i-need-lvm-927867/)

humbry 02-06-2012 05:19 AM

Do I need LVM?
 
Hi,

--- About me ---
I'm not a total noob, as I have many years of sysadmin-type experience, but still, I am not a sysadmin by trade and usually start with a O/S that is installed by someone else (but I usually manage it after that on my own).

--- About the environment ---
But now I am trying my hand at installing my own server from the ground up. It will be on a KVM-virtualized cloud server.

I only have a handful of websites and things being hosted on it, and won't need too much out of my disks. I'll probably be using two drives, one for O/S and one for user data. I don't expect in the short term that I will need to change or re-size them once I make my initial decisions.

BUT, in the long term, there is a chance the server could get more heavy use and the storage needs could change. From what I understand, that's where LVM fits in, allowing for easy re-sizing and changes on the fly.

Right now my feeling is if it comes to that, I wouldn't mind installing LVM at that time instead of now (if I had to temporarily move my data and mounts at that time, add a third drive and put LVM on top, I don't think that'd be too much of a problem).

--- Main Question---
Am I correct to assume LVM incurs at least a small performance hit? Keep in mind, I'm already taking a disk performance hit by being in a virtualized environment (actually, I wonder, are my "drives" likely to already be LVM volumes, so I'd be doing LVM on LVM?).

I'm also considering that I may use the encryption option that my provider uses for my drives, so that may be yet another performance hit to add up, so you can see, if LVM is even a small hit, it might be good to avoid unless I really need it.

If my short-to-medium term projections that I won't need to do any dynamic resizing, is there any reason at all that I'd want to use LVM?

Does it offer me any other benefits? (I already get "snapshot" capability of my drives from my cloud provider, so that one's already taken care of)

Is fdisk and mkfs going to be sufficient for me?

ukiuki 02-06-2012 05:49 AM

It isn't too hard to decide if one should use LVM or not. It brings many advantages in servers.
About virtual disks if you have the same needs as in with real disk of resize and management it could be handy.

http://en.wikipedia.org/wiki/Logical...er_%28Linux%29
Quote:

LVM is suitable for:

* Managing large hard disk farms by letting you add disks, replace disks, copy and share contents from one disk to another without disrupting service (hot swapping).
* On small systems (like a desktop at home), instead of having to estimate at installation time how big a partition might need to be in the future, LVM allows you to resize your disk partitions easily as needed.
* Making backups by taking "snapshots."
* Creating single logical volumes of multiple physical volumes or entire hard disks (somewhat similar to RAID 0, but more similar to JBOD), allowing for dynamic volume resizing.

One can think of LVM as a thin software layer on top of the hard disks and partitions, which creates an illusion of continuity and ease-of-use for managing hard-drive replacement, repartitioning, and backup.
Regards

d420 02-06-2012 06:19 AM

Quote:

Originally Posted by humbry (Post 4594940)
I am not a sysadmin by trade

The way I see it - No, you don't need LVM. If you backup your data properly and document your installation steps, it is easier to upgrade to a larger HDD using fdisk and mkfs than to remember and deal with the extra complexity of LVM. Not that LVM is too complex, but that's another layer of indirection you have to deal with and, if you are busy doing MANY other things, it's just easier (at least for me), to deal with the simplicity of straight fdisk, df, dev/sda, etc.

humbry 02-06-2012 06:20 AM

@ukiuki - Thanks, maybe I should have mentioned I already did some research like reading Wikipedia before posting.

Maybe I shouldn't have posted in the newbie forum, but I was hoping for advice on the environment and use scenario I described (note particularly the questions about performance impacts), not just a general response.

Anyone else? Or should I move this to a non-newbie forum?


@d420 - Hmm, OK thanks for what sounds like real world advice. Thanks for putting down your first post on my question

ukiuki 02-06-2012 02:03 PM

No problem, that is just my 2 cents. About the LVM if you want to keep things simple just skip that but make sure to make the partition the way it can expand as deem necessary, some of my virtual disks are getting too small and well, that is one thing to think about when setting those virtual servers.

Regards


All times are GMT -5. The time now is 11:11 PM.