LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 02-07-2011, 03:01 PM   #1
rolandpish
Member
 
Registered: May 2007
Posts: 30

Rep: Reputation: 0
LVM question


Hi there.

I plan to install a server using LVM. I thought a partition schema where /boot would be in an ext4 partition while / /usr /var /home and /opt would be in the LVM.
My question is: if I'm putting / into the LVM, is it neccesary to divide /usr /var /home and /opt into different logical volumes?
If I divide them, would it become harder to maintain when new disk space has to be added to the volume group?

Thanks in advance.

Regards
 
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 02-07-2011, 04:11 PM   #2
valen_tino
Member
 
Registered: Jan 2008
Posts: 105

Rep: Reputation: 28
If you put only / in LVM, you can only manipulate the / with LVM commands, not /var or /home etc. It really depends on the requirements of the server.

LVM essentially partitions your drive and mounts it as a separate mount point. Having separate mount point in LVM helps when a certain directory is filling up rapidly. For example, if /usr/local is filling up with Apache logs, it would help if it were on a separate LVM partition. That way you could extend the space after adding new drives. If it were not a separate LVM partition it would fill up / and potentially hang your server. In essence LVM provides the granularity and the protection from drives filling up.

Contrary to your statement, in my opinion, if divided it would be easier to maintain the LVs when new disk space has to be added to the volume group.

HTH
 
2 members found this post helpful.
Old 02-07-2011, 04:36 PM   #3
rolandpish
Member
 
Registered: May 2007
Posts: 30

Original Poster
Rep: Reputation: 0
Thanks a lot Valentino.

I really appreciate your suggestion. As a matter of fact, I was looking for recommendations as this will be my first server using LVM. For other servers I used the traditional partitioning paradigm and started to have lots of problems related to "running-out-of-space" exactly as you point out in your post.

Do you think is a good choice to divide the LV as: / /usr /home /var /opt and swap?

Thanks again!

Cheers
 
Old 02-07-2011, 05:41 PM   #4
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141

Rep: Reputation: 168Reputation: 168
It will depend on your usage patterns. If you have increasing data in your mail spools, logs, package cache, etc. then /var would be a good candidate for its own partition - the same goes for any other directory hierarchies with growing usage that could potentially use up a lot of space when you're not looking. Static directories won't be a risk to overflowing your root partition and can be grouped with /.

Putting /home on its own partition is a good idea for the above reason but also because you can easily preserve data when re-installing. I don't know about swap (although I have mine on its own partition) because I have enough RAM not to need it so I haven't compared swap performance in a partition to a file.
 
2 members found this post helpful.
Old 02-07-2011, 08:38 PM   #5
rolandpish
Member
 
Registered: May 2007
Posts: 30

Original Poster
Rep: Reputation: 0
Thanks a lot Steve.

Definitely you guys have helped me a lot to decide the partitioning scheme I'll use for the server. I'll research about putting swap in its own partition vs lvm; but I really have a better picture of what I should do.

Thanks again for your recommendations and any other suggestion is very welcome as well.

Cheers.
 
Old 02-07-2011, 09:47 PM   #6
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141

Rep: Reputation: 168Reputation: 168
I'm glad it was helpful. I used the LVM HOWTO here for most of the info I needed (as well as the README_CRYPT.TXT that comes with Slackware). The recipes chapter in the HOWTO is very good.
 
Old 02-07-2011, 11:48 PM   #7
tommylovell
Member
 
Registered: Nov 2005
Distribution: Raspbian, Debian, Ubuntu
Posts: 380

Rep: Reputation: 103Reputation: 103
Good advice from gilead and valen_tino and I concur.

In work we do a 100MB /boot and the rest goes to an LVM volume group. Within LVM we do 'root', 'home', 'var' and 'opt' logical volumes all in the same volume group. It isolates those filesystems from one another. They're easy to resize (upwards, at least) when you need to. (Resizing downwards requires unmounted file systems...)

At home I use the same scheme. It makes replacing an old drive with a new larger one real easy too. Just 'pvmove' from the old to the new; 'vgreduce' the old one away; then 'pvremove' it. 'dd' (or 'tar', or 'rsync') the /boot partition to the new drive. Then do some grub magic, and you're done. (I actually buy pairs of drives. Partition them identically. Make the "large" non /boot partition RAID1. Then 'PVCREATE' that /dev/md0 device.)

When you have your new system up, do a 'pvdisplay --maps' and a 'lvdisplay --maps', and you can see how your LV's were placed across the physical volume(s) within the volume group. Interesting.
 
3 members found this post helpful.
Old 02-08-2011, 07:38 AM   #8
rolandpish
Member
 
Registered: May 2007
Posts: 30

Original Poster
Rep: Reputation: 0
Thank you Tommy.

I'll absolutely write down your advice. I was about to google about that subject specifically

Again, a very valuable help from you guys. I really appreciate your suggestions.

Regards.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LVM question TheR_ Linux - Server 1 02-03-2010 01:33 PM
LVM question sang_froid Linux - General 2 03-10-2009 10:25 AM
Question about LVM Torr Linux - General 1 05-28-2006 07:36 AM
question about LVM an2ny_18 Linux - Software 3 03-12-2006 04:35 AM
lvm question babag Mandriva 4 09-11-2005 02:13 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 12:25 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration