Gmirror - how to do?
Pawel Jakub Dawidek
pjd at FreeBSD.org
Sat Feb 5 12:12:43 PST 2005
On Sat, Feb 05, 2005 at 01:57:05PM -0600, Karl Denninger wrote:
+> Another quickie someone may know how to handle.
+> I've got a 2-drive RAID1 mirror I wish to back up.
+> The easy way appears to be to attach a third drive, let it sync, detach it
+> and then you have a backup, right?
+> So I do the following:
+> atacontrol attach 2 (attach new disk on external adapter)
+> gmirror insert boot ad4s1 (insert the backup into the existing mirror)
+> wait (while the disk synchronizes - 3-4 hours)
+> gmirror remove boot ad4s1 (remove third copy from mirror)
+> atacontrol detach 2 (remove device from the system)
+> Now I can go pull the carrier "cleanly".
+> Except for one small problem - when you do this, then try to boot the
+> backup volume it fails, because gmirror has marked the metadata as "do
+> not use" when you removed it, yet the /etc/fstab entries all point to a
+> mirror that isn't there.
+> So... how do you accomplish this?
+> Detach the BUS underlying the drive without warning gmirror first (e.g.
+> "atacontrol detach 2", without the preceding "gmirror remove"), thereby
+> forcing a "dirty" disconnect? I'd rather not, although if I must, that I
+> suppose would work. However, if I do this, then gmirror thinks I have a
+> third volume present, and as a consequence as soon I re-init that channel
+> and geom sees the disk it will immediately begin a rebuild (whether this is
+> bad or not I suppose is a matter of interpretation)
In you case I suggest do this:
1. atacontrol attach 2
2. gmirror insert boot ad4s1
<wait for sync>
3. gmirror remove boot ad4s1
4. gmirror label boot ad4s1
5. atacontrol detach 2
In 4th step, you labeling only one provider with the same name.
It will be tasted, but ignored, because mirror 'boot' is already
GEOM_MIRROR: Device boot already configured.
Now it should be bootable.
Remember not to boot the main machine with this disk inside, as it can
be tasted before your main 'boot' mirror. Inserting this disk after
boot, when your 'boot' mirror is configured should be safe.
Pawel Jakub Dawidek http://www.wheel.pl
pjd at FreeBSD.org http://www.FreeBSD.org
FreeBSD committer Am I Evil? Yes, I Am!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-geom/attachments/20050205/a7e4fff1/attachment.bin
More information about the freebsd-geom