re-attach a mirrored metadevice
Dear Group,
for the mirroring of our partitions, we use Solstice DiskSuite. I am
not sure about the version, but the only paper documentation I find in
the office is about 4.2 . Our systems are SPARC with Solaris 8.
In order to install a new software on the /usr/ partition, I wanted to
make sure that the previous installation would not get lost. This
partition is metadevice d2, which is a Trans of mirror d20 and logging
device d7 . Mirror d20 has d21 and d22 as submirrors:
d2
/\
d20d7
/ \
d21 d22
Before the installation, I had metadetach'ed d21 from d20. I was hoping
that in the case the installation would go wrong, that it would be
possible to copy the content of submirror d21 to submirror d22 and so
restoring the system in its original state.
Unfortunately, the installation /did/ go wrong, but I can't figure out
how to put the above procedure in to practice. Detaching d22 of d20 is
not possible: "metadetach: <SERVERNAME>: d20: attempt to detach last running submirror".
And if I would reattach d21 to d20, it would copy the contents of d22
immediately to d21, loosing the original state of the /usr/-partition,
no?
In the documentation, I could not find what I needed, can somebody lead me on the way?
A summary with the correct solution will be posted.
Kind greetings,
Wim
[1486 byte] By [
vvim] at [2007-11-26 9:00:07]

# 1
> Dear Group,
>
> for the mirroring of our partitions, we use Solstice
> DiskSuite. I am
> not sure about the version, but the only paper
> documentation I find in
> the office is about 4.2 . Our systems are SPARC with
> Solaris 8.
You should check docs.sun.com under Solaris 8. Solaris 8 ships with and uses 4.2.1.
> In order to install a new software on the /usr/
> partition, I wanted to
> make sure that the previous installation would not
> get lost. This
> partition is metadevice d2, which is a Trans of
> mirror d20 and logging
> device d7 . Mirror d20 has d21 and d22 as submirrors:
>
>
>d2
>\
> 0d7
>/ \
> d22
>
> Before the installation, I had metadetach'ed d21 from
> d20. I was hoping
> that in the case the installation would go wrong,
> that it would be
> possible to copy the content of submirror d21 to
> submirror d22 and so
> restoring the system in its original state.
>
> Unfortunately, the installation /did/ go wrong, but I
> can't figure out
> how to put the above procedure in to practice.
> Detaching d22 of d20 is
> not possible: "metadetach: <SERVERNAME>: d20: attempt
> to detach last running submirror".
>
> And if I would reattach d21 to d20, it would copy the
> contents of d22
> immediately to d21, loosing the original state of the
> /usr/-partition,
> no?
Yes.
> In the documentation, I could not find what I needed,
> can somebody lead me on the way?
First of all, I'm uncomfortable with the idea of simply replacing /usr. I would rather replace everything. Unfortunately, you probably don't have offline mirrors for them.
Basically, you can't do this while its mounted. You'll have to reboot at a minimum.
Create a new mirror/trans device. Attatch d21 to it. Check that the filesystem is valid, then make that your new /usr mountpoint in /etc/vfstab and reboot.
If the boot succeeds, you can force d20 to detach and reattach it to the new mirror.
--
Darren
# 2
Dear Darren and Group,
Darren_Dunham wrote:
[...]
> First of all, I'm uncomfortable with the idea of
> simply replacing /usr. I would rather replace
> everything. Unfortunately, you probably don't have
> offline mirrors for them.
No, I'm afraid not. We have offline mirrors for our servers that are used in production, but what I am talking about is a test-server, of which we don't take offline mirrors and I try to avoid a reinstall.
> Basically, you can't do this while its mounted.
> You'll have to reboot at a minimum.
>
> Create a new mirror/trans device. Attatch d21 to it.
> Check that the filesystem is valid, then make that
> your new /usr mountpoint in /etc/vfstab and reboot.
>
> If the boot succeeds, you can force d20 to detach and
> reattach it to the new mirror.
Thank you very much, this sounds really interesting.
But I got an error that when I tried to detach d22 from d20 (d21 and d22 are submirrors of d20), that d22 was the only submirror of d20.
When I try to 'metaclear' d20, it kept saying that the metadevice was in use, even after I unmounted it.
I am afraid I was not able to do it exactly as you proposed. I think the following method does something similar, but it is less clean than yours:
Summary:
* change /etc/vfstab so that d21 (the copy with the original files)
gets loaded as the /usr
* reboot
* mount the metadevice (d2 and thus d22 with the new
installation) to a directory (say /tmp/media)
* delete the badly installed program files from /tmp/media
* copy the old program files (from d21) to /tmp/media
* umount d2 and change /etc/vfstab so that it will use d2 as
the /usr-partition
* reboot (and test)
* metattach d21 to d20 and watch it resynching
But thank you very much for your comments.
Kind greetings,
Wim
vvim at 2007-7-6 23:04:23 >

# 3
> But I got an error that when I tried to detach d22
> from d20 (d21 and d22 are submirrors of d20), that
> d22 was the only submirror of d20.
> When I try to 'metaclear' d20, it kept saying that
> the metadevice was in use, even after I unmounted
> it.
Odd. The metaclear should have worked as long as it was unmounted.
You might check the device with either fuser or lsof.
--
Darren
# 4
> > But I got an error that when I tried to detach d22
> > from d20 (d21 and d22 are submirrors of d20), that
> > d22 was the only submirror of d20.
> > When I try to 'metaclear' d20, it kept saying that
> > the metadevice was in use, even after I unmounted
> > it.
>
> Odd. The metaclear should have worked as long as it
> was unmounted.
>
> You might check the device with either fuser or
> lsof.
Yes, I guess you are right. Unfortunately, I have to work on another project on the moment, so I don't know if I can post a valuable reply in the near future.
Thanks for the comments and my apologies for my rudeness, kind greetings,
Wim
vvim at 2007-7-6 23:04:23 >
