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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

undo root (/) mirror w/ SDS 1

Status
Not open for further replies.

ponetguy2

MIS
Aug 28, 2002
442
0
0
US
I'm trying to undo my root (/) mirror. Here is my metastat and vfstab output:

d1: Mirror
Submirror 1: d2
State: Okay
Pass: 1
Read option: roundrobin (default)
Write option: parallel (default)
Size: 2048301 blocks

d2: Submirror of d1
State: Okay
Size: 2048301 blocks
Stripe 0:
Device Start Block Dbase State Reloc Hot Spare
c1t1d0s0 0 No Okay Yes
d0: Concat/Stripe
Size: 2048301 blocks
Stripe 0:
Device Start Block Dbase Reloc
c1t0d0s0 0 No Yes

# metaroot d0
xpress19# cat /etc/vfstab
#device device mount FS fsck mount mount
#to mount to fsck point type pass at boot options
#
fd - /dev/fd fd - no -
/proc - /proc proc - no -
/dev/dsk/c1t0d0s1 - - swap - no -
/dev/md/dsk/d0 /dev/md/rdsk/d0 / ufs 1 no -
/dev/dsk/c1t0d0s6 /dev/rdsk/c1t0d0s6 /usr ufs 1 no -
/dev/dsk/c1t0d0s3 /dev/rdsk/c1t0d0s3 /var ufs 1 no -
/dev/dsk/c1t0d0s7 /dev/rdsk/c1t0d0s7 /export/home ufs 2 yes -
/dev/dsk/c1t0d0s5 /dev/rdsk/c1t0d0s5 /opt ufs 2 yes -
swap - /tmp tmpfs - yes -


I want to make d0 my Mirror instead of d1. I accidentaly did a metadetach d1 d0. I
tried to metattach d1 d0, but it does not seem to work. Plus in vfstab, my / is d0.
Any recommendations? Here was my plan, but it went to hell when I screwed-up the
metadetach part:

Example:
# metadetach d1 d2
d1: submirror d2 is detached

# metaroot /dev/dsk/c1t0d0s0

# reboot
...

# metaclear -r d1
d1: Mirror is cleared
d2: Concat/Stripe is cleared

# metaclear d2
d20: Concat/Stripe is cleared

In this example, root (/) is a two-way mirror named d1; its submirrors are
d0 and d2, which are made of slices /dev/dsk/c1t0d0s0 and /dev/dsk/c1t1d0s0,
respectively. The metastat command verifies that at least one submirror is in the
"Okay" state.


 
Will this work?

xpress19# metastat


d1: Mirror
Submirror 1: d2
State: Okay
Pass: 1
Read option: roundrobin (default)
Write option: parallel (default)
Size: 2048301 blocks

d2: Submirror of d1
State: Okay
Size: 2048301 blocks
Stripe 0:
Device Start Block Dbase State Reloc Hot Spare
c1t1d0s0 0 No Okay Yes


d0: Concat/Stripe
Size: 2048301 blocks
Stripe 0:
Device Start Block Dbase Reloc
c1t0d0s0 0 No Yes

Device Relocation Information:
Device Reloc Device ID
c1t1d0 Yes id1,ssd@w20000004cfc95ea7
c1t0d0 Yes id1,ssd@w20000004cfe51bd5



Unmirror root (/)

The root file system is currently
mounted on a one-way mirrored volume named d1 that consists of one submirror d2. Before I created
this one-way mirror for the root file system, the file system was mounted on the slice /dev/dsk/c1t0d0s0.
I want to unmirror the file system while preserving the data for the root
file system, remove all volumes that were involved in the mirrored volume, and return the file system back to normal
to where it existed; mounted on /dev/dsk/c1t0d0s0.

1. First, run the metastat command to verify that at least one submirror is in the "Okay" state.

d1: Mirror
Submirror 1: d2
State: Okay
Pass: 1
Read option: roundrobin (default)
Write option: parallel (default)
Size: 2048301 blocks

d2: Submirror of d1
State: Okay
Size: 2048301 blocks
Stripe 0:
Device Start Block Dbase State Reloc Hot Spare
c1t1d0s0 0 No Okay Yes


d0: Concat/Stripe
Size: 2048301 blocks
Stripe 0:
Device Start Block Dbase Reloc
c1t0d0s0 0 No Yes

