Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 7 Jan 2003 12:39:15 +0100 (CET)
From:      Soeren Schmidt <sos@spider.deepcore.dk>
To:        Soeren Schmidt <sos@spider.deepcore.dk>
Cc:        "Andrew P. Lentvorski, Jr." <bsder@allcaps.org>, Nate Lawson <nate@root.org>, current@FreeBSD.ORG
Subject:   Re: mirrored root fs?
Message-ID:  <200301071139.h07BdFfG003172@spider.deepcore.dk>
In-Reply-To: <200301070751.h077pdhq057490@spider.deepcore.dk>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200301071139.h07BdFfG003172>