From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1Q8CFw-00065R-KU for garchives@archives.gentoo.org; Fri, 08 Apr 2011 14:01:50 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id BD70EE04C1; Fri, 8 Apr 2011 14:00:22 +0000 (UTC) Received: from mail-wy0-f181.google.com (mail-wy0-f181.google.com [74.125.82.181]) by pigeon.gentoo.org (Postfix) with ESMTP id 71523E04C1 for ; Fri, 8 Apr 2011 14:00:22 +0000 (UTC) Received: by wyi11 with SMTP id 11so4378008wyi.40 for ; Fri, 08 Apr 2011 07:00:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:subject:date:user-agent:cc:references :in-reply-to:mime-version:content-type:content-transfer-encoding :message-id; bh=BIAJnHMyzAyvgglUIttvjGnRlQVPPkFlsG4wyQcaarg=; b=Zij3+rY1ploGdVHvo1w8aJgA88l2jJ+6ovQ+L6V3m/M/Gpsb3g2c/8C5TDSQk67uJd 9i2O2VkSxT7aHsX7wQMbh0mR/CUov9tCpz2Ago5C+t3+z90ut8MJ/S2wfPlqGWX6UpY5 lPG//wl/9WHzhuu5aQXv3Y1CKkulCyJCuD8YE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:subject:date:user-agent:cc:references:in-reply-to :mime-version:content-type:content-transfer-encoding:message-id; b=Psfw31Vpx8KmGE+8VHlfQUxXoUEYdcaUgVmVxZnUOvpln13zW6a8B5zUXWCirXe8Yy sAttxCJi35gaWDCJCpe2tkmA/1yzn/jZyhXebcuwbOKwapcbk3gscmGWVqDHZSTXsyv5 +c960O0DV0FlmHfZ4PhktcJoECa3X6kQgeNCI= Received: by 10.216.79.13 with SMTP id h13mr1966224wee.71.1302271203221; Fri, 08 Apr 2011 07:00:03 -0700 (PDT) Received: from nazgul.localnet (196-215-19-231.dynamic.isadsl.co.za [196.215.19.231]) by mx.google.com with ESMTPS id b20sm1727852wbb.33.2011.04.08.07.00.00 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 08 Apr 2011 07:00:01 -0700 (PDT) From: Alan McKinnon To: gentoo-user@lists.gentoo.org Subject: Re: [gentoo-user] LVM for data drives but not the OS Date: Fri, 8 Apr 2011 15:59:43 +0200 User-Agent: KMail/1.13.6 (Linux/2.6.37-ck; KDE/4.6.2; x86_64; ; ) Cc: Dale References: <4D9D9071.2050504@gmail.com> <20110408122655.5a12882b@digimed.co.uk> <4D9F1042.6060102@gmail.com> In-Reply-To: <4D9F1042.6060102@gmail.com> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201104081559.44212.alan.mckinnon@gmail.com> X-Archives-Salt: X-Archives-Hash: fd74df44240a4c690911e9da538b913b 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