Device Relocation Information:
Device Reloc Device ID
c1t1d0 Yes id1,ssd@w20000004cfc95ea7
c1t0d0 Yes id1,ssd@w20000004cfe51bd5

2. Next, run the metadetach command on the mirror that contains the root file system. In this case, I will detach
d2 to make a one-way mirror:

# metadetach d1 d2


3. The metaroot command is then run, using the rootslice that the system is going to boot from. This edits the
/etc/system and /etc/vfstab files to remove information specifying the mirroring of root (/):

# metaroot /dev/dsk/c1t0d0s0

4. Reboot the system

# shutdown -y -g0 -i6

5. To remove the mirror volume and submirrors, use the metaclear command as follows:

# metaclear -r d1

# metaclear d2

# metaclear d0

6. Use the metastat command to verify that the mirrored and contactenated volume were removed:

# metastat d1 d2 d0
 
Don't know if you can use it for root but check out the 'metarename' command.
 
It might be easier to comment/delete out the MD root entry in /etc/system and restore the original(non_MD) /etc/vfstab.
Reboot - then metaclear -a; metadb -d ....
and meta build again cleanly.
 
You should probably clear the SDR and then a metadetach, then a metaclear. Remove the root entry in /etc/system and change the /etc/vfstab.

Then reboot and you should be up on /dev/dsk/c?t?d? and you can start over.
 
metaroot should undo the entries in /etc/system and /etc/vfstab.

Here is my new plan of attack:

xpress19: unmirror/redo

The only metadevice mounted is root. All other metadedevices is unmounted.

#device device mount FS fsck mount mount
#to mount to fsck point type pass at boot options
#
fd - /dev/fd fd - no -
/proc - /proc proc - no -
/dev/dsk/c1t0d0s1 - - swap - no -
/dev/md/dsk/d0 /dev/md/rdsk/d0 / ufs 1 no -
/dev/dsk/c1t0d0s6 /dev/rdsk/c1t0d0s6 /usr ufs 1 no -
/dev/dsk/c1t0d0s3 /dev/rdsk/c1t0d0s3 /var ufs 1 no -
/dev/dsk/c1t0d0s7 /dev/rdsk/c1t0d0s7 /export/home ufs 2 yes -
/dev/dsk/c1t0d0s5 /dev/rdsk/c1t0d0s5 /opt ufs 2 yes -
swap - /tmp tmpfs - yes -

I should be able to destroy all metadevices, except for root.

metaroot /dev/dsk/c1t0d0s0

shutdown -y -g0 -i6

metadetach d1 d2

metaclear -r d1

metaclear d2 d0

From here I should be able to start over with root metadevice.

Any suggestions?
 
Run a metadb and see if there are any state database replicas on any slice. If so, delete them before you reboot.
 
