[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: LVM root?



dtutty@porchlight.ca writes:

> Hi,
>
> I'm planning the install of amd64 on my new box (Athlon 3800+, 1 GB ram,
> Asus M2N-SLI MB, one Seagate 7200 80 GB SATA drive).
>
> What are the advantages to using LVM for root?

Better ask what are the drawbacks?

The backups of meta data is stored in /etc/lvm by default so in case
of an error you won't have them if / is on lvm. You have to move them
to e.g. /boot.

Some kernels had deadlock issues with / on lvm when you tried to
resize or pvmove it.

You need an initrd or initramfs even if you compile a custom kernel.

> I'm concerned about methods of recovery if something goes wrong.

I like to boot into my / with init=/bin/sh, have an editor, netcat,
the lvm tools and all that available to look around and fix things in
case something does go wrong. With a standard initrd that is pretty
much an impossibility and you need that for / on lvm.

> If I don't do LVM root, here's my current drive layout:
>
> Part.      mount      size
> ==========================
> 1          /boot      32 MB
> 5          /          200 MB

Merge them and maybe give it some extra space. When you collect a few
different kernels the /lib/modules dir grows on you. A bit of
breathing room saves you from having to clean up on every kernel
upgrade.

Also amd64 has /emul/ia32-linux/ taking up some space if you need
32bit support libs.

> 6          swap       512 MB

You can put swap on lvm. You should also think about suspend to disk,
which needs enough swap to store all active memory. Twice your ram
isn't a bad idea. Same as ram is pretty much a must.

> 7          PV1        remainder (78 GB +)
>
> VG1        only need one volume group, currently containing PV1 only
>
> LVusr      /usr       3 GB
> LVvar      /var       15 GB
> LVhome     /home      10 GB
> LVtmp      /tmp       200 MB

I always put tmp on tmpfs, which gets swapped out only when
neccessary. I make swap a little bit bigger than I think I need and
get double the value out of it as it can be used for tmpfs or swap as
needed.

> This leaves most of the VG as spare to be allocated as needed.
>
> I plan to use JFS for all partitions.  I've been very happy with JFS in
> the past.
>
> The most memory I've ever had is 64 MB.  Now I've got a gig.  The only
> time I've been memory bound has been thanks to Mozilla.  I'm assuming
> that the transfering of VHS tapes to DVD (editing out the commercials)
> will take more memory, but I'm unsure of how much swap I need.  When I
> start video editing, I'll be adding a second drive but since that's for
> working space for the editing, I don't know if I should put a swap
> partition on it.

You might want to stripe the volume for editing accross both
disks. Lvm can do that without you having to resrot to raid0. Gives
you more speed on file I/O. It's a per volume thing so you can keep
/usr, /var, /home on the first disk and just stripe the editing LV
when you get the 2nd disk.

> Can/should one put swap in an LV or is it no better than a swap file
> then?

Yes you cam. Not sure if there is any noticable disk whatever you
do. What takes time when swapping is the seeking of the disk and not
the few cycles the I/O layer takes to request or save data.

Also, when you actively have to use swap (not just storing dead memory
mozilla keeps allocated for hours or something there) then you have a
problem. Everything will take forever. If it takes forever and then
some you will hardly notice the difference. If swap becomes a problem
then buy more ram. (I have 1G too on my desktop and that's fine by the
way.)

> Please comment.
>
> Thanks,
>
> Doug.

MfG
        Goswin



Reply to: