From owner-freebsd-questions Mon Mar 11 15:18:32 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 DF10337B41B for ; Mon, 11 Mar 2002 15:18:25 -0800 (PST) Received: by wantadilla.lemis.com (Postfix, from userid 1004) id C13827831F; Tue, 12 Mar 2002 09:48:17 +1030 (CST) Date: Tue, 12 Mar 2002 09:48:17 +1030 From: Greg Lehey To: Jason Borkowsky Cc: questions@freebsd.org Subject: Re: Using VINUM to do RAID-1 disk mirroring Message-ID: <20020312094817.S36158@wantadilla.lemis.com> References: 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 Monday, 11 March 2002 at 11:37:41 -0500, Jason Borkowsky wrote: > > I have two FreeBSD machines, both containing a pair of identical hard > drives. I am looking to set up vinum to mirror the hard drives, and am not > having any success. I have searched the FreeBSD archives, the vinum website, > and other websites as well. > > Here is what I've found so far: > > Each drive needs to have the file system type changed from FreeBSD to vinum. > I have done this no problem. (A side question I have about this is will this > affect me if I reboot the machine or am an single user mode? What effects > does changing the file system type have?) > > So now I have two drives, /dev/ad0s1 and /dev/ad2s1 (IDE devices). FreeBSD > calls partition "c:" the complete drive, so on one drive (the drive I want > mirrored), I have all my file partitions. On the drive I want to mirror to, > I only have one partition, c:, which is the whole drive. Before I mirror, do > I need to set up identical partitions? According to the man pages, it seems > I don't have to. > > Now, in the man pages, under "Simplified Configuration", it states that to > mirror a drive, all I need to do is: > > vinum -> mirror -v /dev/ad0s1c /dev/ad2s1c > > The response I SHOULD get is: > > drive vinumdrive0 device /dev/ad0s1c > drive vinumdrive1 device /dev/ad2s1c > > Instead, the actual response I get is: > > Could not allocate device vinumdrive0 > > So what have I done wrong? You didn't RTFM. DRIVE LAYOUT CONSIDERATIONS vinum drives are currently BSD disk partitions. They must be of type vinum in order to avoid overwriting data used for other purposes. Use disklabel -e to edit a partition type definition. The following display shows a typical partition layout as shown by disklabel: 8 partitions: # size offset fstype [fsize bsize bps/cpg] a: 81920 344064 4.2BSD 0 0 0 # (Cyl. 240*- 297*) b: 262144 81920 swap # (Cyl. 57*- 240*) c: 4226725 0 unused 0 0 # (Cyl. 0 - 2955*) e: 81920 0 4.2BSD 0 0 0 # (Cyl. 0 - 57*) f: 1900000 425984 4.2BSD 0 0 0 # (Cyl. 297*- 1626*) g: 1900741 2325984 vinum 0 0 0 # (Cyl. 1626*- 2955*) In this example, partition g may be used as a vinum partition. Parti- tions a, e and f may be used as UFS file systems or ccd partitions. Par- tition b is a swap partition, and partition c represents the whole disk and should not be used for any other purpose. vinum uses the first 265 sectors on each partition for configuration information, so the maximum size of a subdisk is 265 sectors smaller than the drive. > The man page gives no more information than the simple,, one magical > command that should do everything. Well, no, the man page is about 30 pages long. It can't repeat everything everywhere. > Any suggestions are appreciated. Don't use the simplified configuration. It makes it too easy to do things without understanding them. Writing a configuration file makes you think about it. 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