From owner-freebsd-current Tue Jan 7 3:39:33 2003 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5576237B405 for ; Tue, 7 Jan 2003 03:39:31 -0800 (PST) Received: from spider.deepcore.dk (cpe.atm2-0-56339.0x50c6aa0a.abnxx2.customer.tele.dk [80.198.170.10]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3843F43E4A for ; Tue, 7 Jan 2003 03:39:21 -0800 (PST) (envelope-from sos@spider.deepcore.dk) Received: (from sos@localhost) by spider.deepcore.dk (8.12.5/8.12.6) id h07BdFfG003172; Tue, 7 Jan 2003 12:39:15 +0100 (CET) (envelope-from sos) From: Soeren Schmidt Message-Id: <200301071139.h07BdFfG003172@spider.deepcore.dk> Subject: Re: mirrored root fs? In-Reply-To: <200301070751.h077pdhq057490@spider.deepcore.dk> To: Soeren Schmidt Date: Tue, 7 Jan 2003 12:39:15 +0100 (CET) Cc: "Andrew P. Lentvorski, Jr." , Nate Lawson , current@FreeBSD.ORG X-Mailer: ELM [version 2.4ME+ PL98b (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=ISO-8859-1 Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG It seems Soeren Schmidt wrote: > > It should work on 4.7 forward, but its been a while since I played with it. > Another thing is that its a pain to make a mirror on an already running > system (which is often wanted), so I plan to add an option to atacontrol > to tell where to get the master from, and then do an automatic rebuild > during the create phase ie: > > atacontrol create RAID1 ad0 ad2 source ad0 > > This will create a mirror using ad0 and ad2, and start a rebuild to > build the master with data from ad0. This way you can do a normal > install, add a second (identical or bigger) disk, and make a > mirror out of those. You just have to change your fstab before > rebooting (ad0 -> ar0) in order to boot... For those that are brave enough to play with this I just created the following small change to ata-raid.c. Now it will always rebuild the array on creation, using the first disk as the master image. This allows you to turn any set of ATA disks into a mirror on the fly.. Remember to rename you filesystems in fstab before booting :) Index: ata-raid.c =================================================================== RCS file: /home/ncvs/src/sys/dev/ata/ata-raid.c,v retrieving revision 1.50 diff -u -r1.50 ata-raid.c --- ata-raid.c 2 Oct 2002 07:44:17 -0000 1.50 +++ ata-raid.c 7 Jan 2003 10:02:50 -0000 @@ -374,7 +374,14 @@ rdp->flags |= AR_F_READY; ar_table[array] = rdp; + + /* kick off rebuild here */ + if (setup->type == 2) { + rdp->disks[1].flags &= ~AR_DF_ONLINE; + rdp->disks[1].flags |= AR_DF_SPARE; + } ar_attach_raid(rdp, 1); + ata_raid_rebuild(array); setup->unit = array; return 0; } -Søren To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message