From owner-freebsd-questions Tue Mar 12 15:51:15 2002 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 4AD7E37B41A for ; Tue, 12 Mar 2002 15:49:57 -0800 (PST) Received: by wantadilla.lemis.com (Postfix, from userid 1004) id D007C7831E; Wed, 13 Mar 2002 10:19:54 +1030 (CST) Date: Wed, 13 Mar 2002 10:19:54 +1030 From: Greg Lehey To: Jason Borkowsky Cc: questions@FreeBSD.org Subject: Re: Using VINUM to do RAID-1 disk mirroring Message-ID: <20020313101954.D39272@wantadilla.lemis.com> References: <20020312094817.S36158@wantadilla.lemis.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.3.23i Organization: The FreeBSD Project Phone: +61-8-8388-8286 Fax: +61-8-8388-8725 Mobile: +61-418-838-708 WWW-Home-Page: http://www.FreeBSD.org/ 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 On Tuesday, 12 March 2002 at 10:20:47 -0500, Jason Borkowsky wrote: > > I really am trying very hard to understand all of this, and have spent hours > both reading about vinum and playing with it on my test box. In the process > I have learned a lot about master boot records, disk layout, etc, so it is > all good. So I just want to go over this to make sure I have it right. I > currently have two identical drives and want to have one mirror the other. I > have set up identical file systems (including swap, but swap won't be > mirrored). The drives look as follows: > > /dev/ad0: > > # size offset fstype [fsize bsize bps/cpg] > a: 204800 0 4.2BSD 2048 16384 97 # (Cyl. 0 - 12*) > b: 4194304 3325952 swap # (Cyl. 207*- 468*) > c: 80405262 0 unused 0 0 # (Cyl. 0 - 5004*) > e: 1024000 204800 4.2BSD 2048 16384 90 # (Cyl. 12*- 76*) > f: 2097152 1228800 4.2BSD 2048 16384 89 # (Cyl. 76*- 207*) > g: 20971520 7520256 4.2BSD 2048 16384 89 # (Cyl. 468*- 1773*) > h: 51913486 28491776 4.2BSD 2048 16384 89 # (Cyl. 1773*- 5004*) > > /dev/ad2: > > # size offset fstype [fsize bsize bps/cpg] > a: 204800 0 4.2BSD 2048 16384 97 # (Cyl. 0 - 12*) > b: 4194304 3325952 swap # (Cyl. 207*- 468*) > c: 80405262 0 unused 0 0 # (Cyl. 0 - 5004*) > e: 1024000 204800 4.2BSD 2048 16384 90 # (Cyl. 12*- 76*) > f: 2097152 1228800 4.2BSD 2048 16384 89 # (Cyl. 76*- 207*) > g: 20971520 7520256 4.2BSD 2048 16384 89 # (Cyl. 468*- 1773*) > h: 51913486 28491776 4.2BSD 2048 16384 89 # (Cyl. 1773*- 5004*) > > > Now, I need to change the file system type to vinum of all the partitions I > want to mirror: > > /dev/ad0: > > # size offset fstype [fsize bsize bps/cpg] > a: 204800 0 vinum 2048 16384 97 # (Cyl. 0 - 12*) > b: 4194304 3325952 swap # (Cyl. 207*- 468*) > c: 80405262 0 unused 0 0 # (Cyl. 0 - 5004*) > e: 1024000 204800 vinum 2048 16384 90 # (Cyl. 12*- 76*) > f: 2097152 1228800 vinum 2048 16384 89 # (Cyl. 76*- 207*) > g: 20971520 7520256 vinum 2048 16384 89 # (Cyl. 468*- 1773*) > h: 51913486 28491776 vinum 2048 16384 89 # (Cyl. 1773*- 5004*) > > /dev/ad2: > > # size offset fstype [fsize bsize bps/cpg] > a: 204800 0 vinum 2048 16384 97 # (Cyl. 0 - 12*) > b: 4194304 3325952 swap # (Cyl. 207*- 468*) > c: 80405262 0 unused 0 0 # (Cyl. 0 - 5004*) > e: 1024000 204800 vinum 2048 16384 90 # (Cyl. 12*- 76*) > f: 2097152 1228800 vinum 2048 16384 89 # (Cyl. 76*- 207*) > g: 20971520 7520256 vinum 2048 16384 89 # (Cyl. 468*- 1773*) > h: 51913486 28491776 vinum 2048 16384 89 # (Cyl. 1773*- 5004*) No, this is wrong. You shouldn't have more than one drive per spindle. You need something like this: /dev/ad0: # size offset fstype [fsize bsize bps/cpg] b: 4194304 0 swap # (Cyl. 207*- 468*) c: 80405262 0 unused 0 0 # (Cyl. 0 - 5004*) e: 76210958 4194304 vinum 2048 16384 90 # (Cyl. 12*- 76*) > I now do my vinum configuration (which actually is the easy part, since > there are a lot of examples on that plus I can play around with it on my > test machine). The config will look something like this: > > drive ad0s1a device /dev/ad0s1a Don't name drives after spindles. If the spindle name changes, it will still be work, but you'll have some really confusing names. Also, of course, you have far too many volumes. > drive ad2s1a device /dev/ad2s1a > drive ad0s1e device /dev/ad0s1e > drive ad2s1e device /dev/ad2s1e > drive ad0s1f device /dev/ad0s1f > drive ad2s1f device /dev/ad2s1f > drive ad0s1g device /dev/ad0s1g > drive ad2s1g device /dev/ad2s1g > drive ad0s1h device /dev/ad0s1h > drive ad2s1h device /dev/ad2s1h > volume mirror setupstate > plex org concat > sd length 0 drive ad0s1a > plex org concat > sd length 0 drive ad2s1a > volume mirror setupstate You can't have two volumes with the same name. > plex org concat > sd length 0 drive ad0s1e > plex org concat > sd length 0 drive ad2s1e > volume mirror setupstate > plex org concat > sd length 0 drive ad0s1f > plex org concat > sd length 0 drive ad2s1f > volume mirror setupstate > plex org concat > sd length 0 drive ad0s1g > plex org concat > sd length 0 drive ad2s1g > volume mirror setupstate > plex org concat > sd length 0 drive ad0s1h > plex org concat > sd length 0 drive ad2s1h > > Then I start up vinum, read in my config, and use something called a > "revive" command which will then sync up all of the partitions, Well, no, there's no command called revive. It's called start. > and then vinum will keep everything in sync. start gets things in sync where necessary. Vinum keeps things in sync without that. But you don't need that after creating a volume with setupstate. Your config file should look something like this: drive a device /dev/ad2s1e drive b device /dev/ad2s1e volume 1 setupstate plex org concat sd length 204800 drive a plex org concat sd length 204800 drive b volume 2 setupstate plex org concat sd length 1024000 drive a plex org concat sd length 1024000 drive b volume 3 setupstate plex org concat sd length 2097152 drive a plex org concat sd length 2097152 drive b volume 4 setupstate plex org concat sd length 20971520 drive a plex org concat sd length 20971520 drive b volume 5 setupstate plex org concat sd length 51913486 drive a plex org concat sd length 51913486 drive b > Meanwhile, I also create a boot floppy (or, even, a separate boot > harddrive) which I use in case of an emergency, which would allow me > to boot in case of an emergency (failed hard drive, corrupt file > system, etc). Vinum doesn't currently support root, so yes, you'll need a separate boot drive with the root file system. 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 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