<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>unixpowered.com &#187; solaris volume manager</title>
	<atom:link href="http://www.unixpowered.com/blog/category/solaris-volume-manager/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.unixpowered.com/blog</link>
	<description></description>
	<lastBuildDate>Wed, 21 Jul 2010 13:42:57 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=abc</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Quick and dirty SVM cheatsheet</title>
		<link>http://www.unixpowered.com/blog/2009/12/03/quick-and-dirty-svm-cheatsheet/</link>
		<comments>http://www.unixpowered.com/blog/2009/12/03/quick-and-dirty-svm-cheatsheet/#comments</comments>
		<pubDate>Thu, 03 Dec 2009 12:50:43 +0000</pubDate>
		<dc:creator>somedude</dc:creator>
				<category><![CDATA[solaris]]></category>
		<category><![CDATA[solaris utilities]]></category>
		<category><![CDATA[solaris volume manager]]></category>
		<category><![CDATA[storage]]></category>

		<guid isPermaLink="false">http://www.unixpowered.com/blog/?p=372</guid>
		<description><![CDATA[This list focuses mostly on mirror operations. I use Solaris Volume Manager quite a bit when mirroring internal drives. There are tons of additional features and commands, if you use SVM for  things other than mirroring. In that case you might want to look at check out Solaris Volume Manager Administration Guide.
Create database replicas:
metadb -f [...]]]></description>
			<content:encoded><![CDATA[<p>This list focuses mostly on mirror operations. I use Solaris Volume Manager quite a bit when mirroring internal drives. There are tons of additional features and commands, if you use SVM for  things other than mirroring. In that case you might want to look at check out <a title="Solaris Volume Manager Administration Guide" href="http://docs.sun.com/app/docs/doc/816-4520?l=en" target="_self">Solaris Volume Manager Administration Guide</a>.</p>
<p>Create database replicas:<br />
<code>metadb -f -a -c [number_of_replicas] [device]<br />
<strong>metadb -f -a -c 3 c0t0d0s7</strong></code></p>
<p>Delete all database replicas from device:<br />
<code>metadb -d [device]<br />
<strong>metadb -d c0t0d0s7</strong></code></p>
<p>Display status of database replicas:<br />
<code>metadb -i<br />
<strong>metadb -i</strong></code></p>
<p>Display metadevice status:<br />
<code>metastat<br />
<strong>metastat</strong></code></p>
<p>Create simple concat/stripe metadevice:<br />
<code>metainit -f [concat_metadevice] 1 1 [device]<br />
<strong>metainit -f d21 1 1 c0t0d0s1</strong></code></p>
<p>Create a mirror with one submirror:<br />
<code>metainit [mirror_metadevice] -m [submirror_metadevice]<br />
<strong>metainit d20 -m d21</strong></code></p>
<p>Attach a submirror to one sided mirror:<br />
<code>metattach [mirror_metadevice] [submirror_metadevice]<br />
<strong>metattach d20 d22</strong></code></p>
<p>Detach a submirror from a mirror:<br />
<code>metadetach [mirror_metadevice] [submirror_metadevice]<br />
<strong>metadetach d20 d22</strong></code></p>
<p>Clear a metadevice:<br />
<code>metaclear [metadevice]<br />
<strong>metaclear d22</strong></code></p>
<p>Offline a submirror:<br />
<code>metaoffline [mirror_metadevice] [submirror_metadevice]<br />
<strong>metaoffline d20 d22</strong></code></p>
<p>Online a submirror:<br />
<code>metaonline [mirror_metadevice] [submirror_metadevice]<br />
<strong>metaonline d20 d22</strong></code></p>
<p>Enable a failed component:<br />
<code>metareplace -e [metadevice] [device]<br />
<strong>metareplace -e d21 c0t0d0s1</strong></code></p>
<p>Rename a metadevice:<br />
<code>metarename [old_metadevice] [new_metadevice]<br />
<strong>metarename d20 d30</strong></code></p>
<p>Switch metadevice names:<br />
<code>metarename [metadevice_1] [metadevice_2]<br />
<strong>metarename -x d20 d30</strong></code></p>
<p>Configure system for root metadevice:<br />
<code>metaroot [metadevice]<br />
<strong>metaroot d10</strong></code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.unixpowered.com/blog/2009/12/03/quick-and-dirty-svm-cheatsheet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Growing Solaris Volume Manager mirrors online</title>
		<link>http://www.unixpowered.com/blog/2008/11/08/growing-solaris-volume-manager-mirrors-online/</link>
		<comments>http://www.unixpowered.com/blog/2008/11/08/growing-solaris-volume-manager-mirrors-online/#comments</comments>
		<pubDate>Sat, 08 Nov 2008 14:41:10 +0000</pubDate>
		<dc:creator>somedude</dc:creator>
				<category><![CDATA[san]]></category>
		<category><![CDATA[solaris]]></category>
		<category><![CDATA[solaris tips]]></category>
		<category><![CDATA[solaris volume manager]]></category>
		<category><![CDATA[storage]]></category>

		<guid isPermaLink="false">http://wayciak.wordpress.com/?p=79</guid>
		<description><![CDATA[You have a SVM mirror and you need to grow it. Online. All steps are straight forward except for the last one. So, in a nutshell:

Grow sizes of both submirror LUN&#8217;s on SAN
Detach the first submirror metadevice
Clear the submirror metadevice
Make the system see new LUN size
Recreate the submirror metadevice, attach it to the mirror and [...]]]></description>
			<content:encoded><![CDATA[<p>You have a <acronym title="Solaris Volume Manager">SVM</acronym> mirror and you need to grow it. Online. All steps are straight forward except for the last one. So, in a nutshell:</p>
<ol>
<li>Grow sizes of both submirror LUN&#8217;s on SAN</li>
<li>Detach the first submirror metadevice</li>
<li>Clear the submirror metadevice</li>
<li>Make the system see new LUN size</li>
<li>Recreate the submirror metadevice, attach it to the mirror and let it sync</li>
<li>Repeat the above for the second submirror</li>
<li>Not so obvious step</li>
<li>Grow the filesystem</li>
</ol>
<p>You have a mirror metadevice <em>d200</em> consisting of submirrors <em>d201</em> and <em>d202</em>. Both submirrors are sliced in such way that all space is allocated in slice 0. At this point both LUN&#8217;s should be already grown, but you need to make the system to see the size increase. Here is what <em>d201</em>, one of the submirrors of <em>d200</em>, should look like:</p>
<p><code>bash-3.00# <strong>metastat d201</strong><br />
d201: Submirror of d200<br />
State: Okay<br />
Size: 2064384 blocks (1008 MB)<br />
Stripe 0:<br />
Device                                             Start Block  Dbase        State Reloc Hot Spare<br />
/dev/dsk/c5t511714A510011C370000C00003410000d0s0          0     No            Okay   Yes</code></p>
<p>First, detach <em>d201</em> from its parent and clear it:</p>
<p><code>bash-3.00# <strong>metadetach d200 d201</strong><br />
bash-3.00# <strong>metaclear d201</strong></code></p>
<p>The next step is likely to alter the LUN slice configuration, so make sure you have it noted.</p>
<p>You need to run <em>format</em> command to get the system to see the grown LUN. So, run <em>format</em> then select <em>type</em> and then select <em>Autoconfigure</em>. At this point <em>format</em> should be reporting the new LUN size. Make sure your slice configuration is correct and that all the new space is tacked onto the end of correct slice. In this case, it&#8217;s slice 0.</p>
<p>Now recreate <em>d201</em>, attach it to <em>d200</em> and let the mirror sync. When checking status of <em>d200</em> note that overall mirror size is still the same but the size of <em>d201</em> increased:</p>
<p><code>bash-3.00# <strong>metastat d200</strong><br />
d200: Mirror<br />
Submirror 0: d202<br />
State: Okay<br />
Submirror 1: d201<br />
State: Okay<br />
Pass: 1<br />
Read option: roundrobin (default)<br />
Write option: parallel (default)<br />
Size: 2064384 blocks (1008 MB)</code></p>
<p><code>d202: Submirror of d200<br />
State: Okay<br />
Size: 2064384 blocks (1008 MB)<br />
Stripe 0:<br />
Device                                             Start Block  Dbase        State Reloc Hot Spare<br />
/dev/dsk/c5t511714A510011C370000C00003460000d0s0          0     No            Okay   Yes</code></p>
<p><code>d201: Submirror of d200<br />
State: Okay<br />
Size: 4128768 blocks (2.0 GB)<br />
Stripe 0:<br />
Device                                             Start Block  Dbase        State Reloc Hot Spare<br />
/dev/dsk/c5t511714A510011C370000C00003410000d0s0          0     No            Okay   Yes<br />
</code></p>
<p>Now repeat the same process with <em>d202</em>. After you are done you will have both submirrors bigger, but the size of overall mirror will still be the same:</p>
<p><code>bash-3.00# <strong>metastat d200</strong><br />
d200: Mirror<br />
Submirror 0: d201<br />
State: Okay<br />
Submirror 1: d202<br />
State: Okay<br />
Pass: 1<br />
Read option: roundrobin (default)<br />
Write option: parallel (default)<br />
Size: 2064384 blocks (1008 MB)</code></p>
<p><code>d201: Submirror of d200<br />
State: Okay<br />
Size: 4128768 blocks (2.0 GB)<br />
Stripe 0:<br />
Device                                             Start Block  Dbase        State Reloc Hot Spare<br />
/dev/dsk/c5t511714A510011C370000C00003410000d0s0          0     No            Okay   Yes</code></p>
<p><code>d202: Submirror of d200<br />
State: Okay<br />
Size: 4161536 blocks (2.0 GB)<br />
Stripe 0:<br />
Device                                             Start Block  Dbase        State Reloc Hot Spare<br />
/dev/dsk/c5t511714A510011C370000C00003460000d0s0          0     No            Okay   Yes</code></p>
<p>Now comes the &#8220;Not so obvious&#8221; step. In order to increase overall mirror size you need to run <a title="metattach man page" href="http://docs.sun.com/app/docs/doc/816-5166/metattach-1m?l=en&amp;a=view&amp;q=metattach" target="_self"><em>metattach</em></a> on the mirror itself:</p>
<p><code>bash-3.00# <strong>metattach d200</strong><br />
bash-3.00# <strong>metastat d200</strong><br />
d200: Mirror<br />
Submirror 0: d201<br />
State: Okay<br />
Submirror 1: d202<br />
State: Okay<br />
Pass: 1<br />
Read option: roundrobin (default)<br />
Write option: parallel (default)<br />
Size: 4128768 blocks (2.0 GB)</code></p>
<p>This will grow the size of the entire mirror to the size of submirror devices. Now you can grow the filesystem on it without unmounting it. Keep in mind that for the duration of <a title="growfs man page" href="http://docs.sun.com/app/docs/doc/816-5166/6mbb1kq2c?l=en&amp;a=view&amp;q=growfs" target="_self"><em>growfs</em></a> command there will be no writes to the volume.</p>
<p><code>bash-3.00# <strong>growfs -M /export/home/users /dev/md/rdsk/d200</strong><br />
/dev/md/rdsk/d200:      4128768 sectors in 126 cylinders of 128 tracks, 256 sectors<br />
2016.0MB in 63 cyl groups (2 c/g, 32.00MB/g, 15040 i/g)<br />
super-block backups (for fsck -F ufs -o b=#) at:<br />
32, 65824, 131616, 197408, 263200, 328992, 394784, 460576, 526368, 592160,<br />
3487008, 3552800, 3618592, 3684384, 3750176, 3815968, 3881760, 3947552,<br />
4013344, 4079136</code></p>
<p>That&#8217;s all there is to it. The &#8220;Not so obvious&#8221; step is mentioned in the <a title="metattach man page" href="http://docs.sun.com/app/docs/doc/816-5166/metattach-1m?l=en&amp;a=view&amp;q=metattach" target="_self">metattach man page</a>. But unless you do this stuff every day, this very useful piece of information can be easily forgotten.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.unixpowered.com/blog/2008/11/08/growing-solaris-volume-manager-mirrors-online/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mirroring root disk using SVM</title>
		<link>http://www.unixpowered.com/blog/2008/07/02/mirroring-root-disk-using-svm/</link>
		<comments>http://www.unixpowered.com/blog/2008/07/02/mirroring-root-disk-using-svm/#comments</comments>
		<pubDate>Wed, 02 Jul 2008 19:39:37 +0000</pubDate>
		<dc:creator>somedude</dc:creator>
				<category><![CDATA[openboot]]></category>
		<category><![CDATA[solaris]]></category>
		<category><![CDATA[solaris tips]]></category>
		<category><![CDATA[solaris utilities]]></category>
		<category><![CDATA[solaris volume manager]]></category>
		<category><![CDATA[storage]]></category>

		<guid isPermaLink="false">http://wayciak.wordpress.com/?p=25</guid>
		<description><![CDATA[There are about 487359 documents on the Internet about how to mirror root disk in Solaris. So, here is 487360th.
The assumptions are following: the first disk has Solaris already installed, root slice is slice 1, and the disks are identical with the same size and geometry. If they have different cylinder, head, sector count or [...]]]></description>
			<content:encoded><![CDATA[<p>There are about 487359 documents on the Internet about how to mirror root disk in Solaris. So, here is 487360th.</p>
<p>The assumptions are following: the first disk has Solaris already installed, root slice is slice 1, and the disks are identical with the same size and geometry. If they have different cylinder, head, sector count or different size you will have to fiddle with sizing slices more.</p>
<p>The first step is to recreate the same slice arrangement on the second disk:</p>
<p><code>bash-3.00# <strong>prtvtoc /dev/rdsk/c1t0d0s2 | fmthard -s - /dev/rdsk/c1t1d0s2</strong><br />
fmthard:  New volume table of contents now in place.</code></p>
<p>You can check both disks have the same <acronym title="Volume Table of Contents">VTOC</acronym> using <em>prtvtoc</em> command</p>
<p><code>bash-3.00# <strong>prtvtoc /dev/rdsk/c1t0d0s2</strong><br />
* /dev/rdsk/c1t0d0s2 partition map<br />
*<br />
* Dimensions:<br />
*     512 bytes/sector<br />
*     424 sectors/track<br />
*      24 tracks/cylinder<br />
*   10176 sectors/cylinder<br />
*   14089 cylinders<br />
*   14087 accessible cylinders<br />
*<br />
* Flags:<br />
*   1: unmountable<br />
*  10: read-only<br />
*<br />
*                          First     Sector    Last<br />
* Partition  Tag  Flags    Sector     Count    Sector  Mount Directory<br />
0      3    01          0   4100928   4100927<br />
1      2    00    4100928  20484288  24585215<br />
2      5    00          0 143349312 143349311<br />
3      8    00   24585216 118672512 143257727<br />
7      0    00  143257728     91584 143349311</code></p>
<p>Now we have to create state database replicas on slice 7. We will be adding two replicas to each slice:</p>
<p><code>bash-3.00# <strong>metadb -a -f -c3 /dev/dsk/c1t0d0s7</strong><br />
bash-3.00# <strong>metadb -a -f -c3 /dev/dsk/c1t1d0s7</strong></code></p>
<p>Database replicas are crucial part of <acronym title="Solaris Volume Manager">SVM</acronym>. <a title="State Database Overview" href="http://docs.sun.com/app/docs/doc/816-4520/about-state-db-replicas-1?a=view" target="_self">Here</a> is some important information about how they work, how many you need, etc.</p>
<p>Since the database replicas are in place we can start creating metadevices. The following commands will create metadevice <em>d31</em> from slice <em>c1t0d0s3</em>, and metadevice <em>d32</em> from slice <em>c1t1d0s3</em>. Then we create mirror <em>d30</em> with <em>d31</em> attached as a submirror. Finally we will attach submirror <em>d32</em> to mirror <em>d30</em>. Once <em>d32</em> is attached, the mirror <em>d30</em> will automatically start syncing.</p>
<p><code>bash-3.00# <strong>metainit -f d31 1 1 c1t0d0s3</strong><br />
d31: Concat/Stripe is setup<br />
bash-3.00# <strong>metainit -f d32 1 1 c1t1d0s3</strong><br />
d32: Concat/Stripe is setup<br />
bash-3.00# <strong>metainit d30 -m d31</strong><br />
d30: Mirror is setup<br />
bash-3.00# <strong>metattach d30 d32</strong><br />
d30: submirror d32 is attached</code></p>
<p>The procedure is the same for all other mirrors you might want to create. Root filesystem is slightly different. First you will have to create your submirrors. Then you will have to attach submirror with existing root filesystem, in this case <em>d11, </em>to the new mirror metadevice <em>d10</em>. Then you will have to run <em>metaroot</em> command. It will alter <em>/</em> entry in <em>/etc/vfstab</em>. Finally, you flush the filesystem using <em>lockfs</em> command and reboot.</p>
<p><code>bash-3.00# <strong>metainit -f d11 1 1 c1t0d0s1</strong><br />
d31: Concat/Stripe is setup<br />
bash-3.00# <strong>metainit -f d12 1 1 c1t1d0s1</strong><br />
d32: Concat/Stripe is setup<br />
bash-3.00# <strong>metainit d10 -m d11</strong><br />
d30: Mirror is setup<br />
bash-3.00# <strong>metaroot d10</strong><br />
bash-3.00# <strong>lockfs -fa</strong><br />
bash-3.00# <strong>reboot</strong></code></p>
<p>When the system reboots, you can attach the second submirror to <em>d10</em> as follows:</p>
<p><code>bash-3.00# <strong>metattach d10 d12</strong></code></p>
<p>You can check the sync progress using <em>metastat</em> command. Once all mirrors are synced up the next step is to configure the new swap metadevice, in my case <em>d0</em>, to be crash dump device. This is done using <em>dumpadm</em> command:</p>
<p><code>bash-3.00# <strong>dumpadm</strong><br />
Dump content: kernel pages<br />
Dump device: /dev/dsk/c1t0d0s0 (dedicated)<br />
Savecore directory: /var/crash/ultra<br />
Savecore enabled: yes<br />
bash-3.00# <strong>dumpadm -d /dev/md/dsk/d0</strong></code></p>
<p>The final step is to modify PROM. First we need to find out which two physical devices <em>c1t0d0</em> and <em>c1t1d0</em> refer to:</p>
<p><code>bash-3.00# <strong>ls -l /dev/dsk/c1t0d0s1</strong><br />
lrwxrwxrwx   1 root     root          43 Mar  4 14:38 /dev/dsk/c1t0d0s1 -&gt; ../../devices/pci@1c,600000/scsi@2/sd@0,0:b<br />
bash-3.00# <strong>ls -l /dev/dsk/c1t1d0s1</strong><br />
lrwxrwxrwx   1 root     root          43 Mar  4 14:38 /dev/dsk/c1t1d0s1 -&gt; ../../devices/pci@1c,600000/scsi@2/sd@1,0:b</code></p>
<p>The physical device path is everything starting from <em>/pci&#8230;</em>. Please make a note of <em>sd</em> towards the end of the device string. When creating device aliases below, <em>sd</em> will have to be changed to <em>disk</em>.</p>
<p>Now we create two device aliases called <em>root</em> and <em>backup_root</em>. Then we set <em>boot-device</em> to be <em>root</em> and <em>backup_root</em>. The <em>:b</em> refers to slice 1(root) on that particular disk.</p>
<p><code>bash-3.00# <strong>eeprom "use-nvramrc?=true"</strong><br />
bash-3.00# <strong>eeprom "nvramrc=devalias root /pci@1c,600000/scsi@2/disk@0,0 devalias backup_root /pci@1c,600000/scsi@2/disk@1,0"</strong><br />
bash-3.00# <strong>eeprom "boot-device=root:b backup_root:b net"</strong></code></p>
<p>Now we can test that the system boot from both <em>root</em> and <em>backup_root</em> devices.</p>
<p>There is one more optional step. Adding two kernel tunables to <em>/etc/system</em> file. The first one is <em>md_mirror:md_resync_bufsz</em> which will speed up mirror resync. The second one is <em>md:mirrored_root_flag</em>. When this flag is enabled the system will boot even if less than majority of database replicas is available. Personally, I do not use the second tunable. More on these can be found in <a title="Solaris Tunable Parameters Refernce Guide" href="http://docs.sun.com/app/docs/doc/817-0404/chapter2-156?l=ru&amp;a=view" target="_self">Solaris Tunable Parameters Reference Guide</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.unixpowered.com/blog/2008/07/02/mirroring-root-disk-using-svm/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Moving LUN&#039;s between hosts using metarecover</title>
		<link>http://www.unixpowered.com/blog/2008/04/02/moving-luns-between-hosts-using-metarecover/</link>
		<comments>http://www.unixpowered.com/blog/2008/04/02/moving-luns-between-hosts-using-metarecover/#comments</comments>
		<pubDate>Wed, 02 Apr 2008 07:11:32 +0000</pubDate>
		<dc:creator>somedude</dc:creator>
				<category><![CDATA[san]]></category>
		<category><![CDATA[solaris tips]]></category>
		<category><![CDATA[solaris utilities]]></category>
		<category><![CDATA[solaris volume manager]]></category>
		<category><![CDATA[storage]]></category>

		<guid isPermaLink="false">http://wayciak.wordpress.com/?p=11</guid>
		<description><![CDATA[Sometimes you might need to move a LUN between hosts X and Y on a SAN. Solaris has cool command, metarecover, that lets you do just that. First, you will need to stop all processes on X that might be using the given LUN. Then unmount the LUN and present it to the host Y. [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes you might need to move a LUN between hosts X and Y on a SAN. Solaris has cool command, <em>metarecover</em>, that lets you do just that. First, you will need to stop all processes on X that might be using the given LUN. Then unmount the LUN and present it to the host Y. Now you can use <em>metarecover</em> to recover metadevice information from the LUN. Couple of things to remember:</p>
<p>There is <em>-n</em> switch that will cause dry run, i.e. <em>metarecover</em> will output what it would do &#8211; it will not actually perform recovery operation. Also, be careful about metadevice names on host Y and the ones you are trying to recover. I have not tried it so I am not sure what would happen. It would probably bomb out. You could use <em>metarename</em> to rename Y&#8217;s existing metadevices and try to eliminate possible conflict before recovery.</p>
<p><code>root@ultra# <strong>metarecover -v c3t600508B400011C370000C00002970000d0s2 -p -d</strong><br />
Verifying on-disk structures on<br />
c3t600508B400011C370000C00002970000d0s2.<br />
The following extent headers were found on<br />
c3t600508B400011C370000C00002970000d0s2.<br />
Name  Seq#    Type               Offset<br />
Length<br />
d100     0   ALLOC            205635593<br />
25165825<br />
d110     0   ALLOC                16384<br />
32769<br />
d120     0   ALLOC                49153<br />
32769<br />
d130     0   ALLOC                81922<br />
32769<br />
d140     0   ALLOC               114691<br />
41943041<br />
d150     0   ALLOC             42057732<br />
146800641<br />
d160     0   ALLOC            188858373<br />
2097153<br />
d170     0   ALLOC            190955526<br />
6291457<br />
d180     0   ALLOC            197246983<br />
6291457<br />
d190     0   ALLOC            203538440<br />
2097153<br />
NONE     0     END            251609087<br />
1<br />
NONE     0    FREE            230801418<br />
20807669<br />
Found 10 soft partition(s) on c3t600508B400011C370000C00002970000d0s2.<br />
Checking sequence numbers.<br />
mp-&gt;c.un_type: 5<br />
mp-&gt;c.un_size: 136<br />
mp-&gt;c.un_self_id: 100<br />
mp-&gt;un_status: 5<br />
mp-&gt;un_numexts: 1<br />
mp-&gt;un_length: 25165824<br />
mp-&gt;un_dev: 30933010<br />
mp-&gt;un_key: 43<br />
Ext#    voff            poff            Len<br />
0       0               205635594               25165824<br />
mp-&gt;c.un_type: 5<br />
mp-&gt;c.un_size: 136<br />
mp-&gt;c.un_self_id: 110<br />
mp-&gt;un_status: 5<br />
mp-&gt;un_numexts: 1<br />
mp-&gt;un_length: 32768<br />
mp-&gt;un_dev: 30933010<br />
mp-&gt;un_key: 43<br />
Ext#    voff            poff            Len<br />
0       0               16385           32768<br />
mp-&gt;c.un_type: 5<br />
mp-&gt;c.un_size: 136<br />
mp-&gt;c.un_self_id: 120<br />
mp-&gt;un_status: 5<br />
mp-&gt;un_numexts: 1<br />
mp-&gt;un_length: 32768<br />
mp-&gt;un_dev: 30933010<br />
mp-&gt;un_key: 43<br />
Ext#    voff            poff            Len<br />
0       0               49154           32768<br />
mp-&gt;c.un_type: 5<br />
mp-&gt;c.un_size: 136<br />
mp-&gt;c.un_self_id: 130<br />
mp-&gt;un_status: 5<br />
mp-&gt;un_numexts: 1<br />
mp-&gt;un_length: 32768<br />
mp-&gt;un_dev: 30933010<br />
mp-&gt;un_key: 43<br />
Ext#    voff            poff            Len<br />
0       0               81923           32768<br />
mp-&gt;c.un_type: 5<br />
mp-&gt;c.un_size: 136<br />
mp-&gt;c.un_self_id: 140<br />
mp-&gt;un_status: 5<br />
mp-&gt;un_numexts: 1<br />
mp-&gt;un_length: 41943040<br />
mp-&gt;un_dev: 30933010<br />
mp-&gt;un_key: 43<br />
Ext#    voff            poff            Len<br />
0       0               114692          41943040<br />
mp-&gt;c.un_type: 5<br />
mp-&gt;c.un_size: 136<br />
mp-&gt;c.un_self_id: 150<br />
mp-&gt;un_status: 5<br />
mp-&gt;un_numexts: 1<br />
mp-&gt;un_length: 146800640<br />
mp-&gt;un_dev: 30933010<br />
mp-&gt;un_key: 43<br />
Ext#    voff            poff            Len<br />
0       0               42057733                146800640<br />
mp-&gt;c.un_type: 5<br />
mp-&gt;c.un_size: 136<br />
mp-&gt;c.un_self_id: 160<br />
mp-&gt;un_status: 5<br />
mp-&gt;un_numexts: 1<br />
mp-&gt;un_length: 2097152<br />
mp-&gt;un_dev: 30933010<br />
mp-&gt;un_key: 43<br />
Ext#    voff            poff            Len<br />
0       0               188858374               2097152<br />
mp-&gt;c.un_type: 5<br />
mp-&gt;c.un_size: 136<br />
mp-&gt;c.un_self_id: 170<br />
mp-&gt;un_status: 5<br />
mp-&gt;un_numexts: 1<br />
mp-&gt;un_length: 6291456<br />
mp-&gt;un_dev: 30933010<br />
mp-&gt;un_key: 43<br />
Ext#    voff            poff            Len<br />
0       0               190955527               6291456<br />
mp-&gt;c.un_type: 5<br />
mp-&gt;c.un_size: 136<br />
mp-&gt;c.un_self_id: 180<br />
mp-&gt;un_status: 5<br />
mp-&gt;un_numexts: 1<br />
mp-&gt;un_length: 6291456<br />
mp-&gt;un_dev: 30933010<br />
mp-&gt;un_key: 43<br />
Ext#    voff            poff            Len<br />
0       0               197246984               6291456<br />
mp-&gt;c.un_type: 5<br />
mp-&gt;c.un_size: 136<br />
mp-&gt;c.un_self_id: 190<br />
mp-&gt;un_status: 5<br />
mp-&gt;un_numexts: 1<br />
mp-&gt;un_length: 2097152<br />
mp-&gt;un_dev: 30933010<br />
mp-&gt;un_key: 43<br />
Ext#    voff            poff            Len<br />
0       0               203538441               2097152<br />
The following soft partitions were found and will be added to<br />
your metadevice configuration.<br />
Name            Size     No. of Extents<br />
d100        25165824         1<br />
d110           32768         1<br />
d120 32768         1<br />
d130 32768         1<br />
d140 41943040         1<br />
d150 146800640         1<br />
d160         2097152         1<br />
d170         6291456         1<br />
d180         6291456         1<br />
d190         2097152         1<br />
WARNING: You are about to add one or more soft partition<br />
metadevices to your metadevice configuration.  If there<br />
appears to be an error in the soft partition(s) displayed<br />
above, do NOT proceed with this recovery operation.<br />
Are you sure you want to do this (yes/no)? yes<br />
c3t600508B400011C370000C00002970000d0s2: Soft Partitions recovered<br />
from device.<br />
root@ultra# </code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.unixpowered.com/blog/2008/04/02/moving-luns-between-hosts-using-metarecover/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Replacing disk controlled by SVM</title>
		<link>http://www.unixpowered.com/blog/2008/03/11/replacing-disk-controlled-by-svm/</link>
		<comments>http://www.unixpowered.com/blog/2008/03/11/replacing-disk-controlled-by-svm/#comments</comments>
		<pubDate>Tue, 11 Mar 2008 20:44:52 +0000</pubDate>
		<dc:creator>somedude</dc:creator>
				<category><![CDATA[solaris]]></category>
		<category><![CDATA[solaris tips]]></category>
		<category><![CDATA[solaris volume manager]]></category>
		<category><![CDATA[storage]]></category>

		<guid isPermaLink="false">http://wayciak.wordpress.com/?p=13</guid>
		<description><![CDATA[The following scenario assumes two mirrored disks, with two state database replicas located on slice 7 of both disks. High level steps for this are as follows:

determine failed disk
detach failed submirrors
clear failed submirror metadevices and database replicas from failed disk
unconfigure the failed disk and replace it
configure the new disk and recreate VTOC
add new database replicas
recreate [...]]]></description>
			<content:encoded><![CDATA[<p>The following scenario assumes two mirrored disks, with two state database replicas located on slice 7 of both disks. High level steps for this are as follows:</p>
<ol>
<li>determine failed disk</li>
<li>detach failed submirrors</li>
<li>clear failed submirror metadevices and database replicas from failed disk</li>
<li>unconfigure the failed disk and replace it</li>
<li>configure the new disk and recreate VTOC</li>
<li>add new database replicas</li>
<li>recreate the submirrors and reattach them to the respective mirrors</li>
</ol>
<p>This is the current <em>/etc/vfstab</em>:</p>
<p><code>bash-3.00# <strong>more /etc/vfstab</strong><br />
#device      device        mount    FS      fsck    mount   mount<br />
#to mount    to fsck               point    type    pass    at boot options<br />
#<br />
fd    -    /dev/fd    fd    -    no    -<br />
/proc   -       /proc   proc    -       no      -<br />
/dev/md/dsk/d0          -       -       swap    -       no      -<br />
/dev/md/dsk/d10 /dev/md/rdsk/d10        /       ufs     1       no      logging<br />
/dev/md/dsk/d30         /dev/md/rdsk/d30        /export/home    ufs     2   yes logging<br />
/devices        -       /devices        devfs   -       no      -<br />
ctfs    -       /system/contract        ctfs    -       no      -<br />
objfs   -       /system/object  objfs   -       no      -<br />
swap    -       /tmp    tmpfs   -       yes     -</code></p>
<p>From here on I will use <em>d0</em> and its submirrors as an example. <em>d0</em> consists of <em>d1</em> and <em>d2.</em> <em>d2</em> is on the failed disk.</p>
<p><code>d0: Mirror<br />
Submirror 0: d1<br />
State: Okay<br />
Submirror 1: d2<br />
State: Needs maintenance<br />
Pass: 1<br />
Read option: roundrobin (default)<br />
Write option: parallel (default)<br />
Size: 4100928 blocks (2.0 GB)<br />
d1: Submirror of d0<br />
State: Okay<br />
Size: 4100928 blocks (2.0 GB)<br />
Stripe 0:<br />
Device     Start Block  Dbase        State Reloc Hot Spare<br />
c1t0d0s0          0     No            Okay   Yes<br />
d2: Submirror of d0<br />
State: Needs maintenance<br />
Invoke: metareplace d0 c1t1d0s0 &lt;new device&gt;<br />
Size: 4100928 blocks (2.0 GB)<br />
Stripe 0:<br />
Device     Start Block  Dbase        State Reloc Hot Spare<br />
c1t1d0s0          0     No     Maintenance   Yes</code></p>
<p>First we detach <em>d2</em>. The same has to be repeated for <em>d32</em> and <em>d12:</em></p>
<p><code>bash-3.00# <strong>metadetach -f d0 d2</strong><br />
d0: submirror d2 is detached</code></p>
<p>We need to clear <em>d2</em>. Again, the same is repeated for <em>d32</em> and <em>d12</em>:</p>
<p><code>bash-3.00# <strong>metaclear d2</strong><br />
d2: Concat/Stripe is cleared</code></p>
<p>Now we delete database replicas from the failed disk. It&#8217;s also very important to make sure we have at least half of state database replicas available before we start removing them from the failed disk. <a title="SVM Majority Consensus Algorithm" href="http://docs.sun.com/app/docs/doc/816-4520/6manpiei6?l=en&amp;a=view" target="_self">Here</a> is a Sun document that explains Majority Consensus Algorithm Solaris Volume Manager uses. You can determine number and location of the replicas using <em>metadb -i</em> command.</p>
<p><code>bash-3.00# <strong>metadb -d c1t1d0s7</strong></code></p>
<p>Now we can unconfigure the failed disk using <em>cfgadm</em>, replace it and configure the new disk:</p>
<p><code>bash-3.00# <strong>cfgadm -al</strong><br />
Ap_Id                          Type         Receptacle   Occupant     Condition<br />
c0                             scsi-bus     connected    configured   unknown<br />
c0::dsk/c0t0d0                 CD-ROM       connected    configured   unknown<br />
c1                             scsi-bus     connected    configured   unknown<br />
c1::dsk/c1t0d0                 disk         connected    configured   unknown<br />
c1::dsk/c1t1d0                 disk         connected    configured   unknown<br />
c2                             scsi-bus     connected    unconfigured unknown<br />
usb0/1                         unknown      empty        unconfigured ok<br />
usb0/2                         unknown      empty        unconfigured ok<br />
bash-3.00# <strong>cfgadm -c unconfigure c1::dsk/c1t1d</strong><br />
bash-3.00# <strong>cfgadm -c configure c1::dsk/c1t1d0</strong></code></p>
<p>Now we replicate VTOC from the good disk:</p>
<p><code>bash-3.00# <strong>prtvtoc /dev/rdsk/c1t0d0s2 | fmthard -s - /dev/rdsk/c1t1d0s2</strong></code></p>
<p>Add database replicas to the new disk:</p>
<p><code>bash-3.00# <strong>metadb -a -c2 c1t1d0s</strong></code><strong>7</strong></p>
<p>Finally, we can recreate failed submirrors and attach them to their respective mirrors and let them sync up. Again, the same is applies for <em>d32</em> and <em>d12</em>:</p>
<p><code>bash-3.00# <strong>metainit d2 1 1 c1t1d0s0</strong><br />
d2: Concat/Stripe is setup<br />
bash-3.00# <strong>metattach d0 d2</strong><br />
d0: submirror d2 is attached</code></p>
<p>Few notes: This setup contains total of 4 state database replicas. During a disk failure half of the replicas will be gone. If the server gets rebooted for whatever reason, it will not come up in multiuser mode. If you have less than half of the replicas, the system will panic. For more info on all that check out <a title="Solaris Volume Manager Administration Guide" href="http://docs.sun.com/app/docs/doc/816-4520/about-state-db-replicas-1?a=view">docs.sun.com</a>.</p>
<p>When using <em>cfgadm</em> to unconfigure disk, there can be no resources using that disk. Otherwise, unconfigure will fail. Quite possibly swap metadevice is set to be dedicated dump device. To view or change dedicated dump device settings use <em>dumpadm</em> command.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.unixpowered.com/blog/2008/03/11/replacing-disk-controlled-by-svm/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- www.000webhost.com Analytics Code -->
<script type="text/javascript" src="http://analytics.hosting24.com/count.php"></script>
<noscript><a href="http://www.hosting24.com/"><img src="http://analytics.hosting24.com/count.php" alt="web hosting" /></a></noscript>
<!-- End Of Analytics Code -->
