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 1RTVCG-0005oq-6h for garchives@archives.gentoo.org; Thu, 24 Nov 2011 09:02:20 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id CB3A121C078; Thu, 24 Nov 2011 09:02:01 +0000 (UTC) Received: from mail-yx0-f181.google.com (mail-yx0-f181.google.com [209.85.213.181]) by pigeon.gentoo.org (Postfix) with ESMTP id 25CBB21C040 for ; Thu, 24 Nov 2011 09:00:42 +0000 (UTC) Received: by yenm3 with SMTP id m3so3079818yen.40 for ; Thu, 24 Nov 2011 01:00:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=0Hq2DyaGqZRuqKmPymfEi+ESBRPE1szvnpsnXB3JQAw=; b=Rv0opDpVUnACl23P+cyRqlFZfqSU3fyjO/wNeiAkgSUiNxWzSiUUs6J78rhDF94WlL nV5bYMAJ3blEw5W0Dr/Rmt9NYYl0lB2NtpseZ974kBPQ/07k1z5ne3Ikl3aAgtIyK/D6 Y6YlC+7eHMSA1+2yhGy6vr4lHsEAEerY9IK+g= Received: by 10.236.127.144 with SMTP id d16mr1928134yhi.51.1322125242357; Thu, 24 Nov 2011 01:00:42 -0800 (PST) Received: from [192.168.2.5] (adsl-65-0-66-118.jan.bellsouth.net. [65.0.66.118]) by mx.google.com with ESMTPS id x20sm3700298yhe.13.2011.11.24.01.00.40 (version=SSLv3 cipher=OTHER); Thu, 24 Nov 2011 01:00:41 -0800 (PST) Message-ID: <4ECE07B7.9000501@gmail.com> Date: Thu, 24 Nov 2011 03:00:39 -0600 From: Dale User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:7.0.1) Gecko/20111022 Firefox/7.0.1 SeaMonkey/2.4.1 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 To: gentoo-user@lists.gentoo.org Subject: Re: [gentoo-user] LVM and LABELS in fstab References: <4EC47700.2060707@gmail.com> <4ECC8990.7080106@gmail.com> <20111123133116.5cf32784@hactar.digimed.co.uk> <4ECD448B.3050603@gmail.com> <20111123211729.62c264cd@digimed.co.uk> <4ECD9D9A.4030908@gmail.com> <4ECDB9F8.30006@gmail.com> <20111124103901.726f5e33@rohan.example.com> In-Reply-To: <20111124103901.726f5e33@rohan.example.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Archives-Salt: f5102b10-3b9b-43d5-bba3-f24dec9dd175 X-Archives-Hash: 5ce601d2fee03516806cc4858f7e73e8 Alan McKinnon wrote: > On Wed, 23 Nov 2011 21:28:56 -0600 > Dale wrote: > >> Dale wrote: >>> Neil Bothwick wrote: >>>> You have space in the filesystem, but the volume containing that >>>> filesystem is too large to move. You must first reduce the >>>> filesystem size, with resize2fs or whatever suits your fs, then >>>> shrink the LV with lvresize. That will free up enough extents to >>>> be able to fit them all on one disk. Look at the output from lvs >>>> to see what is taking up all the space. >>> So, me staring at it a while and trying to figure it out did work. >>> That is what I was thinking. Thing is, it looks to me like it >>> would just move the stuff over then I can reduce it by what sdb is >>> making for its share. Although, their way makes sense too. >>> >>> I basically need to reduce the thing by 59604 PEs then it can move >>> them over to sdc so I can remove sdb. Looks like I am about to >>> really learn something here. It uses ext4 by the way. Looks like >>> adding is easier than removing, sort of. >>> >>> Now to get my ducks in a row. o_O >>> >>> Thanks. >>> >>> Dale >>> >>> :-) :-) >>> >> >> OK. Everyone duck, I been thinking on this and Neils info above. >> lol This is what I sort of figured out and tell me where I am off >> here. I have to reduce the file system, change the partition in >> cfdisk (?), resize the lv, then reduce the vg, then I can run >> pvmove? After all that, I can remove the drive sdb? Do I have the >> order correct too? If it does involve all this, I'm not sure I want >> to do this. The file system and cfdisk part makes me nervous. Maybe >> some of this isn't needed and I am reading some of the info >> incorrectly, I hope. > No, not quite. You're on the right track but got some of the details > wrong. 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. To undo it, you work from the top down. And the > important bit: > > Everything in that list only knows about the one directly below it. > > The other important bit: > > Nothing in that list can be bigger than the thing below it. > > This makes perfect sense: You can't store a 5G file on a 4G > file-system, nor can you create a 1TB partition on a 500G disk. > > > Tools like lv* only know about LVs and how they are built, it's > clueless about the actual files and filesystems involved. So when you > want to move things around, the tool will look at the volume and see > how many extents it uses. It will want to move all those extents > somewhere else. > > Now say you made a 40G filesystem on an LV but only have 500M of > actual files on it. LVM tools are going to want to move a 40G volume, > never mind that 39.5G of it is unused. If you don't have 40G of free > space, you have to start juggling. > > First get the filesystem down to a reasonable size: > > 1. Shrink the filesystem using resize2fs, resize_reiserfs etc. > 2. lvreduce to make the logical volume match the file system. > > Now you have a 500M thing to move around and your life gets easier. > > What you want to accomplish is to move all the LVs from one disk to > another disk, you need to have enough free space on the new PV to hold > all those LVs. When you've done that the old PV will now have no data > on it (none of it's extents will be in use), you can remove it from the > VG, then delete the PV, and finally remove the disk from the machine. > > *fdisk is the only truly destructive tool in your toolbox, the LVM > tools will all give you errors if you try and remove things that are in > use or if there's not enough free space. > > There's no easy recipes for this that you can just follow. You need to > understand the things you are dealing with and know what they are. But > it's not *that* hard. > > Like most things in Linux, LVM assumes that you, Dale, are probably not > a complete idiot and that you do know what you are doing. That's why > are the gory details are exposed for you to play with. > > Now if it were Windows and you were extremely lucky, you might get a > GUI thingy that let's you drag an bunch of unnamed stuff from here and > put it there. Which would promptly fail, silently. > > I think I had a light bulb moment but I plan to read this a few more times. I have these two drives, sdb and sdc, that are in the LVM system. I want to remove sdb, the smaller one, and when I do pvmove it doesn't move the files, it doesn't even see the files themselves, it sort of moves the file system itself which just happens to take the files with it. It takes the same amount of time even if there are no files on it. Sort of like dd does in a way. dd doesn't see files or anything, it just copies the bits on the platter. Am I getting close here? You didn't really bring up winders did you? You do know I hate winders. The only windows I like lets fresh are in when spring comes. ;-) Dale :-) :-) -- I am only responsible for what I said ... Not for what you understood or how you interpreted my words!