You are not logged in.

#1 2010-02-05 15:37:43

Infin1ty
Member
From: Israel
Registered: 2009-10-09
Posts: 42

LVM or not?

Well, arch is not new for me but using LVM is.
I have read quiet alot of manuals, mainly the tldp one.
Now it's time to remove ubuntu from my laptop (long time i wanted to remove it already, but now i just have the time) and install arch on it.
I already run arch on my netbook and it runs fine and i use it a lot.
My biggest question is if i will notice any performance decrease with LVM on a workstation, this is my main workstation, for work and entertainment.
I run a lot of virtual machines for study purposes, will i notice anything with LVM?
I'm going to format all the Logical Volumes of the Volume Group as ext4, i've seen that a lot of people use reiserfs with LVM but i still could not figure out why, am i missing something?

anyhow, this is how i was thinking of formatting my physical drive.
500GB Physical Drive
/dev/sda
  /dev/sda1 (100MB) ext4
               /boot/ - 100MB
  /dev/sda2 (430GB) - Linux LVM
         Volume Group: archlinux
    /dev/archlinux/rootlv - 50GB (mounted as /)
    /dev/archlinux/varlv - 50GB (mounted as /var)
    /dev/archlinux/usrlv - 50GB (mounted as /usr)
    /dev/archlinux/homelv - 100GB (mounted as /home)
    /dev/archlinux/tmplv - 1GB (mounted as /tmp)
    /dev/archlinux/vmlv - 150GB (mounted as /vm) the use of this logical volume is for virtual machines only.
    /dev/archlinux/swaplv - 6GB (use for swap space, i have 4GB of RAM and going to install the 64bit edition of archlinux)
    /dev/archlinux/sslv - 20G  i plan to use this logical volume for snapshots

the rest of the free space i have left i plan to install windows 7 on it and use it as a dual boot with archlinux on it.

Does it all look good?
I'm still thinking if i should split /usr (usrlv) and / (rootlv) or should i merge them into one rootlv?


Thanks.

Offline

#2 2010-02-05 19:38:49

Ultraman
Member
Registered: 2009-12-24
Posts: 242

Re: LVM or not?

Infin1ty wrote:

I already run arch on my netbook and it runs fine and i use it a lot.

big_smile

My biggest question is if i will notice any performance decrease with LVM on a workstation, this is my main workstation, for work and entertainment.

Very simple to answer this, benchmark it! I'm interested what your results will be.

I run a lot of virtual machines for study purposes, will i notice anything with LVM?
I'm going to format all the Logical Volumes of the Volume Group as ext4, i've seen that a lot of people use reiserfs with LVM but i still could not figure out why, am i missing something?

I use LVM on mdadm RAID1, runs perfectly fine and performs like I expected it to: just as fast as when I was running single disk. Perhaps one can measure/bench a difference, but I don't notice it.
About the reiserfs: Check the dates on those guides. Probably a lot of them are bit dated, when reiserfs had a lot going for it. Or simply the person who wrote the guide had a preference for it. I use ext4 my LVs, works great.

anyhow, this is how i was thinking of formatting my physical drive.
500GB Physical Drive
/dev/sda
  /dev/sda1 (100MB) ext4
               /boot/ - 100MB

You use a lot of kernels? With only the Arch kernel on there, my /boot is only 15MB used. Because I experiment with kernels from time to time, I made it 64MB. But if you only use the Arch kernel, 32MB will be enough smile

/dev/sda2 (430GB) - Linux LVM
         Volume Group: archlinux
    /dev/archlinux/rootlv - 50GB (mounted as /)
    /dev/archlinux/varlv - 50GB (mounted as /var)
    /dev/archlinux/usrlv - 50GB (mounted as /usr)

I think these are larger than you will need. But that depends on what you install. I have only kept /boot, /home and /var from my /, and that is now only using 3.5GB of the 50GB I gave it. I'm thinking of shrinking it. You could easily go for 3 volumes of 20GB and get 3x30=90GB of space back. And if you happen to need more space, you can always give those volumes more. That's one of the nice things of LVM. smile

/dev/archlinux/homelv - 100GB (mounted as /home)
    /dev/archlinux/tmplv - 1GB (mounted as /tmp)
    /dev/archlinux/vmlv - 150GB (mounted as /vm) the use of this logical volume is for virtual machines only.

You might want to give tmp a bit more breathing room. Remember that this conatins your temporary files which are used e.g. during compiling.

/dev/archlinux/swaplv - 6GB (use for swap space, i have 4GB of RAM and going to install the 64bit edition of archlinux)

Quite a big amount of swap. Are you using a lot of your swap at the moment? Even if you think you need at least 4GB in order to use pm-hibernate, you don't smile. pm-hibernate compresses the data from the RAM when hibernating and has a default of aiming to put it all in 512MB. You can increase that default to speed up the process. But I bet you'd never need more than 3GBs of swap to hibernate a full 4GB memory profile. However, if you want to be on the safe side, you could make swap as big as your RAM. I don't know how much you have.

