Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

metaattach

Status
Not open for further replies.

kozlow

MIS
Mar 3, 2003
326
US
Ran:
metainit -f d1 1 1 c0t2d0s0
metainit d2 1 1 c0t0d0s0
metainit d0 -m d1
metaroot d0
lockfs -fa
reboot

when the system came back up, ran:

clptcmissun058 root : metattach d0 d2
metattach: clptcmissun058: d2: can't attach labeled submirror to an unlabeled mirror

What am I missing that I recieve the error...
I am trying to mirror /
 
It looks like you're doing it the wrong way around... isn't c0t0d0s0 the one that contains the original copy of the data? If so, you should set that up initially, and then attach the second mirror to it. Annihilannic.
 
When I did a df, it showed that / was mounted on
/dev/dsk/c0t2d0s0. So it looks like I following the instructions correctly....
It must be something I missed or the instructions missed a step. Time to do a little testing. The good thing is that this system is still not being used so I can do crash and burn testing.
 
Found this in the Solaris Documents.... But Does anyone know who to correct the problem?

If you see an error message stating can't attach labeled submirror to an unlabeled mirror, that indicates that you unsuccessfully attempted to attach a RAID 0 volume to a mirror. A labeled volume (submirror) is a volume whose first component starts at cylinder 0, while an unlabeled volume's first component starts at cylinder 1. To prevent the labeled submirror's label from being corrupted, Solaris Volume Manager does not allow labeled submirrors to be attached to unlabeled mirrors

Is this because the bootstrap is on cylinder 0?
 
I don't do this everyday, but here is my two cents...

You should do:

I think you omitted this step:
metadb -a -f -c2 c0t0d0sX c0t2d0sX

X is the slice you configured to hold your metadatabases. It doesn't need to be real big, maybe 100m, probably much less will be fine.

Then you needed to do the following:
metainit -f d1 1 1 c0t2d0s0
metainit -f d2 1 1 c0t0d0s0 (I think you omitted the -f in this line)
metainit d0 -m d1
metaroot d0

Here you should have edited the vfstab to use the meta devices instead of the normal entries; ie you should be using /dev/md/dsk/0 instead of /dev/dsk/c0t0d0s0

reboot

Then you should be able to run:

metattach d0 d2

Then you should be able to run:

metastat | grep prog and see that your disks are syncing.
 
I did get error messages about there being no database when I first ran the metainit, so I had to go back and create the database.

The -f on the metainit is suppose to force if a filesystem already exists on the slice. Since d2 is free, it should not be needed. The example in the manual does not use the -f and I did get a successfull completion code.

I checked my vfstab after running the "metaroot d0" and it shows "/dev/md/dsk/d0 /dev/md/rdsk/d0 / ufs 1 no logging" From what I read, that is what suppose to happen....

There must be something in the way c0t0d0s0 is constructed...

Wish I could have just created logical volumes and Journaled filesystems. Mirroring is a breeze with AIX and HP-UX. May have to pump management for the money for Veritas or just live without mirroring....

Thanks for the replys and if you have any other ideas, the system is still all mine for the destroying.....I mean learning....
 
I'm assuming you formatted your second disk c0t0d0 to reflect the formatting of c0t2d0 - assuming it's Solaris X86..

prtvtoc /dev/rdsk/c0t2d0s2 | fmthard -s - /dev/rdsk/c0t0d0s2

JB
 
Sometimes the fmthard command is not all that reliable. So you may wanna try this:

dd if=/dev/rdsk/c0t2d0s2 of=/dev/rdsk/c0t1d0s2 count=128
 
hmmm, wasn't the problem this labeling thingy?
all the other things kozlow did are correct and
some of the comments rather misleading
sorry guys :-/

Kozlow should check his format
most likely there is the problem;
could you please post the output of:
format
disk c0t20d0s0
verify

Thank you
matt
 

Explains it - if the system has been Jumpstarted, swap is slice 1 but starts on cylinder 0, root is slice 0 but starts further down the disk. Attempt to attach mirror disk with root starting at cylinder 0 will fail. Ensure both disks are laid out identically and mirroring will work
 
