Newbe Note – Replace disk on SVM

bash-3.00# metadb

flags first blk block count

a m p luo 16 8192 /dev/dsk/c0d0s7

a p luo 8208 8192 /dev/dsk/c0d0s7

a p luo 16400 8192 /dev/dsk/c0d0s7

a p luo 16 8192 /dev/dsk/c0d1s7

a p luo 8208 8192 /dev/dsk/c0d1s7

a p luo 16400 8192 /dev/dsk/c0d1s7

bash-3.00# format

Searching for disks…done

AVAILABLE DISK SELECTIONS:

0. c0d0 <DEFAULT cyl 2085 alt 2 hd 255 sec 63>

/pci@0,0/pci-ide@1,1/ide@0/cmdk@0,0

1. c0d1 <DEFAULT cyl 2085 alt 2 hd 255 sec 63>

/pci@0,0/pci-ide@1,1/ide@0/cmdk@1,0

Specify disk (enter its number): ^D

bash-3.00# metastat -p

d3 -m d13 d23 1

d13 1 1 c0d0s3

d23 1 1 c0d1s3

d1 -m d11 d21 1

d11 1 1 c0d0s1

d21 1 1 c0d1s1

d0 -m d10 d20 1

d10 1 1 c0d0s0

d20 1 1 c0d1s0

bash-3.00# metastat

d3: Mirror

Submirror 0: d13

State: Okay

Submirror 1: d23

State: Okay

Pass: 1

Read option: roundrobin (default)

Write option: parallel (default)

Size: 6152895 blocks (2.9 GB)

d13: Submirror of d3

State: Okay

Size: 6152895 blocks (2.9 GB)

Stripe 0:

Device Start Block Dbase State Reloc Hot Spare

c0d0s3 0 No Okay Yes

d23: Submirror of d3

State: Okay

Size: 6152895 blocks (2.9 GB)

Stripe 0:

Device Start Block Dbase State Reloc Hot Spare

c0d1s3 0 No Okay Yes

d1: Mirror

Submirror 0: d11

State: Okay

Submirror 1: d21

State: Okay

Pass: 1

Read option: roundrobin (default)

Write option: parallel (default)

Size: 2104515 blocks (1.0 GB)

d11: Submirror of d1

State: Okay

Size: 2104515 blocks (1.0 GB)

Stripe 0:

Device Start Block Dbase State Reloc Hot Spare

c0d0s1 0 No Okay Yes

d21: Submirror of d1

State: Okay

Size: 2104515 blocks (1.0 GB)

Stripe 0:

Device Start Block Dbase State Reloc Hot Spare

c0d1s1 0 No Okay Yes

d0: Mirror

Submirror 0: d10

State: Okay

Submirror 1: d20

State: Okay

Pass: 1

Read option: roundrobin (default)

Write option: parallel (default)

Size: 16386300 blocks (7.8 GB)

d10: Submirror of d0

State: Okay

Size: 16386300 blocks (7.8 GB)

Stripe 0:

Device Start Block Dbase State Reloc Hot Spare

c0d0s0 0 No Okay Yes

d20: Submirror of d0

State: Okay

Size: 16386300 blocks (7.8 GB)

Stripe 0:

Device Start Block Dbase State Reloc Hot Spare

c0d1s0 0 No Okay Yes

Device Relocation Information:

Device Reloc Device ID

c0d1 Yes id1,cmdk@AVBOX_HARDDISK=VBff26b95e-f100ab63

c0d0 Yes id1,cmdk@AVBOX_HARDDISK=VB9296a814-953892af

bash-3.00#

—————————–

REPLACE DISK  c0d0 – Test1

root@solaris10 # metastat -p

d3 -m d13 d23 1

d13 1 1 c0d0s3

d23 1 1 c0d1s3

d1 -m d11 d21 1

d11 1 1 c0d0s1

d21 1 1 c0d1s1

d0 -m d10 1

d10 1 1 c0d0s0

d20 1 1 c0d1s0

root@solaris10 #

—————————

root@solaris10 # metadetach -f d0 d20

d0: submirror d20 is detached

root@solaris10 # metadetach -f d1 d21

d1: submirror d21 is detached

root@solaris10 # metadetach -f d3 d23

d3: submirror d23 is detached

root@solaris10 # metaclear d20

d20: Concat/Stripe is cleared

root@solaris10 # metaclear d21

d21: Concat/Stripe is cleared

root@solaris10 # metaclear d23

d23: Concat/Stripe is cleared

root@solaris10 #

>>>>If there are any replicas on this disk, remove them using:

#metadb -d c#t#d#s#

>>>>>If there are any open filesystems on this disk (not under Solaris VM control),unmount them

>>>>>Run the ‘cfgadm’ command to remove the failed disk

#cfgadm -c unconfigure c#::dsk/c#t#d#

———–

root@solaris10 # metadb -a c1d1s7

———–

root@solaris10 # metainit d20 1 1 c1d1s0

d20: Concat/Stripe is setup

root@solaris10 # metainit d21 1 1 c1d1s1

d21: Concat/Stripe is setup

root@solaris10 # metainit d23 1 1 c1d1s3

d23: Concat/Stripe is setup

root@solaris10 #

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

More Investigation:

d3: Mirror (disk asli, partisi “/Home” 2,9GB)

d13: Submirror of d3 (database mirror di c0d0s3)

d23: Submirror of d3 (database mirror di c0d1s3)

d1: Mirror (disk asli, partisi “swap”, 1GB)

d11: Submirror of d1 (database mirror di c0d0s1)

d21: SUbmirror of d1 (database mirror di c0d1s1)

d0: Mirror (disk alsi, partisi “root, 7,8GB) >>Need Maintenance

d10: SUbmirror of d0 (database mirror di c0d0s0)

d20: Submirror of d0 (database mirror di c0d1s0) >>Need Maintenance

root@solaris10 # metastat -p

d3 -m d13 d23 1

d13 1 1 c0d0s3

d23 1 1 c0d1s3

d1 -m d11 d21 1

d11 1 1 c0d0s1

d21 1 1 c0d1s1

d0 -m d10 d20 1

d10 1 1 c0d0s0

d20 1 1 c0d1s0

root@solaris10 #

{Remove all  submirror from disk c0d1 (d23, d21 and d20):

#metadetach d3 d23

#metaclear d23

#metadetach d1 d21

#metaclear d21

#metadetach d0 d20

#metaclear d20

Then, remove the database in c0d1s7:

#metadb -d c0d1s7

{replace with new disk, repartition again:

#prtvtoc /dev/rdsk/c0d0s2 |fmthard -s – /dev/rdsk/cd1s2

{then, run ‘metainit’ &’metattach’  to connect them with their submirror:

#metainit d23 1 1 c0d1s3

#metattach d3 d23

#metainit d21 1 1 c0d1s1

#metattach d1 d21

#metainit d20 1 1 c0d1s0

#metattach d0 d20

{Then create replica database:

#metadb -a -c 3 c0d1s7

{Last, if your Box is x86, run  “installboot” command to new disk

{jika disk baru partisinya benar dan device namenya sama, command bisa dipersingkat menjadi:

#metareplace -e d23 c0d1s3

#metareplace -e d21 c0d1s1

#metareplace -e d20 c0d1s0

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.