Matty wrote: > On Mon, 8 Aug 2005, Tony Nguyen wrote: > >> Frank Batschulat wrote: >> >>> On Wed, 03 Aug 2005 16:02:26 +0200, Matty <matty91 at gmail.com> wrote: >>> >>>> >>>> When a system boots from a mirrored meta device, does it always >>>> sync from the lowest submirror (e.g., Submirror 0) to the highest >>>> submirror (e.g., Submirror 1)? Is there a way to force a >>>> resynchronization from the highest Submirror to the lowest >>>> Submirror (this would be helpful when you trash the primary mirror >>>> when booted from CDROM, and don't want to corrupt the working >>>> mirror when you reboot). I usually control this my moving RC >>>> scripts and booting from the secondary mirror, but wanted to see >>>> what other methods existed. The section "RAID-1 Volume (Mirror) >>>> Resynchronization" on docs.sun.com doesn't seem to address this >>>> specific scenario: >>>> >>>> http://docs.sun.com/app/docs/doc/816-4520/6manpiejc?a=view >>> >>> >>> >>> this question is far better answered by the SVM folks on the >>> LVM discussion list: >>> >>> http://www.opensolaris.org/jive/forum.jspa?forumID=16 >>> >>> lvm-discuss at opensolaris.org >>> >>> --- >>> frankB >>> _______________________________________________ >>> ufs-discuss mailing list >>> ufs-discuss at opensolaris.org >> >> >> What do you mean by 'trashing the mirror when booting from the >> CD-ROM'? I'm guessing you mean trashing(writing to) the first >> submirror/boot device. Clarifications on this will help us better >> answer your questions. Some information on > > > I was thinking of a case where you accidentally ran rm -rf * on a > directory under / on submirror 0. >
I see. In general, it's probably not a good idea to mount the root fs with read/write (especially when, it's part of a mirrored root). >> >> There's no way for a user to specify which submirror the resync will >> get data from. However, in your case, a good workaround, similar to >> what you've done > > > So does it always sync from Submirror 0 to Submirror 1 in the case of a > mirror? If you boot from Submirror 1, it seems logical that it would sync > from submirror 1 back to submirror 0. From the test I just did, this > doesn't seem to be the case. > Yes, it always sync from submirror 0 (or the first submirror with available data) to the other submirrors. The logic here is that data is written to the mirror starting from submirror 0 (and incremented to the highest submirror). Thus, when a resync happens, we effectively do a write-after-read when choosing the first submirror to read from and write to the rest. Have a look at resync_read_buffer and mirror_write_strategy to confirm :^) I'd probably agree that it makes sense to read from the booted submirror. Since SVM mirrors are used for more than just root mirroring, the above solution is not applicable to general mirror syncs. An rfe should probably be filed on this. Thinking outloud: The resync code can probably checks to see whether the mirror is a root mirror and get the submirror that's being booted from. A flag can then be passed to the kernel to indicate which submirror to read from for the / mirror :^) --tony >> is: >> - detach the primary mirror before booting from the CD-ROM (you also >> need to change the default boot device in either the BIOS or eeprom). >> - after trashing the old primary boot device, reboot using the >> remaining submirror. >> - attach the old submirror to the mirror to sync its data. > > > Thanks for the info! > >> >> -tony >> > _______________________________________________ > lvm-discuss mailing list > lvm-discuss at opensolaris.org