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 1RbNOc-0006Kj-G4 for garchives@archives.gentoo.org; Fri, 16 Dec 2011 02:19:38 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id CDFF921C10A; Fri, 16 Dec 2011 02:19:24 +0000 (UTC) Received: from smtp.cs.nyu.edu (SMTP.CS.NYU.EDU [128.122.49.97]) by pigeon.gentoo.org (Postfix) with ESMTP id BB22421C057 for ; Fri, 16 Dec 2011 02:18:25 +0000 (UTC) Received: from ajglap.localdomain (ool-182de1a5.dyn.optonline.net [24.45.225.165]) (authenticated bits=0) by smtp.cs.nyu.edu (8.14.3/8.14.4) with ESMTP id pBG2IOeT008148 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Thu, 15 Dec 2011 21:18:24 -0500 (EST) Received: by ajglap.localdomain (Postfix, from userid 1502) id 1311470097; Thu, 15 Dec 2011 21:18:16 -0500 (EST) From: Allan Gottlieb To: gentoo-user@lists.gentoo.org Subject: [gentoo-user] LVM: extending volume groups and logical volumes Date: Thu, 15 Dec 2011 21:18:16 -0500 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) 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=us-ascii X-Archives-Salt: 2a771e68-6be2-4fc3-824a-06092acebb75 X-Archives-Hash: 29ed62ad3f3805bcbd4fd7624fb88784 I need to add space to /var (thank you, libreoffice), which is on lvm. Since my one volume group vg is getting low, I thought this would be a good time to extend it as well. Alan (McKinnon) has posted very helpful lvm bits (reprinted below). Following alan's bottom up creation mandate I believe the idea is phy disk: /dev/sda my only drive phy part: fdisk create another partition of type LVM (/dev/sda8) phy vol: pvcreate /dev/sda8 vol grp: vgextend vg /dev/sda8 log vol: lvextend --size +10G /dev/vg/var file sys: resize2fs /dev/vg/var files/dirs: not relevant Questions 1. Apparently 2.6 (hence 3.x) kernels can expand mounted file systems (/var is mounted as ext3). Since I can't unmount /var because it is in use, I guess that, if I every need to shrink /var, I would need to boot off a CD. Is that correct? Back in the day, we had single user mode for this, but I don't see how to get the equivalent now. Is it really safe to extend /var (i.e., /dev/vg/var) while mounted as ext3? It sounds frightening since daemons could start running and access /var. 2. Since currently /var is entirely from /dev/sda7 (my original lvm partition) should I use the optional parameter to lvextend to force the new space for /var to come from there as well? lv extend --size +10G /dev/sda7 thanks in advance allan ==================== from Alan McKinnon ============================== Let's look first at the layers of stuff involved: files & directories file system logical volume (LV) volume group (VG) physical volume (PV) physical partition (i.e. /dev/sda1 etc) physical disk (i.e. something Seagate etc made) OK, there's a lot of stuff there. When you made the LV, you worked from the bottom up Nothing in that list can be bigger than the thing below it.