I'm still thinking if i should split /usr (usrlv) and / (rootlv) or should i merge them into one rootlv?
Thanks.

I haven't split those. Why would you want to in this case?

Last edited by Ultraman (2010-02-05 20:41:15)

Offline

#3 2010-02-05 19:53:42

hatten
Arch Linux f@h Team Member
From: Sweden, Borlange
Registered: 2009-02-23
Posts: 736

Re: LVM or not?

Tmp of 1GB might be small if you're compiling a lot, I've run out on space on it while installing something from aur once =p

Offline

#4 2010-02-05 22:39:06

milomak
Member
Registered: 2009-11-04
Posts: 61

Re: LVM or not?

given it's a laptop and only has one drive, why would you want to use lvm?

Offline

#5 2010-02-05 22:48:25

IncredibleLaser
Member
From: Germany, NRW
Registered: 2008-07-16
Posts: 158

Re: LVM or not?

Well, why not use LVM? It offers more flexibility, snapshots and more.

Offline

#6 2010-02-06 12:48:24

Infin1ty
Member
From: Israel
Registered: 2009-10-09
Posts: 42

Re: LVM or not?

well, that's my final decision:
500GB Physical Drive
/dev/sda
  /dev/sda1 (100MB) ext4
               /boot/ - 100MB
  /dev/sda2 (430GB) - Linux LVM
         Volume Group: archlinux
    /dev/archlinux/rootlv - 80GB (mounted as /)
    /dev/archlinux/varlv - 40GB (mounted as /var)
    /dev/archlinux/homelv - 100GB (mounted as /home)
    /dev/archlinux/tmplv - 10GB (mounted as /tmp)
    /dev/archlinux/vmlv - 150GB (mounted as /vm) the use of this logical volume is for virtual machines only.
    /dev/archlinux/swaplv - 6GB (use for swap space, i have 4GB of RAM and going to install the 64bit edition of archlinux)
    /dev/archlinux/sslv - 20G  i plan to use this logical volume for snapshots

i guess it's enough, and if i need to move free space between the logical volumes so it's possible, that's why i like the idea of LVM.

and why to use LVM on a laptop? well, not just a laptop, any workstation. i plan to apply the "merge" patches to LVM snapshots so for example before making a big upgrade of packages (for example, pacman -Syu) i could take a snapshot before the upgrade, remove the snapshot from the lvm, upgrade the system, if something goes wrong i could use the LVM snapshot i created to roll back as it was before.
on the other hand, i could take a snapshot of my current system and do all my testing on that snapshot before applying it to system wide.
that's why...

Offline

#7 2010-02-07 15:09:36

AnotherDave
Member
Registered: 2010-02-07
Posts: 9

Re: LVM or not?

I borked the hard drive on my Ubuntu system which comes with LVM2 standard. It has made recovery a lot more complicated.

I am moving to Arch without LVM, because I don't WANT complication.

Offline

#8 2010-02-07 19:27:55

phildg
Member
Registered: 2006-03-10
Posts: 146

Re: LVM or not?

I have done a very simple benchmark^H^H^H^H test of writing a 4GB file to disk and found negligible differences using LVM. If you grow and resize the lvs a lot you and manage to fragment them significantly you may find a performance degradation.

I tend to avoid LVM if there is no good reason for it, however I would be lost without it on my desktop. I use LVM on a mdadm RAID10, there are a couple of lvs that hold an ext3 filsystem, but the rest are virtual hard drives. With ~20 vms adding/removing disk space, creating and destroying vms  and snapshots make managing the virtual hard drives bearable.

Your proposed allocations seem a little crazy to me, specifically / and /var, but I'm sure there are reasons not listed here that qualify those figures.

In addition CentOS, and from the sounds of things Ubuntu use LVM2 as part of the default partitioning setup, I take this to mean that Canonical and Redhat have deem the advantages of LVM outweigh the disadvantages, and that LVM2 is stable and reliable enough for production use.

Offline

#9 2010-02-07 20:06:35

foutrelis
Developer
From: Athens, Greece
Registered: 2008-07-28
Posts: 705
Website

Re: LVM or not?

AnotherDave wrote:

I borked the hard drive on my Ubuntu system which comes with LVM2 standard. It has made recovery a lot more complicated.

I am moving to Arch without LVM, because I don't WANT complication.

I share this opinion. I, too, use a very simple setup with just /boot and /home in separate partitions. tongue

Maybe with multiple hard drives I'd have chosen LVM, but with only one or two HDDs, I don't see the point.

Offline

#10 2010-02-09 20:00:40

Infin1ty
Member
From: Israel
Registered: 2009-10-09
Posts: 42

Re: LVM or not?

Well, the LVM is awesome, it's really nice, it's just that putting /var and / (root partition) on different logical volumes is a very very bad idea. (my biggest mistake i guess)