Hello Ponetguy2 I think you are almost there, I'm sure there are many different ways to clear down/unmirror
I've just done the following which was quick and nasty but worked (but I have test system - so not too worried)
metadetach cxxxxx cxxxxx
mdetadb -d (replica's)
with system still up I copied back the original vfstab and deleted the root entry in /etc/system
rebooted (fingers crossed)
metaclear -a
metadb -d -f (master metadatabase)

Good luck


 
thank you everyone for your guidance and advise. i successfully unmirrored our server. i had no idea how sensitive sds can be. i will post what steps i took to fix this problem.
 
xpress19# metastat


d1: Mirror
Submirror 1: d2
State: Okay
Pass: 1
Read option: roundrobin (default)
Write option: parallel (default)
Size: 2048301 blocks

d2: Submirror of d1
State: Okay
Size: 2048301 blocks
Stripe 0:
Device Start Block Dbase State Reloc Hot Spare
c1t1d0s0 0 No Okay Yes


d0: Concat/Stripe
Size: 2048301 blocks
Stripe 0:
Device Start Block Dbase Reloc
c1t0d0s0 0 No Yes

Device Relocation Information:
Device Reloc Device ID
c1t1d0 Yes id1,ssd@w20000004cfc95ea7
c1t0d0 Yes id1,ssd@w20000004cfe51bd5



Unmirror root (/)

The root file system is currently
mounted on a one-way mirrored volume named d1 that consists of one submirror d2. Before I created
this one-way mirror for the root file system, the file system was mounted on the slice /dev/dsk/c1t0d0s0.
I want to unmirror the file system while preserving the data for the root
file system, remove all volumes that were involved in the mirrored volume, and return the file system back to normal
to where it existed; mounted on /dev/dsk/c1t0d0s0.

1. First, run the metastat command to verify that at least one submirror is in the "Okay" state.

d1: Mirror
Submirror 1: d2
State: Okay
Pass: 1
Read option: roundrobin (default)
Write option: parallel (default)
Size: 2048301 blocks

d2: Submirror of d1
State: Okay
Size: 2048301 blocks
Stripe 0:
Device Start Block Dbase State Reloc Hot Spare
c1t1d0s0 0 No Okay Yes


d0: Concat/Stripe
Size: 2048301 blocks
Stripe 0:
Device Start Block Dbase Reloc
c1t0d0s0 0 No Yes

Device Relocation Information:
Device Reloc Device ID
c1t1d0 Yes id1,ssd@w20000004cfc95ea7
c1t0d0 Yes id1,ssd@w20000004cfe51bd5

2. Next, run the metadetach command on the mirror that contains the root file system. In this case, I will detach
d2 to make a one-way mirror:

# metadetach d1 d2


3. The metaroot command is then run, using the rootslice that the system is going to boot from. This edits the
/etc/system and /etc/vfstab files to remove information specifying the mirroring of root (/):

# metaroot /dev/dsk/c1t0d0s0

4. Reboot the system

# shutdown -y -g0 -i6

5. To remove the mirror volume and submirrors, use the metaclear command as follows:

# metaclear -r d1

# metaclear d2

# metaclear d0

6. Use the metastat command to verify that the mirrored and contactenated volume were removed:

# metastat d1 d2 d0


Site:

Solaris Volume Management Guide, May 2002 (pg. 116)

 
Unmirror
========

root (/)
========
metaroot /dev/dsk/c1t0d0s0
shutdown -y -g0 -i6
-------------------

metadetach d1 d2
metaclear -r d1
metaclear d2
metaclear d0

d1: Mirror
Submirror 1: d2
State: Okay
Pass: 1
Read option: roundrobin (default)
Write option: parallel (default)
Size: 2048301 blocks

d2: Submirror of d1
State: Okay
Size: 2048301 blocks
Stripe 0:
Device Start Block Dbase State Reloc Hot Spare
c1t1d0s0 0 No Okay Yes


d0: Concat/Stripe
Size: 2048301 blocks
Stripe 0:
Device Start Block Dbase Reloc
c1t0d0s0 0 No Yes


========================================================================
None of the slices below are mounted:


xpress19# mount
/ on /dev/md/dsk/d0
read/write/setuid/intr/largefiles/xattr/onerror=panic/dev=1540000 on
Fri Oct 28 08:42:28 2005

/usr on /dev/dsk/c1t0d0s6
read/write/setuid/intr/largefiles/xattr/onerror=panic/dev=1d8000e on
Fri Oct 28 08:42:29 2005

/proc on /proc
read/write/setuid/dev=3900000 on Fri Oct 28 08:42:27 2005

/etc/mnttab on mnttab
read/write/setuid/dev=39c0000 on Fri Oct 28 08:42:28 2005

/dev/fd on fd
read/write/setuid/dev=3a00000 on Fri Oct 28 08:42:29 2005

/var on /dev/dsk/c1t0d0s3
read/write/setuid/intr/largefiles/xattr/onerror=panic/dev=1d8000b on
Fri Oct 28 08:42:46 2005

/var/run on swap
read/write/setuid/xattr/dev=1 on Fri Oct 28 08:42:46 2005

/tmp on swap
read/write/setuid/xattr/dev=2 on Fri Oct 28 08:42:49 2005

/opt on /dev/dsk/c1t0d0s5
read/write/setuid/intr/largefiles/xattr/onerror=panic/dev=1d8000d on
Fri Oct 28 08:42:49 2005

/export/home on /dev/dsk/c1t0d0s7
read/write/setuid/intr/largefiles/xattr/onerror=panic/dev=1d8000f
on Fri Oct 28 08:42:49 2005


============================================================================

xpress19# cat /etc/vfstab
#device device mount FS fsck mount mount
#to mount to fsck point type pass at boot options
#
fd - /dev/fd fd - no -
/proc - /proc proc - no -
/dev/dsk/c1t0d0s1 - - swap - no -
/dev/md/dsk/d0 /dev/md/rdsk/d0 / ufs 1 no -
/dev/dsk/c1t0d0s6 /dev/rdsk/c1t0d0s6 /usr ufs 1 no -
/dev/dsk/c1t0d0s3 /dev/rdsk/c1t0d0s3 /var ufs 1 no -
/dev/dsk/c1t0d0s7 /dev/rdsk/c1t0d0s7 /export/home ufs 2 yes -
/dev/dsk/c1t0d0s5 /dev/rdsk/c1t0d0s5 /opt ufs 2 yes -
swap - /tmp tmpfs - yes -

============================================================================


/home
=====
metadetach d52 d51
metaclear -r d52
metaclear d51
metaclear d50

d52: Mirror
Submirror 0: d50
State: Okay
Submirror 1: d51
State: Okay
Pass: 1
Read option: roundrobin (default)
Write option: parallel (default)
Size: 50086593 blocks

d50: Submirror of d52
State: Okay
Size: 50086593 blocks
Stripe 0:
Device Start Block Dbase State Reloc Hot Spare
c1t0d0s7 0 No Okay Yes


d51: Submirror of d52
State: Okay
Size: 50086593 blocks
Stripe 0:
Device Start Block Dbase State Reloc Hot Spare
c1t1d0s7 0 No Okay Yes

================================================================================

/var
====
metadetach d42 d41
metaclear -r d42
metaclear d51
metaclear d50

d42: Mirror
Submirror 0: d40
State: Okay
Submirror 1: d41
State: Okay
Pass: 1
Read option: roundrobin (default)
Write option: parallel (default)
Size: 1126710 blocks

d40: Submirror of d42
State: Okay
Size: 1126710 blocks
Stripe 0:
Device Start Block Dbase State Reloc Hot Spare
c1t0d0s3 0 No Okay Yes


d41: Submirror of d42
State: Okay
Size: 1126710 blocks
Stripe 0:
Device Start Block Dbase State Reloc Hot Spare
c1t1d0s3 0 No Okay Yes


================================================================================

/opt
====
metadetach d22 d21
metaclear -r d42
metaclear d41
metaclear d40

d22: Mirror
Submirror 0: d20
State: Okay
Submirror 1: d21
State: Okay
Pass: 1
Read option: roundrobin (default)
Write option: parallel (default)
Size: 8190315 blocks

d20: Submirror of d22
State: Okay
Size: 8190315 blocks
Stripe 0:
Device Start Block Dbase State Reloc Hot Spare
c1t0d0s5 0 No Okay Yes


d21: Submirror of d22
State: Okay
Size: 8190315 blocks
Stripe 0:
Device Start Block Dbase State Reloc Hot Spare
c1t1d0s5 0 No Okay Yes


================================================================================

/usr
====
metadetach d12 d11
metaclear -r d12
metaclear d11
metaclear d10

d12: Mirror
Submirror 0: d10
State: Okay
Submirror 1: d11
State: Okay
Pass: 1
Read option: roundrobin (default)
Write option: parallel (default)
Size: 8190315 blocks

d10: Submirror of d12
State: Okay
Size: 8190315 blocks
Stripe 0:
Device Start Block Dbase State Reloc Hot Spare
c1t0d0s6 0 No Okay Yes


d11: Submirror of d12
State: Okay
Size: 8190315 blocks
Stripe 0:
Device Start Block Dbase State Reloc Hot Spare
c1t1d0s6 0 No Okay Yes

================================================================================

/swap
=====
metadetach d32 d31
metaclear -r d32
metaclear d31
metaclear d30

d32: Mirror
Submirror 0: d30
State: Okay
Submirror 1: d31
State: Okay
Pass: 1
Read option: roundrobin (default)
Write option: parallel (default)
Size: 1432944 blocks

d30: Submirror of d32
State: Okay
Size: 1432944 blocks
Stripe 0:
Device Start Block Dbase State Reloc Hot Spare
c1t0d0s1 0 No Okay Yes


d31: Submirror of d32
State: Okay
Size: 1432944 blocks
Stripe 0:
Device Start Block Dbase State Reloc Hot Spare
c1t1d0s1 0 No Okay Yes


=================================================================================

Remove SDR

metadb -d c1t0d0s4 c1t1d0s4

shutdown -y -g0 -i6

Everything should be clean from here and I can re-do everyting.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top