From owner-freebsd-questions Sat May 19 16:26:29 2001 Delivered-To: freebsd-questions@freebsd.org Received: from wantadilla.lemis.com (wantadilla.lemis.com [192.109.197.80]) by hub.freebsd.org (Postfix) with ESMTP id 428B837B424 for ; Sat, 19 May 2001 16:26:14 -0700 (PDT) (envelope-from grog@lemis.com) Received: by wantadilla.lemis.com (Postfix, from userid 1004) id 310D96ACBE; Sun, 20 May 2001 08:56:04 +0930 (CST) Date: Sun, 20 May 2001 08:56:03 +0930 From: Greg Lehey To: Drew Tomlinson Cc: "FreeBSD Questions (E-mail)" Subject: Re: www.vinumvm.org Message-ID: <20010520085601.K64759@wantadilla.lemis.com> References: <20010516114223.C35292@wantadilla.lemis.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from drewt@writeme.com on Thu, May 17, 2001 at 02:45:02PM -0700 Organization: LEMIS, PO Box 460, Echunga SA 5153, Australia Phone: +61-8-8388-8286 Fax: +61-8-8388-8725 Mobile: +61-418-838-708 WWW-Home-Page: http://www.lemis.com/~grog X-PGP-Fingerprint: 6B 7B C3 8C 61 CD 54 AF 13 24 52 F8 6D A4 95 EF Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG > X-Mailer: Microsoft Outlook CWS, Build 9.0.2416 (9.0.2911.0) [Format recovered--see http://www.lemis.com/email/email-format.html] Your MUA wraps quoted text incorrectly. On Thursday, 17 May 2001 at 14:45:02 -0700, Drew Tomlinson wrote: > On Tuesday, May 15, 2001 7:12 PM, Greg Lehey wrote: > > [snip] > >>>>> I am trying to setup vinum on my 4.3 system for the first time and >>>>> need some help as I'm not understanding this very well. >>>>> Specifically, I have 3 4.3G drives with a 100M root >> partition on the >>>>> first and a 192M swap partition on the other two. The >> remainder of >>>>> the first drive has a second partition mounted as /usr. What I >>>>> would really like to have to keep the 100M root partition (only >>>>> because ASFAIK one can't use vinum on root) and have a >> striped 384M >>>>> swap and the remainder all of the space on all of the >> drives as one >>>>> large striped partition mounted as /usr. Is this possible? >>>> >>>> Only if all the Vinum drives (partitions) are thee same size. >>> >>> How would I do that? Take a backup of /usr, then delete it, create >>> my Vinum drive, and then restore it? Or is there a better way? >>> What "gotchas" might I come across? >> >> Well, in fact, all you need is to have same-sized subdisks. But if >> you only want one volume, you'd have space left over if the drives >> weren't all the same size. >> >> The trick way to turn /usr into a Vinum volume is to make swap 265 >> sectors longer when installing, then place /usr immediately after >> swap. After installation, reboot in single user mode, shorten swap by >> 265 sectors and make an overlapping Vinum drive start there. The real >> /usr will then be at the beginning of the subdisk space, so you just >> need to define a plex with the same location as the /usr partition. >> I'll write this up in more detail some day. > > I don't know much about drive geometry but I decided to give this a try. I want > a 100M root partition, 384M of total swap space, and the rest in a large stripe > set for /usr. I have 3 identical 4.3G drives in this system and labeled them as > follows: > > da0s1: > # size offset fstype [fsize bsize bps/cpg] > a: 204800 0 4.2BSD 1024 8192 16 # (Cyl. 0 - 12*) > b: 127232 204800 swap # (Cyl. 12*- 20*) > c: 8380080 0 unused 0 0 # (Cyl. 0 - 521*) > e: 8048048 332032 4.2BSD 1024 8192 16 # (Cyl. 20*- 521*) > > da1s1 & da2s1: > # size offset fstype [fsize bsize bps/cpg] > b: 331776 0 swap # (Cyl. 0 - 20*) > c: 8380080 0 unused 0 0 # (Cyl. 0 - 521*) > e: 8048304 331776 4.2BSD # (Cyl. 20*- 521*) > > ... I ... was able to shorten swap on da0 but because da0s1e is > mounted as /usr, I can't lengthen it and change the fstype to > "vinum" A good thing too. If you did, you'd have effectively sawn off the branch you were sitting on. > It now looks like this: > > # size offset fstype [fsize bsize bps/cpg] > a: 204800 0 4.2BSD 1024 8192 16 # (Cyl. 0 - 12*) > b: 126976 204800 swap # (Cyl. 12*- 20*) > c: 8380080 0 unused 0 0 # (Cyl. 0 - 521*) > e: 8048048 332032 4.2BSD 1024 8192 16 # (Cyl. 20*- 521*) Watch what I said above: >> After installation, reboot in single user mode, shorten swap by 265 >> sectors and make an overlapping Vinum drive start there. You shouldn't change the /usr partition. Add a new partition. In this example, > h: 8048313 331767 vinum 1024 8192 16 # (Cyl. 20*- 521*) This overlaps the /usr file system. > I did change the disklabel on both da1 and da2. They are the same and look like > this: > > # size offset fstype [fsize bsize bps/cpg] > b: 331776 0 swap # (Cyl. 0 - 20*) > c: 8380080 0 unused 0 0 # (Cyl. 0 - 521*) > e: 8048304 331776 vinum # (Cyl. 20*- 521*) > > And when I get the partition tables right, I plan to use this configuration file > to create my vinum volume for /usr: > > drive disk1 device /dev/da0e drive disk1 device /dev/da0h > drive disk2 device /dev/da1e > drive disk3 device /dev/da2e > volume user > plex org striped 300k > sd length 3929m drive disk1 > sd length 3929m drive disk2 > sd length 3929m drive disk3 This volume is completely wrong. You already have a /usr file system, and it's a single contiguous partition. Vinum doesn't move data when you create things, so you need to describe what's there, not what you want. > So where do I go from here? Am I close? I suspect that I need to > change the label on da0s1e to fstype vinum, add 256 Use 256 and everything will go wrong. The value is 265. > to the size, and subtract 256 from the offset. Then I can create my > vinum volume. Is this correct? If so, how can I edit the partition > that /usr lives on. I can't when /usr is mounted and I can't run > the disklabel utility when /usr isn't mounted. You can't change the size or the organization of the partition like this. You'll either have to live with the partition, or change it later. For the former, drive 1 device /dev/da0h drive 2 device /dev/da1e drive 3 device /dev/da2e volume usr plex org concat sd length 8048048s offset 265s drive 1 volume foo plex org striped 297k sd length 0m drive 2 sd length 0m drive 3 Note the exact specification of the length and offset of the subdisk usr.p0.s0: this ensures that you put the subdisk over the correct data. The second volume can be anything you want. Since both drives are the same size, and you appear to want to use them all for the one volume, just specify length 0m. I've also changed the names of the drives. This is cosmetic, of course, but it highlights the fact that they're not disks. Greg -- When replying to this message, please copy the original recipients. If you don't, I may ignore the reply. For more information, see http://www.lemis.com/questions.html Finger grog@lemis.com for PGP public key See complete headers for address and phone numbers To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message