do not jumpstart with default FS;
always use explicit layout, otherwise you will have to do it again, and again, and again :-(

matt
 
The dd command should lay out the filesystems identically...
 
I ran the fmthard and then the dd but was not able to have the metattach complete. I started thinking that the database may not have the correct information since I ran the metainit before I re-configured c0t0d0s0. So I ran a "metaclear /dev/md/dsk/d2", then the metainit and the metattach and all is golden now.

Thanks for all the input. Sooner or later I should be able to figure these things out for myself... Until then, I plan on using this forum.....
 
hmmm, but not correct order of commands does not result in that error; making both disks look identical
probably resulted in both disks being "unlabeled";
SDS might be happy now, but might cause some problems later.

Could it be the disk has been used by Veritas VM?

The order (metainit, metaroot, reboot, metattach) is important, though; but fmthard can be done anytime before metattach; I do not see how _this_ could have caused the said error. I think "dd" is a fix, obscuring it.

matt
 
All I can say is that I recieved the same error "d2: can't attach labeled submirror to an unlabeled mirror" after the frmhard and then again after running the dd. It was not until I ran the metaclear and metainit that I was able to run the metattach....

Here is the output from metastat:
clptcmissun058 root : metastat
d0: Mirror
Submirror 0: d1
State: Okay
Submirror 1: d2
State: Okay
Pass: 1
Read option: roundrobin (default)
Write option: parallel (default)
Size: 257040 blocks

d1: Submirror of d0
State: Okay
Size: 257040 blocks
Stripe 0:
Device Start Block Dbase State Reloc Hot Spare
c0t2d0s0 0 No Okay Yes


d2: Submirror of d0
State: Okay
Size: 257040 blocks
Stripe 0:
Device Start Block Dbase State Reloc Hot Spare
c0t0d0s0 0 No Okay Yes


Device Relocation Information:
Device Reloc Device ID
c0t0d0 Yes id1,dad@AST340016A=3HS8CEWG
c0t2d0 Yes id1,dad@AST340016A=3HS8ALXF
 
well, it should look like that, since it works
:)
just for curiousity, can you please post
format - select disk c0t20d0s0 - verify

Thank you!
matt
 
Matt - I think the root (hoho) of the problem is the issue with the layout of slices when you let Solaris format the disks using Webstart during installation. It puts root on slice 0 but at cyl xyz, swap on slice 1 at cyl 0 because it uses the first few cylinders of the disk for miniroot during install and so can't have root there - swap later overwrites miniroot when the system boots for the first time.

If you then format the mirror disk by hand you do what any normal admin would do you put root on slice 0, cyl 0 and swap on slice 1 cyl xyz. Therein lies the problem - Disksuite won't mirror a partition starting on cyl xyz with one on cyl 0 since it thinks it's going to trash the VTOC (label) cyl 0, block 0 by doing that - hence all the gibberish about labelled and unlabelled mirrors. I'm guessing that Disksuite understands the cyl 0 layout and doesn't mirror block 0.

JB
 
julianbarnett: yup, perfectly agree with you; that's why the result of "format - verify" would have been useful and might be, still.

Still wondering it is working now, because the solution he described does not fit the problem; really would like to understand this.

Using the wrong order of commands results in other error messages. Using default partition results in "wrong" order of slices, but fmthard should have corrected this; therefore I am confused :-/

whatever ....
matt
 
clptcmissun058 root : format - select disk c0t2d0s0 - verify

AVAILABLE DISK SELECTIONS:
0. c0t2d0s0 <ST340016A cyl 19156 alt 2 hd 16 sec 255>
/pci@1f,0/ide@d/dad@2,0

I was told to break out of this command after I recieve this... Is this what you need or what do you want me to enter at &quot;Specify disk (enter its number):&quot;?
 
who told you this?
format
select disk
p
p
q
q

or
format
select disk
verify
quit

all those things you can do; just avoid to type label!!
and that is exactly the point, this &quot;labeling&quot;
matt
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top