Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to mirror an existing Solaris Volume Manager concat metadevice.

726 views
Skip to first unread message

Peter Havens

unread,
May 2, 2008, 11:17:51 AM5/2/08
to
I have a Solaris 10 system using SAN disk from an external unit. The
SAN disk is configured as a Solaris Volume Manager concat metadevice
and hosts various soft partitions. I need to migrate everything on the
current SAN disk to new SAN disk on a different external unit, and
then retire the old SAN unit.

For the migration, I would like to mirror the current metadevice to
the new disk. Mirroring should hopefully reduce downtime and help
ensure the accuracy of the data migration. However, I haven't found
any documentation on how to do this.

I was wondering, if my current metadevice is named d90, can I create a
new mirror named d95 that includes d90 as a submirror (e.g. metainit
d95 -m d90) without damaging d90, and while d90 is live? If so, then I
could attach the new metadevice to d95, and be on my merry way. If
not, is there another way?

One alternative is, of course, to shut everything down and copy the
data over manually, but I'd like to avoid that if possible.

Thanks,
Pete

Wolfgang

unread,
May 2, 2008, 4:02:34 PM5/2/08
to
Peter Havens schrieb:

> I have a Solaris 10 system using SAN disk from an external unit. The
> SAN disk is configured as a Solaris Volume Manager concat metadevice
> and hosts various soft partitions. I need to migrate everything on the
> current SAN disk to new SAN disk on a different external unit, and
> then retire the old SAN unit.
>
> For the migration, I would like to mirror the current metadevice to
> the new disk. Mirroring should hopefully reduce downtime and help
> ensure the accuracy of the data migration. However, I haven't found
> any documentation on how to do this.
>
> I was wondering, if my current metadevice is named d90, can I create a
> new mirror named d95 that includes d90 as a submirror (e.g. metainit
> d95 -m d90) without damaging d90, and while d90 is live? If so, then I
> could attach the new metadevice to d95, and be on my merry way. If
> not, is there another way?

and why not establish a second mirror on your d90 and throw away the old
one after that, like
metainit d89 ...
metanit d90 -m d89
?

I am not shure if that works with svm concat, but it seems to me as the
more logical solution and the way most storage migrations i know about
have done.

there are some special solutions, which work over IP, but thats mor for
migration of storage and machines.

Wolfgang


Darren Dunham

unread,
May 2, 2008, 4:43:14 PM5/2/08
to
Peter Havens <peter....@gmail.com> wrote:
> I was wondering, if my current metadevice is named d90, can I create a
> new mirror named d95 that includes d90 as a submirror (e.g. metainit
> d95 -m d90) without damaging d90, and while d90 is live?

Yes.

> If so, then I
> could attach the new metadevice to d95, and be on my merry way.

Not while d90 is live.

You can set up the mirror (one-way only), but you cannot start using the
mirror until you unmount d90 from use. So one possible path:

d90 in use (mounted)
create mirror d95
attach d90 to d95
create metadevice on new storage (d91?)
unmount d90
mount d95
attach d91 to d95

You have downtime for the storage this way (it has to be unmounted), but
it only has to be unmounted for a short period of time.

--
Darren Dunham ddu...@taos.com
Senior Technical Consultant TAOS http://www.taos.com/
Got some Dr Pepper? San Francisco, CA bay area
< This line left intentionally blank to confuse you. >

Wolfgang

unread,
May 2, 2008, 5:35:29 PM5/2/08
to
Wolfgang schrieb:

> Peter Havens schrieb:
>> I have a Solaris 10 system using SAN disk from an external unit. The
>> SAN disk is configured as a Solaris Volume Manager concat metadevice
>> and hosts various soft partitions. I need to migrate everything on the
>> current SAN disk to new SAN disk on a different external unit, and
>> then retire the old SAN unit.
>
> I am not shure if that works with svm concat, but it seems to me as the
> more logical solution and the way most storage migrations i know about
> have done.
>

