{"id":227,"date":"2010-09-24T10:36:55","date_gmt":"2010-09-24T02:36:55","guid":{"rendered":"http:\/\/www.sysadmindayph.com\/blog\/?p=227"},"modified":"2010-09-24T10:36:55","modified_gmt":"2010-09-24T02:36:55","slug":"solutions-for-solaris-svm-needs-maintenance-and-last-erred-status","status":"publish","type":"post","link":"https:\/\/www.sysadmindayph.com\/blog\/solutions-for-solaris-svm-needs-maintenance-and-last-erred-status\/","title":{"rendered":"Solutions for Solaris SVM Needs Maintenance and Last Erred status"},"content":{"rendered":"<p>This post is because while patching a Solaris 10 server with patch level Generic_142900-02 to Generic_142900-13.. There&#8217;s a need maintenance error on one of the sub mirror:<\/p>\n<p>When a slice in a mirror or RAID5 metadevice device experiences errors,<br \/>\nDiskSuite puts the slice in the &#8220;Maintenance&#8221; state. No further reads or<br \/>\nwrites are performed to a slice in the &#8220;Maintenance&#8221; state. Subsequent<br \/>\nerrors on other slices in the same metadevice are handled differently,<br \/>\ndepending on the type of the metadevice.<\/p>\n<p>A mirror may be able to tolerate many slices in the &#8220;Maintenance&#8221; state and still be read from and written to. A RAID5 metadevice, by definition, can only tolerate a single slice in the &#8220;Maintenance&#8221; state. When either a mirror or RAID5 metadevice has a slice in the &#8220;Last Erred&#8221; state, I\/O is still attempted to the slice marked &#8220;Last Erred&#8221;. This is because a &#8220;Last Erred&#8221; slice contains the last good copy of data from DiskSuite&#8217;s point of view.<\/p>\n<p><!--more--><br \/>\nWith a slice in the &#8220;Last Erred&#8221; state, metadevice behaves like a normal<br \/>\ndevice (disk) and returns I\/O errors to an application. Usually, at this<br \/>\npoint some data has been lost.<br \/>\nAlways replace slices in the &#8220;Maintenance&#8221; state, followed by those in the<br \/>\n&#8220;Last Erred&#8221; state. After a slice is replaced and resynched, use the metastat<br \/>\ncommand to verify its state, then validate data to make sure it is good.<br \/>\nHere are the specifics for Mirrors and RAID5 devices:<br \/>\n1. Mirrors<br \/>\nIf slices are in the &#8220;Maintenance&#8221; state, no data has been lost. You can<br \/>\nsafely replace or enable the slices in any order. If a slice is in the &#8220;Last<br \/>\nErred&#8221; state, you cannot replace it until you first replace all the other<br \/>\nmirrored slices in the &#8220;Maintenance&#8221; state. Replacing or enabling a slice in<br \/>\nthe &#8220;Last Erred&#8221; state usually means that some data has been lost. Be sure<br \/>\nto validate the data on the mirror after repairing it.<br \/>\n2. RAID5 metadevices<br \/>\nA RAID5 metadevice can tolerate a single slice failure. You can safely<br \/>\nreplace a single slice in the &#8220;Maintenance&#8221; state without losing data. If<br \/>\nan error on another slice occurs, it is put into the &#8220;Last Erred&#8221; state. At<br \/>\nthis point, the RAID5 metadevice is a read-only device; you need to perform<br \/>\nsome type of error recovery so that the state of the RAID5 metadevice is<br \/>\nnon-errored and the possibility of data loss is reduced. If a RAID5<br \/>\nmetadevice reaches a &#8220;Last Erred&#8221; state, there is a good chance it has<br \/>\nlost data. Be sure to validate the data on the RAID5 metadevice after<br \/>\nrepairing it.<br \/>\nHow to remove &#8220;maintenance&#8221; and &#8220;last erred&#8221; example, In this point maybe pay attention<br \/>\nin some case The &#8220;lost Erred&#8221; sub-mirror side have contained &#8220;maintenance&#8221; and &#8220;Okey&#8221; state<\/p>\n<p>Metastat gives :<br \/>\nd0: Mirror<br \/>\nSubmirror 0: d10<br \/>\nState: Needs maintenance<br \/>\nSubmirror 1: d20<br \/>\nState: Needs maintenance<br \/>\nPass: 1<br \/>\nRead option: roundrobin (default)<br \/>\nWrite option: parallel (default)<br \/>\nSize: 8395200 blocksd10: Submirror of d0<br \/>\nState: Needs maintenance<br \/>\nInvoke: after replacing &#8220;Maintenance&#8221; components:<br \/>\nmetareplace d0 c1t0d0s0<br \/>\nSize: 8395200 blocks<br \/>\nStripe 0:<br \/>\nDevice Start Block Dbase State Hot Spare<br \/>\nc1t0d0s0 0 No Last Erred<br \/>\nd20: Submirror of d0<br \/>\nState: Needs maintenance<br \/>\nInvoke: metareplace d0 c1t1d0s0<br \/>\nSize: 8395200 blocks<br \/>\nStripe 0:<br \/>\nDevice Start Block Dbase State Hot Spare<br \/>\nc1t1d0s0 0 No Maintenance<br \/>\nd1: Mirror<br \/>\nSubmirror 0: d11<br \/>\nState: Okay<br \/>\nSubmirror 1: d21<br \/>\nState: Okay<br \/>\nPass: 1<br \/>\nRead option: roundrobin (default)<br \/>\nWrite option: parallel (default)<br \/>\nSize: 8395200 blocksd11: Submirror of d1<br \/>\nState: Okay<br \/>\nSize: 8395200 blocks<br \/>\nStripe 0:<br \/>\nDevice Start Block Dbase State Hot Spare<br \/>\nc1t0d0s1 0 No Okay<br \/>\nd21: Submirror of d1<br \/>\nState: Okay<br \/>\nSize: 8395200 blocks<br \/>\nStripe 0:<br \/>\nDevice Start Block Dbase State Hot Spare<br \/>\nc1t1d0s1 0 No Okay<br \/>\nd4: Mirror<br \/>\nSubmirror 0: d14<br \/>\nState: Needs maintenance<br \/>\nSubmirror 1: d24<br \/>\nState: Needs maintenance<br \/>\nPass: 1<br \/>\nRead option: roundrobin (default)<br \/>\nWrite option: parallel (default)<br \/>\nSize: 4202688 blocksd14: Submirror of d4<br \/>\nState: Needs maintenance<br \/>\nInvoke: after replacing &#8220;Maintenance&#8221; components:<br \/>\nmetareplace d4 c1t0d0s4<br \/>\nSize: 4202688 blocks<br \/>\nStripe 0:<br \/>\nDevice Start Block Dbase State Hot Spare<br \/>\nc1t0d0s4 0 No Last Erred<br \/>\nd24: Submirror of d4<br \/>\nState: Needs maintenance<br \/>\nInvoke: metareplace d4 c1t1d0s4<br \/>\nSize: 4202688 blocks<br \/>\nStripe 0:<br \/>\nDevice Start Block Dbase State Hot Spare<br \/>\nc1t1d0s4 0 No Maintenance<br \/>\nd5: Mirror<br \/>\nSubmirror 0: d15<br \/>\nState: Okay<br \/>\nSubmirror 1: d25<br \/>\nState: Okay<br \/>\nPass: 1<br \/>\nRead option: roundrobin (default)<br \/>\nWrite option: parallel (default)<br \/>\nSize: 62918208 blocksd15: Submirror of d5<br \/>\nState: Okay<br \/>\nSize: 62918208 blocks<br \/>\nStripe 0:<br \/>\nDevice Start Block Dbase State Hot Spare<br \/>\nc1t0d0s5 0 No Okay<br \/>\nd25: Submirror of d5<br \/>\nState: Okay<br \/>\nSize: 62918208 blocks<br \/>\nStripe 0:<br \/>\nDevice Start Block Dbase State Hot Spare<br \/>\nc1t1d0s5 0 No Okay<br \/>\nd6: Mirror<br \/>\nSubmirror 0: d16<br \/>\nState: Needs maintenance<br \/>\nSubmirror 1: d26<br \/>\nState: Okay<br \/>\nPass: 1<br \/>\nRead option: roundrobin (default)<br \/>\nWrite option: parallel (default)<br \/>\nSize: 52436928 blocksd16: Submirror of d6<br \/>\nState: Needs maintenance<br \/>\nInvoke: metareplace d6 c1t0d0s6<br \/>\nSize: 52436928 blocks<br \/>\nStripe 0:<br \/>\nDevice Start Block Dbase State Hot Spare<br \/>\nc1t0d0s6 0 No Maintenance<br \/>\nd26: Submirror of d6<br \/>\nState: Okay<br \/>\nSize: 52436928 blocks<br \/>\nStripe 0:<br \/>\nDevice Start Block Dbase State Hot Spare<br \/>\nc1t1d0s6 0 No Okay<br \/>\nd7: Mirror<br \/>\nSubmirror 0: d17<br \/>\nState: Okay<br \/>\nSubmirror 1: d27<br \/>\nState: Needs maintenance<br \/>\nPass: 1<br \/>\nRead option: roundrobin (default)<br \/>\nWrite option: parallel (default)<br \/>\nSize: 6970560 blocksd17: Submirror of d7<br \/>\nState: Okay<br \/>\nSize: 6970560 blocks<br \/>\nStripe 0:<br \/>\nDevice Start Block Dbase State Hot Spare<br \/>\nc1t0d0s7 0 No Okay<br \/>\nd27: Submirror of d7<br \/>\nState: Needs maintenance<br \/>\nInvoke: metareplace d7 c1t1d0s7<br \/>\nSize: 6970560 blocks<br \/>\nStripe 0:<br \/>\nDevice Start Block Dbase State Hot Spare<br \/>\nc1t1d0s7 0 No Maintenance<br \/>\n-First dettach,delete master slice6 and resync with mirror side slice6,Because in this way the intact data only in mirror side:<br \/>\n# metadetach d6 d16<br \/>\n# metaclear d16<br \/>\n# metainit d16 1 1 c1t0d0s6<br \/>\n# metattach d6 d16<br \/>\n&#8211; Wait for &#8220;Okay&#8221; status for the master slice6,<br \/>\n&#8211; Then replace &#8220;Last erred&#8221; state disk before.<br \/>\nRun &#8220;metadetach&#8221; to detach all the sub-mirrors on the mirror disk from<br \/>\ntheir respective mirrors (see the following):<br \/>\n[b]# metadetach -f [\/b]<br \/>\nNOTE: The &#8220;-f&#8221; option is not required if the metadevice is in an &#8220;okay&#8221;<br \/>\nstate.<br \/>\nThen run metaclear to remove the configuration from the disk:<br \/>\n[b]# metaclear [\/b]<br \/>\n# metadb -d c1t1d0s3<br \/>\n# luxadm remove_device \/dev\/rdsk\/c1t1d0s2 (physical remove disk when prompt to pull out disk)<br \/>\n# devfsadm -C -c disk -v<br \/>\n# luxadm insert_device \/dev\/rdsk\/c1t1d0s2 (physical insert disk when prompt to pull in disk)<br \/>\n# prtvtoc \/dev\/rdsk\/c1t0d0s2 |fmthard -s &#8211; \/dev\/rdsk\/c1t1d0s2<br \/>\n# metadb -afc 3 c1t1d0s3<br \/>\nUse &#8220;metainit&#8221; and &#8220;metattach&#8221; to re-create and attach those submirrors to<br \/>\nthe mirrors to start the resync:<br \/>\n[b]# metainit 1 1 c#t#d#s#[\/b]<br \/>\n[b]# metattach [\/b]<br \/>\nWhen all slice resync are finished,Begin replace &#8220;Last Erred&#8221; master disk<br \/>\nRun &#8220;metadetach&#8221; to detach all the sub-mirrors on the master disk from<br \/>\ntheir respective mirrors (see the following):<br \/>\n[b]# metadetach -f [\/b]<br \/>\nNOTE: The &#8220;-f&#8221; option is not required if the metadevice is in an &#8220;okay&#8221;<br \/>\nstate.<br \/>\nThen run metaclear to remove the configuration from the disk:<br \/>\n[b]# metaclear [\/b]<br \/>\n# metadb -d c1t1d0s3<br \/>\n# luxadm remove_device \/dev\/rdsk\/c1t0d0s2 (physical remove disk when prompt to pull out disk)<br \/>\n# devfsadm -C -c disk -v<br \/>\n# luxadm insert_device \/dev\/rdsk\/c1t0d0s2 (physical insert disk when prompt to pull in disk)<br \/>\n# prtvtoc \/dev\/rdsk\/c1t1d0s2 |fmthard -s &#8211; \/dev\/rdsk\/c1t0d0s2<br \/>\n# metadb -afc 3 c1t0d0s3<br \/>\nUse &#8220;metainit&#8221; and &#8220;metattach&#8221; to re-create and attach those submirrors to<br \/>\nthe mirrors to start the resync:<br \/>\n[b]# metainit 1 1 c#t#d#s#[\/b]<br \/>\n[b]# metattach [\/b]<br \/>\nWhen all slice resync finished,the two sub-mirror is normal.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This post is because while patching a Solaris 10 server with patch level Generic_142900-02 to Generic_142900-13.. There&#8217;s a need maintenance error on one of the sub mirror: When a slice in a mirror or RAID5 &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[347,349,350,351,379,352,111],"class_list":["post-227","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-kernel-patch","tag-mirror-disk","tag-needs-maintenance","tag-patch","tag-solaris-10","tag-solaris-patch","tag-svm"],"_links":{"self":[{"href":"https:\/\/www.sysadmindayph.com\/blog\/wp-json\/wp\/v2\/posts\/227","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sysadmindayph.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sysadmindayph.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sysadmindayph.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sysadmindayph.com\/blog\/wp-json\/wp\/v2\/comments?post=227"}],"version-history":[{"count":2,"href":"https:\/\/www.sysadmindayph.com\/blog\/wp-json\/wp\/v2\/posts\/227\/revisions"}],"predecessor-version":[{"id":229,"href":"https:\/\/www.sysadmindayph.com\/blog\/wp-json\/wp\/v2\/posts\/227\/revisions\/229"}],"wp:attachment":[{"href":"https:\/\/www.sysadmindayph.com\/blog\/wp-json\/wp\/v2\/media?parent=227"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sysadmindayph.com\/blog\/wp-json\/wp\/v2\/categories?post=227"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sysadmindayph.com\/blog\/wp-json\/wp\/v2\/tags?post=227"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}