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 1Q8JAq-0002M0-2m for garchives@archives.gentoo.org; Fri, 08 Apr 2011 21:25:00 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 646EF1C029; Fri, 8 Apr 2011 21:23:39 +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 04F6F1C029 for ; Fri, 8 Apr 2011 21:23:38 +0000 (UTC) Received: by wyi11 with SMTP id 11so4836430wyi.40 for ; Fri, 08 Apr 2011 14:23:38 -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:references :in-reply-to:mime-version:content-type:content-transfer-encoding :message-id; bh=YBVHur9okkj82/e0jksPKTMTYvFzrOxECpbSipNMxGQ=; b=AK2Lte7V4gg2AgVfqvD+pvfx8F7qy0pvye0o5ZxaAm2hgXbbUo/fhG9nCcpD1q1USm uim9sixVxaAWNEccDLvNKqN68dd/gRT2b1IhwZb7I0xRwoVWy4pCYI6BVpVPYiezEreA CyCE7RSwAG7O2E1ptmd2hAOegdb++gbSLe2ZU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:subject:date:user-agent:references:in-reply-to:mime-version :content-type:content-transfer-encoding:message-id; b=WSfc5lRmmjv/xs5Wpd/UVRQSCOs6lqAHOT5tRhyGdSPt7asiqm7+7NHg9aId9Z3ws5 xiHXLonJpFw5g2wnLP/DtJ7KgJzmTBvSAPzSzyceKo5IDy323E+O6XhdxudI/ay8sFhI Ra6STCetAmiELKftSazK39kgrjoUSylj/ULno= Received: by 10.227.61.142 with SMTP id t14mr2580272wbh.84.1302297818142; Fri, 08 Apr 2011 14:23:38 -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 x1sm1941115wbh.19.2011.04.08.14.23.36 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 08 Apr 2011 14:23:37 -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 23:23:20 +0200 User-Agent: KMail/1.13.6 (Linux/2.6.38-ck; KDE/4.6.2; x86_64; ; ) References: <4D9D9071.2050504@gmail.com> <4D9F5C5F.7030700@gmail.com> <4D9F779B.2040801@gmail.com> In-Reply-To: <4D9F779B.2040801@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: <201104082323.20677.alan.mckinnon@gmail.com> X-Archives-Salt: X-Archives-Hash: 09515ee7f2e61fb5d1937f4bb714d9dd Apparently, though unproven, at 23:01 on Friday 08 April 2011, Dale did opine thusly: > Dale wrote: > > root@fireball / # pvcreate /dev/sdb > > > > Physical volume "/dev/sdb" successfully created > > > > root@fireball / # > > > > Step one done. It didn't puke on my keyboard. lol > > > > Now to see what else I can get into. Not going to put anything > > important on it tho. Just a temporary thing right now. Just getting > > my feet wet. > > > > Dale > > > > :-) :-) > > More progress. > > root@fireball / # ls -al /dev/mapper/ > total 0 > drwxr-xr-x 2 root root 80 Apr 8 15:56 . > drwxr-xr-x 16 root root 4400 Apr 8 15:56 .. > crw-rw---- 1 root root 10, 236 Apr 8 04:39 control > lrwxrwxrwx 1 root root 7 Apr 8 15:56 sdb--vg-test -> ../dm-0 > root@fireball / # pvdisplay > --- Physical volume --- > PV Name /dev/sdb > VG Name sdb-vg > PV Size 232.83 GiB / not usable 2.58 MiB > Allocatable yes > PE Size 4.00 MiB > Total PE 59604 > Free PE 46804 > Allocated PE 12800 > PV UUID kopUKm-lXy1-7tiq-FuQ2-Xhs5-tGqN-Ls4R1v > > root@fireball / # vgdisplay > --- Volume group --- > VG Name sdb-vg > System ID > Format lvm2 > Metadata Areas 1 > Metadata Sequence No 2 > VG Access read/write > VG Status resizable > MAX LV 0 > Cur LV 1 > Open LV 0 > Max PV 0 > Cur PV 1 > Act PV 1 > VG Size 232.83 GiB > PE Size 4.00 MiB > Total PE 59604 > Alloc PE / Size 12800 / 50.00 GiB > Free PE / Size 46804 / 182.83 GiB > VG UUID 5OSiWZ-rWza-uKJ2-rVMO-f38G-NBHx-dmAE1K > > root@fireball / # lvdisplay > --- Logical volume --- > LV Name /dev/sdb-vg/test > VG Name sdb-vg > LV UUID mixhOb-La6D-BwG4-Uz3l-P0ci-oGg5-YI3mN8 > LV Write Access read/write > LV Status available > # open 0 > LV Size 50.00 GiB > Current LE 12800 > Segments 1 > Allocation inherit > Read ahead sectors auto > - currently set to 256 > Block device 254:0 > > root@fireball / # > > I'm still trying to figure out how the naming part works tho. Now to > mount it and put something on it. See if it works. Naming can vary a lot depending on udev rules. There will be one canonical name and one or more other things that symlink to it. Likely the canonical stuff will be /dev/mapper/..... and the symlinks will be in /dev/sdb-vg/..... cd and ls will see you right :-) > Let me know if something doesn't look right. Otherwise, I'll keep > playing around with it. Cool. So now you have a 250G PV, and it's the the only PV in it's volume group. You've made a 50G LV called "test" Cool so far. Now make a few more LVs (check the man pages, I'm doing this from memory): lvcreate -L 20G -n test2 sdb-vg lvcreate -L 30G -n test3 sdb-vg mkfs them: mkfs. /dev/sdb-vg/test{,2,3} mount points: mkdir /mnt/test{,2,3} mount them: mount /dev/sdb-vg/test /mnt/test Whoop-dee-doo. Now you can copy stuff there and do whatever you do with filesystems. Let's assume you have music on the first one "test". Let's also assume you get more music and it's more than 50G; say you need another 20. Easy-peasy, grow the filesystem, grow the LV: lvextend -L +20G /dev/sdb-vg/test resize2fs /dev/sdb-vg/test That's it. Nothing more. Without LVM, you'd be off down to the 'puter store looking to buy 70 CDs to do that :-) It's important to remember that once you've made /dev/sdb into a PV, you will never touch that device again. You will especially never fdisk or mkfs it - all that is done on the block device that LVM gives you - /dev/sdb-vg/test -- alan dot mckinnon at gmail dot com