so i have testet it: i need a submirror for this :-( (i was mislead by
veritas plexes) ...

Peter Havens

unread,
May 2, 2008, 6:06:49 PM5/2/08
to
On May 2, 2:43 pm, ddun...@taos.com (Darren Dunham) wrote:
>
> ...You have downtime for the storage this way (it has to be

> unmounted), but it only has to be unmounted for a short period
> of time.

It's only a short period because I can mount d95 file systems
immediately after unmounting d90 file systems and reconfiguring the
zones, right? Then I can let d91 sync up while d95 is in use (with the
corresponding performance penalty, of course)?

Thanks for all the help,
Pete

Peter Havens

unread,
May 2, 2008, 6:19:47 PM5/2/08
to
On May 2, 2:02 pm, Wolfgang <wtra...@AT.web.de> wrote:
> Peter Havens schrieb:

>
> > The SAN disk is configured as a Solaris Volume Manager concat metadevice
> > and hosts various soft partitions...if my current metadevice is named

> > d90, can I create a new mirror named d95 that includes d90 as a
> > submirror (e.g. metainit d95 -m d90) without damaging d90, and while d90
> > is live?
>
> and why not establish a second mirror on your d90 and throw away the old
> one after that, like
> metainit d89 ...
> metanit d90 -m d89

Well, the d90 metadevice isn't a mirror. It's a simple concat
metadevice. So, I'm not sure I can "re-create" it as a mirror and
attach a submirror to it (is that possible?). Perhaps I misunderstood
what you meant, though.

Thanks,
Pete

JulianJ

unread,
May 2, 2008, 6:43:43 PM5/2/08
to
Peter Havens wrote:

You will need to create the mirror and attach the sub mirror to it.
Read the man page for metainit:
http://docs.sun.com/app/docs/doc/816-0211/6m6nc66vo?a=view

You already have the sub mirror d90
Get your existing setup
metastat -p
metadb -i

If you have any meta state databases on the old SAN you'll need to create
new ones some place else and delete the old ones.
metadb -a -c 3 cXtXdXsX
metadb -d cXtXdXsX

Start work on the file system:
umount d90 file system
metainit d95 -m d90
Amend your system to use the the new one way mirror.
mount d95 mirror
create your new sub mirror
metainit d91 4 1 slice1 slice2 slice3 slice4 or whatever type of metadevice
you want to create. It can not be smaller than the existing!
metattach d95 d91
Allow the mirroring to complete
metadettach d95 d90
metaclear d90

metastat -p
update /etc/lvm/md.tab


You may want to grow your file system into the new volume
growfs -M /d90 /dev/md/rdsk/d90

Always use a mirror not a sub mirror as it takes some of the hasle out of
doing this type of work!

--
Thanks

JulianJ

(remove nopsam from email)

Peter Havens

unread,
May 2, 2008, 7:16:42 PM5/2/08
to
On May 2, 4:43 pm, JulianJ <juli...@btinternet.nospam.com> wrote:
>
> ...You will need to create the mirror and attach the sub mirror to it...

Exactly my plan.

> ...You already have the sub mirror d90...

Correct. However, I think Wolfgang thought d90 was already a mirror,
but I'm not sure.

> ...Always use a mirror not a sub mirror as it takes some of the hasle out of


> doing this type of work!

I agree. However, I inherited this system without a mirror in place
(probably because the real RAIDing is being done on the backend with
the SAN device), and am just trying to get some maintenance done on
it. My thought was to try and mirror the old SAN disk to new SAN disk,
thus reducing downtime and ensuring accurate transfer of data.

Thanks,
Pete

JulianJ

unread,
May 3, 2008, 4:35:38 AM5/3/08
to
Peter Havens wrote:

That is what my idea should do.
I don't know your system, seeing the output from metastat -p would help.
If d90 is a sub mirror and the mirror hasn't been created you will need to
do this.
SVM doesn't know anything about your SAN and it can't mirror your data
without having the correct metadevices in place.
if you create a mirror with d90 as a sub mirror and then attach another sub
mirror it will start to sync.

+----- /dev/md/dsk/d90
/dev/md/dsk/d95-|
+----- /dev/md/dsk/d91

However if d90 is still mounted then any changes sent to that device won't
be sent to the other sub mirror
Filesystem Size Used Avail Use% Mounted on
/dev/md/dsk/d90 21G 1.4G 20G 7% /d90-mountpoint

You will need to change to use:
Filesystem Size Used Avail Use% Mounted on
/dev/md/dsk/d95 21G 1.4G 20G 7% /d90-mountpoint

This way any writes made to the volume will go to d95. SVM will then ensure
it goes to both sub mirrors.

If you have any other SAN storage I would suggest you have mirrors mounted
not sub mirrors. That way when you need to do this all you have to do is
attach the new sub mirror wait for it to sync and detach the old sub
mirror.

Canuck57

unread,
May 3, 2008, 5:40:13 PM5/3/08
to

"Peter Havens" <peter....@gmail.com> wrote in message
news:ed2a7d7f-afd6-45b1...@m44g2000hsc.googlegroups.com...

>I have a Solaris 10 system using SAN disk from an external unit. The
> SAN disk is configured as a Solaris Volume Manager concat metadevice
> and hosts various soft partitions. I need to migrate everything on the
> current SAN disk to new SAN disk on a different external unit, and
> then retire the old SAN unit.

Yes, you may be able to do this, and not even go down. But takes some
planning and precision. And much depends on how it is already configured.
There are some things that may necessitate a reboot or remounting the file
systems.

> For the migration, I would like to mirror the current metadevice to
> the new disk. Mirroring should hopefully reduce downtime and help
> ensure the accuracy of the data migration. However, I haven't found
> any documentation on how to do this.

In simplified terms, yes, if your disks are already mirred on the system.

- create a 3rd mirror, same size and meta devices
- add the third mirror to the mounted d90
- sync it up
- split off one of the old mirrors.

> I was wondering, if my current metadevice is named d90, can I create a
> new mirror named d95 that includes d90 as a submirror (e.g. metainit
> d95 -m d90) without damaging d90, and while d90 is live? If so, then I
> could attach the new metadevice to d95, and be on my merry way. If
> not, is there another way?

But in above, it will not work. While you might be able to create d95 as a
mirrored device, and add d90 to to it, then say add a mirror d96 to d95 as a
mirror, mirroring isn't going to work right unless the mounted device is a
mirrored device. That is, d90 must be a mirrored device and not a concat.

This would work:

d90 - mirrored and mounted device
\- d91 - concat of 1 or more disks/partitions, mirror 1 of d90
\- d92 - concat of 1 or more disks/partitions, mirror 2 of d90

You then add new disk as: (and remember metadb devices if any!!!)

d90 - mirrored and mounted device
\- d91 - concat of 1 or more disks/partitions, mirror 1 of d90
\- d92 - concat of 1 or more disks/partitions, mirror 2 of d90
\- d93 - concat of 1 or more disks/partitions, mirror 3 of d90
\- d94 - concat of 1 or more disks/partitions, mirror 4 of d90

Sync them up. Then remove d91 and d92, remove both from the mirror d90 and
d91/d92 definitions including metadb entries if they exist. You then end up
with:

d90 - mirrored and mounted device
\- d93 - concat of 1 or more disks/partitions, mirror 1 of d90
\- d94 - concat of 1 or more disks/partitions, mirror 2 of d90

But as I said, d90 must be the mounted and mirrored device. If it is a
concat, then you either must create a mirror device and remount or use your
method below.

> One alternative is, of course, to shut everything down and copy the
> data over manually, but I'd like to avoid that if possible.
>
> Thanks,
> Pete

And in any case, backups before you do anything. Would not hurt to read as
much as you can get on SVM as while it isn't idiot proof, it is lean, mean
fast and flexible when used correctly. It can even do RAID 0+1 on odd
numbers of disks. Say you had 3 disks. SVM can do it.


Canuck57

unread,
May 3, 2008, 5:56:48 PM5/3/08
to

"JulianJ" <jul...@btinternet.nospam.com> wrote in message
news:I4edndG0w9eCBIbV...@bt.com...

He also may want to check if his meta devices are on those disks. A quorum
is needed.


JulianJ

unread,
May 3, 2008, 6:37:09 PM5/3/08
to
Canuck57 wrote:

The disks will be meta devices if they are under LVM control.
I covered meta state database above. Well mentioned them!
You do need over 50% of your meta state databases at boot time hence the
comments above.
I don't recall having to have a quorum disk for LVM.
The only place I've used quorum disks is in Sun Cluster - you want to keep
away from split brains! That could cause you some serious problems.

Just remembered that this is for soft partitions.
Best to do a
metarecover d90 -p
before doing any work.
Also check again after attaching the new sub mirror and again after
detaching it. If you lose the extent headers you could lose your data.
If at any point it doesn't look right find the fix before continuing.

And of course the one thing we haven't said.
Back it up before you do anything.

Darren Dunham

unread,
May 5, 2008, 12:30:53 PM5/5/08
to
Peter Havens <peter....@gmail.com> wrote:
> On May 2, 2:43 pm, ddun...@taos.com (Darren Dunham) wrote:
>>
>> ...You have downtime for the storage this way (it has to be
>> unmounted), but it only has to be unmounted for a short period
>> of time.
>
> It's only a short period because I can mount d95 file systems
> immediately after unmounting d90 file systems and reconfiguring the
> zones, right?

Should be able to.

> Then I can let d91 sync up while d95 is in use (with the
> corresponding performance penalty, of course)?

Yes.

Peter Havens

unread,
May 9, 2008, 4:24:48 PM5/9/08
to
On May 2, 2:43 pm, ddun...@taos.com (Darren Dunham) wrote:
> Peter Havens <peter.hav...@gmail.com> wrote:
> >
> > I was wondering, if my current metadevice is named d90, can I
> > create a new mirror named d95 that includes d90 as a submirror
> > (e.g. metainit d95 -m d90) without damaging d90, and while d90 is
> > live?
>
> ...Not while d90 is live. You can set up the mirror (one-way only),

> but you cannot start using the mirror until you unmount d90 from
> use. So one possible path:
>
> d90 in use (mounted)
> create mirror d95
> attach d90 to d95
> create metadevice on new storage (d91?)
> unmount d90
> mount d95
> attach d91 to d95

I finally got some extra disk to test this. It seems like you /can't/
create a new mirror by using an existing concat metadevice as one of
its submirrors. Maybe I made a mistake or missed something...

The following shows the test configuration and resulting error when
trying to establish a mirror named d90 using a previous concat named
d91 (note that the metadevice names have changed slightly from the
previous examples):

localhost ~ $ metastat -c | g d9
d101 p 5.0GB d91
d100 p 5.0GB d91
d91 s 33GB c0t2d0s2

localhost ~ $ zoneadm list -vi
ID NAME STATUS PATH BRAND IP
0 global running / native shared
- testzone installed /zones/testzone native shared

localhost ~ $ grep d100 /etc/vfstab
/dev/md/dsk/d100 /dev/md/rdsk/d100 /zones/testzone ufs 2 yes logging

localhost ~ $ zonecfg -z testzone info
...
zonepath: /zones/testzone
...
fs:
dir: /app
special: /dev/md/dsk/d101
raw: /dev/md/rdsk/d101
type: ufs
options: [rw]

localhost ~ $ mount | awk '/md/{print $3}'
/dev/md/dsk/d0
/dev/md/dsk/d30
/dev/md/dsk/d40

localhost ~ $ sudo metainit d90 -m d91
metainit: localhost: d91: invalid unit

0 new messages