i was doing today some tests on an LVM snapshot i created (from the root one), I changed some system packages, etc..., installing my own PKGBUILD packages for testing, what i forgot was that the /var partition was not snapshotted!, so later on, moving to the real system (instead of the snapshot root one) caused pacman to be really out of sync, because the pacman database is located on /var!!, for example, if i went and removed the catalyst drivers from my system on the snapshot one and installed the opensource driver (ati) when i went back to the real root partition, i had the catalyst installed but pacman reported as the opensource one is installed instead...

so i guess from mistakes you learn smile, so right now i'm going to reinstall arch and put the /root and /var together again, but i don't need to reconfigure everything since i got my /home directory on a different partition smile

Edit: well, now everything is back to normal smile just reinstalled the root partition, i made a list of apps i had installed from pacman.log, now i'm using the opensource drivers until the guys at AMD/ATI will wakeup.

Last edited by Infin1ty (2010-02-09 22:01:09)

Offline

#11 2010-03-28 23:50:10

JonnyJD
Member
From: Berlin
Registered: 2007-11-05
Posts: 50

Re: LVM or not?

IncredibleLaser wrote:

Well, why not use LVM? It offers more flexibility, snapshots and more.

Did you try snapshots. What I read about LVM snapshots: Only create them, back them up and quickly drop them again. In contrast to zfs snapshots have huge performance drawbacks on LVM. I didn't benchmark it personally, but I've read it at different places:

http://www.nikhef.nl/~dennisvd/lvmcrap.html
http://www.mysqlperformanceblog.com/200 … shot-mode/
http://serverfault.com/questions/23965/ … p-strategy

Quite late for an answer, but I just found this thread.

Offline

#12 2010-03-29 02:41:21

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,222
Website

Re: LVM or not?

I don't install anything without LVM these days. It's just so awesome to not have to "click'n'pray" that your partition sizes are correct, and will stay correct for the life of the machine. My advice is start with small LV's and leave lots of room in the VG. Benefit being that when you need to grow, most file systems support online growing, but not online shrinking, so you can expand without even having to unmount.

As far as data recovery goes:
a) `pvscan && vgchange -ay` has always activated the LV's for me from a LiveCD. Finnix even does it for you if you use it for recovery.
b) BACKUP!

Offline

#13 2010-05-23 08:50:20

Synss
Member
From: Germany
Registered: 2009-04-14
Posts: 15

Re: LVM or not?

The volume sizes you (OP) propose are not sane values. I have no idea how you think you can fill 150 GB of non-data on your install. Sane volume sizes are with one zero less than what you propose, i.e.,
/usr 5–8 GB (mount /opt in /usr/opt)
/var 4–6 GB (NB: you may as well leave /var on / and make /var/tmp the logical volume, that would even make more sense unless you want to mount / read only. The system might behave very badly with /var not mounted, you would at least be left without pacman and log files and you most likely do not want that)
/ 1 GB
/tmp mounted on tmpfs (I give it 32 MB, yes megabytes, and @hatten: you should not compile in /tmp anyway, /var/tmp maybe, but not /tmp)
/var/run and /var/lock on tmpfs

6 GB swap seems a bit large to me, I know I only have a swap partition for suspend, i.e., 4GB RAM => 4 GB swap (max) because you do not honestly expect to fill 10 GB RAM + swap, either, do you?

And remove a zero on your snapshot partition, too, and make it 2 GB. You are going to release your snapshots regularly, aren't you? Typically, snapshot > upgrade > test > release. So I have yet to see a 20-GB upgrade coming, even if you update only once every 6 months.

+ everything fukawi2 said.


NB: This thread was slowly getting old, but still scored pretty high in google, so I decided to answer it anyway.

Offline

#14 2011-06-18 07:47:36

Vyre
Member
Registered: 2011-06-18
Posts: 17

Re: LVM or not?

Just found this thread via Google.  It was incredibly helpful.  I'm setting up a fresh Arch install on a netbook and wanted to play with LVM.  The wiki helps a bit, but this filled in a lot of gaps!

Offline

#15 2011-06-20 07:30:50

sonoran
Member
From: sonoran desert
Registered: 2009-01-12
Posts: 192

Re: LVM or not?

Vyre wrote:

Just found this thread via Google.  It was incredibly helpful.  I'm setting up a fresh Arch install on a netbook and wanted to play with LVM.  The wiki helps a bit, but this filled in a lot of gaps!

Great. Happy it worked out for you. Presumably, other users who need help will also use Google to discover the thread.

But was it really necessary for you to post and put this dead thread back at the top of the Installation Forum?

My post at least has the justification of being a mild and, I hope, humorous rebuke - what's your excuse?

Now, can I have the last five minutes of my life back, please?

https://wiki.archlinux.org/index.php/Forum_Etiquette

Offline

Board footer

Powered by FluxBB