From: Alan McKinnon <alan.mckinnon@gmail.com>
To: gentoo-user@lists.gentoo.org
Cc: Dale <rdalek1967@gmail.com>
Subject: Re: [gentoo-user] LVM for data drives but not the OS
Date: Fri, 8 Apr 2011 15:59:43 +0200 [thread overview]
Message-ID: <201104081559.44212.alan.mckinnon@gmail.com> (raw)
In-Reply-To: <4D9F1042.6060102@gmail.com>
On Friday 08 April 2011 15:40:18 Dale wrote:
> Neil Bothwick wrote:
> > On Fri, 08 Apr 2011 05:42:59 -0500, Dale wrote:
> >> Little light bulb here. physical volume is the same as a physical
> >> drive? If I understand it correctly, it is the whole thing
> >> unpartitioned.
> >
> > No. A physical volume is an area of disk. It can be the whole disk but it
> > more usually a partition.
>
> Ooooh. Still some progress tho. lol So, if I was going to use LVM, I
> create a partition first, either whole drive or part of it then use LVM
> on that? Then comes in the rest of the stuff that I am still trying to
> get a grip on.
Yes.
Here's the sequence:
1. Start with some sort of storage device (disk, partition, whatever - it must
just be a block device)
2. Run pvcreate on it. This is like making swapspace - it adds a signature to
the beginning of the block device so that LVM knows it can use the device
3. Add the pv to a volume group (vg). A vg is a collection of one or more
pv's, they are so that you can build big vgs and create volumes larger than
any one disk. On desktop with one drive or one RAID device, then vg often only
has 1 pv in it
4. Allocate space from the vg. This is a logical volume, it is a block device
just like any other and as far as the kernel and you are concerned you use it.
mkfs it and mount it just like any other block device.
====
Each of these elements (pv, vg, lv) can be added to, created, extended,
reduced and the command systax is much the same for each. What that means
exactly depends on what the thing is:
PV: creating it starts it from scratch, the LVM data on it is gone. You only
extend/reduce a PV if you changed the size of the underlying partition so that
LVM know it's true size.
VG: You don't really create a VG as such (it's a collection of things, not a
single thing). Creating it means adding the first PV to the VG. Extending and
reducing a VG means adding and removing PVs from the collection. When you
reduce a VG, it's an excellent idea to have migrated all the data on the PV
away first :-)
LV: Make the LV larger or smaller. This is conceptually exactly the same as
modifying a regular partition with fdisk, and you must take the same
precautions:
Extend: Make the LV bigger then grow the fs on it to use all the space
Reduce: Shrink the fs on it then reduce the LV to the same size
It's all very simple and logical really. It you grok what create/extend/reduce
and so on means for each element then you won't go wrong. People get confused
by LVM because tutorials on it, Red Hat training materials[1] and GUI tools
try very hard to fudge the concept, hide the bits and present it like the
partition, PV, VG, LV and filesystem on it and somehow all the same thing.
Which is completely not true of course.
[1] Especially Red Hat training materials. These caused more confusion about
it than anything else I have ever seen. Including Gnome tools. And that's
saying something.
--
alan dot mckinnon at gmail dot com
next prev parent reply other threads:[~2011-04-08 14:01 UTC|newest]
Thread overview: 74+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-07 10:22 [gentoo-user] LVM for data drives but not the OS Dale
2011-04-07 10:49 ` Joost Roeleveld
2011-04-07 11:12 ` Dale
2011-04-07 12:09 ` Joost Roeleveld
2011-04-07 11:19 ` Neil Bothwick
2011-04-07 11:28 ` Dale
2011-04-07 11:39 ` Neil Bothwick
2011-04-07 12:49 ` Dale
2011-04-07 13:03 ` Joost Roeleveld
2011-04-07 13:04 ` Neil Bothwick
2011-04-07 13:21 ` Joost Roeleveld
2011-04-07 13:31 ` Neil Bothwick
2011-04-07 13:41 ` Joost Roeleveld
2011-04-07 13:52 ` Joost Roeleveld
2011-04-07 14:11 ` Dale
2011-04-07 14:41 ` Joost Roeleveld
2011-04-07 13:57 ` Dale
2011-04-07 14:33 ` Joost Roeleveld
2011-04-08 16:25 ` Dale
2011-04-08 16:46 ` Alan McKinnon
2011-04-08 17:39 ` Dale
2011-04-08 18:38 ` Alan McKinnon
2011-04-08 19:05 ` Dale
2011-04-08 21:01 ` Dale
2011-04-08 21:13 ` J. Roeleveld
2011-04-08 21:30 ` Dale
2011-04-09 12:46 ` Joost Roeleveld
2011-04-09 13:00 ` Dale
2011-04-09 13:13 ` Neil Bothwick
2011-04-08 21:23 ` Alan McKinnon
2011-04-08 22:00 ` Neil Bothwick
2011-04-08 23:36 ` Dale
2011-04-09 5:28 ` Dale
2011-04-09 12:51 ` Joost Roeleveld
2011-04-09 13:04 ` Dale
2011-04-09 19:33 ` Joost Roeleveld
2011-04-09 8:52 ` Neil Bothwick
2011-04-09 9:43 ` Peter Humphrey
2011-04-09 10:01 ` Neil Bothwick
2011-04-09 10:41 ` Dale
2011-04-09 10:48 ` Dale
2011-04-09 11:19 ` Alan McKinnon
2011-04-09 11:43 ` Dale
2011-04-09 12:53 ` Joost Roeleveld
2011-04-09 13:33 ` Dale
2011-04-09 16:01 ` Thanasis
2011-04-09 16:22 ` Mark Knecht
2011-04-09 13:11 ` Alan McKinnon
2011-04-09 10:36 ` Dale
2011-04-08 21:57 ` Neil Bothwick
2011-04-07 18:31 ` Peter Humphrey
2011-04-07 13:20 ` BRM
2011-04-07 13:30 ` Joost Roeleveld
2011-04-07 13:52 ` BRM
2011-04-07 14:14 ` Joost Roeleveld
2011-04-07 17:31 ` BRM
2011-04-07 17:50 ` J. Roeleveld
2011-04-07 18:35 ` BRM
2011-04-07 19:38 ` Joost Roeleveld
2011-04-08 10:42 ` Dale
2011-04-08 11:26 ` Neil Bothwick
2011-04-08 13:40 ` Dale
2011-04-08 13:59 ` Alan McKinnon [this message]
2011-04-08 14:06 ` Mark Knecht
2011-04-08 14:23 ` Joost Roeleveld
2011-04-08 14:45 ` Dale
2011-04-08 15:13 ` Joost Roeleveld
2011-04-08 15:27 ` Dale
2011-04-08 11:41 ` Joost Roeleveld
2011-04-07 11:29 ` Alex Schuster
2011-04-09 2:58 ` Mark Shields
[not found] <gEUDo-72k-19@gated-at.bofh.it>
[not found] ` <gEVzt-b2-39@gated-at.bofh.it>
[not found] ` <gEVJ8-ou-21@gated-at.bofh.it>
2011-04-07 12:15 ` Gregory Shearman
2011-04-07 12:41 ` Dale
[not found] ` <gF1ES-22O-19@gated-at.bofh.it>
[not found] ` <gF2hz-3ba-17@gated-at.bofh.it>
[not found] ` <gF3nk-50O-23@gated-at.bofh.it>
[not found] ` <gFhqh-3wh-3@gated-at.bofh.it>
[not found] ` <gFicG-4Ul-7@gated-at.bofh.it>
[not found] ` <gFkev-8r9-27@gated-at.bofh.it>
2011-04-08 15:15 ` David W Noon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201104081559.44212.alan.mckinnon@gmail.com \
--to=alan.mckinnon@gmail.com \
--cc=gentoo-user@lists.gentoo.org \
--cc=rdalek1967@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox