From owner-freebsd-questions@FreeBSD.ORG Tue Dec 12 01:14:55 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8AF7616A506 for ; Tue, 12 Dec 2006 01:14:55 +0000 (UTC) (envelope-from jhfoo-ml@extracktor.com) Received: from mail.extracktor.com (www.nexlabs.com [210.193.32.133]) by mx1.FreeBSD.org (Postfix) with ESMTP id BA5F443E8E for ; Tue, 12 Dec 2006 01:09:22 +0000 (GMT) (envelope-from jhfoo-ml@extracktor.com) Received: (qmail 6722 invoked from network); 12 Dec 2006 01:07:50 -0000 Received: from unknown (HELO ?192.168.1.100?) (jhfoo@nexlabs.com@222.165.92.33) by www.nexlabs.com with SMTP; 12 Dec 2006 01:07:50 -0000 Message-ID: <457E0174.3040902@extracktor.com> Date: Tue, 12 Dec 2006 09:10:12 +0800 From: Foo JH User-Agent: Thunderbird 1.5.0.8 (Windows/20061025) MIME-Version: 1.0 To: John Nielsen , tshadwick@oss-solutions.com References: <200612100905.30430.kirk@strauser.com> <20061211054125.GB681@pubbox.net> <457D1B24.8060109@extracktor.com> <200612111316.21351.lists@jnielsen.net> In-Reply-To: <200612111316.21351.lists@jnielsen.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-questions@freebsd.org Subject: Re: Setting up RAID-1 on 2 unequal disks X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Dec 2006 01:14:55 -0000 Hello John, Tony, Thanks for your responses. I think I will try to go with John's approach (ie via gmirror), as I've used it previously for a raiding on equally-sized disks. John, I will be trying out your suggestions in a while. Hope to get your help later down the road. :) Tony, I'm quite sure your trick will work. I'm just too noob on FBSD to trick vinum. :P John Nielsen wrote: > On Monday 11 December 2006 03:47, Foo JH wrote: > >> Hi all, >> >> I unfortunately have 2 uneuqally sized SATA disks to set up a mirrored >> shared folder: 80GB and 120GB. On the 120GB I plan to set up this way: >> >> /temp 2GB (double the system memory) >> /shared 80GB >> / 38GB >> >> I plan to mirror /shared onto the 80GB. It won't be bootable, but I can >> always mount it onto another FreeBSD machine. >> >> I've read some articles on mirroring on non-equal disks, notably: >> http://people.freebsd.org/~rse/mirror/ >> >> My question is: is there an easier way to do this? The example looks >> quiet daunting for a noobie FreeBSD admin like me. >> > > I would use gmirror. The example page you cite is very thorough and covers > multiple scenarios. I have found gmirror to be extremely easy to use and set > up; much more so than gvinum or even ataraid. > > Gmirrror allows you to use any geom provider as a member (consumer) of a > mirrored set. That includes entire disks (e.g. ad4), slices (e.g. ad4s1), > partitions (e.g. ad4s1a), or even other complex structures (such as a gstripe > set). > > The only hard part is going to be labeling the 120GB disk correctly. You will > most likely want to do it manually using bsdlabel. One approach would be > something like the following. Assume ad4 is the 120GB disk and ad6 is the > 80GB disk. Boot up using a FreeBSD install disk and go into "Fixit" mode. > > # fdisk -BI /dev/ad6 > (it's safe to ignore the warning here) > > # bsdlabel -Bw /dev/ad6s1 > > # sysctl kern.module_path="/dist/boot/kernel" > > # gmirror load > > # gmirror label -b load shared /dev/ad6s1a > ("shared" is the name of your volume.. you can use whatever you want) > > # gmirror list > (will show you details about your new "broken" mirror. Make a note of > the "Mediasize" number listed under the consumer.) > > # fdisk -BI /dev/ad4 > (it's safe to ignore the warning here) > > # bsdlabel -Bw /dev/ad4s1 > > (these are only needed if you don't like/don't know how to use vi) > # EDITOR=ee > # export EDITOR > > # bsdlabel -e /dev/ad4s1 > > Now comes the tricky part. The number shown on the c: line of the label is the > number of 512-byte sectors on the disk. It's good practice to leave 16 > sectors unused at the beginning of the disk; you can see this in the default > whole-disk a: line. Figure out how big you need to make the slice for the > other side of the mirror by dividing the Mediasize number you noted > previously by 512. Then figure out how big you want your swap (if any--you > didn't mention any above) and /temp partitions by multiplying out to the > number of bytes then dividing by 512. Add all of that up plus the 16-sector > space at the beginning and subtract from the size (c: line) to determine how > much is left for /. Calculate all the offsets and put in the fstype (either > 4.2BSD or swap), and put zeroes in the other columns. > > As a reference, here is one of my disks: > > # /dev/ad4s1: > 8 partitions: > # size offset fstype [fsize bsize bps/cpg] > a: 6291456 1048502 4.2BSD 0 0 0 > b: 1048486 16 swap > c: 156312513 0 unused 0 0 # "raw" part, don't > edit > d: 117266625 39045888 4.2BSD 0 0 0 > e: 31705930 7339958 4.2BSD 0 0 0 > > Save the label and exit the editor. > > Now to finish up: > > # gmirror insert shared /dev/ad4s1e > (be sure to use the actual partition device you set up above) > > # newfs -U /dev/mirror/shared > ( /shared ) > # newfs -U /dev/ad4s1a > ( / ) > # newfs -U /dev/ad4s1d > ( /temp ) > > Then exit fixit mode and do a Standard installation. Don't let sysinstall > re-label or newfs anything, just specify the mount points for your / > and /shared filesystems. You'll have to mount the mirror after you're done > with setup (just put it in /etc/fstab manually). > > Obviously, you should understand what all of the above does before you do any > of it, and may need to make changes. > > Good luck, and feel free to ask additional questions. > > JN >