<?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; linux utilities</title>
	<atom:link href="http://www.unixpowered.com/blog/category/linux-utilities/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>Growing mirrored LUN in RedHat</title>
		<link>http://www.unixpowered.com/blog/2009/02/06/growing-mirrored-lun-in-redhat/</link>
		<comments>http://www.unixpowered.com/blog/2009/02/06/growing-mirrored-lun-in-redhat/#comments</comments>
		<pubDate>Fri, 06 Feb 2009 22:52:36 +0000</pubDate>
		<dc:creator>somedude</dc:creator>
				<category><![CDATA[centos]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[linux tips]]></category>
		<category><![CDATA[linux utilities]]></category>
		<category><![CDATA[lvm2]]></category>
		<category><![CDATA[redhat]]></category>
		<category><![CDATA[san]]></category>
		<category><![CDATA[storage]]></category>

		<guid isPermaLink="false">http://wayciak.wordpress.com/?p=118</guid>
		<description><![CDATA[I was putting a RedHat server onto a SAN and I could not find any clear instructions on how to grow a single mirrored LUN on the fly. Anyway, here are some notes on the process. First the setup: Two LUN&#8217;s mirrored across two SAN&#8217;s with LVM volume on the top of it. I could [...]]]></description>
			<content:encoded><![CDATA[<p>I was putting a <a title="Red Hat" href="http://www.redhat.com" target="_self">RedHat</a> server onto a SAN and I could not find any clear instructions on how to grow a single mirrored LUN on the fly. Anyway, here are some notes on the process. First the setup: Two LUN&#8217;s mirrored across two SAN&#8217;s with <acronym title="Logical Volume Manager">LVM</acronym> volume on the top of it. I could have easily just presented another set of mirrored LUN&#8217;s, add them to <acronym title="Volume Group">VG</acronym> and go from there. I wanted to avoid that, as that kind of setup can quickly get out of hand as the number of presented LUN&#8217;s grows. If there is a more &#8220;sensible&#8221; and flexible setup, I would most definitely want to know about it.</p>
<p>For sake of completeness, here are steps to recreate the initial setup I had:</p>
<ol>
<li>Create a mirror from two LUN&#8217;s</li>
<li>Use the mirror as <acronym title="Physical Volume">PV</acronym></li>
<li>Create a VG using the PV</li>
<li>Create <acronym title="Logical Volume">LV</acronym> on the top of the VG</li>
<li>Make ext3 filesystem on the top of LV and mount it</li>
</ol>
<p>Here are the actual steps with some output:</p>
<p><code>[root@ultra /]# <strong>mdadm --create /dev/md10 --level=1 --raid-devices=2 /dev/mapper/mpath4 /dev/mapper/mpath5</strong><br />
mdadm: array /dev/md10 started.<br />
[root@</code><code>ultra</code><code> /]# <strong>pvcreate /dev/md10</strong><br />
Physical volume "/dev/md10" successfully created<br />
[root@</code><code>ultra</code><code> /]# <strong>vgcreate testvg /dev/md10</strong><br />
Volume group "testvg" successfully created<br />
[root@</code><code>ultra</code><code> /]# <strong>lvcreate -l+100%FREE -n testlv testvg</strong><br />
Logical volume "testlv" created<br />
[root@</code><code>ultra</code><code> /]# <strong>mkfs -t ext3 /dev/testvg/testlv</strong><br />
[root@</code><code>ultra</code><code> /]# <strong>mount /dev/testvg/testlv /tmp/test</strong></code></p>
<p>Now the resizing part. There might be a few steps but the upshot is that the filesystem can stay mounted and in use. High level overview of steps to take:</p>
<ol>
<li>Grow the two LUN&#8217;s using SAN management software</li>
<li>Fail and remove one of the submirrors</li>
<li>Force the kernel to see the size increase of the submirror</li>
<li>Flush and recreate the multipath device map so multipathing sees the new size</li>
<li>Re-add the submirror to the mirror and let it sync</li>
<li>Repeat 2-4 for the second submirror</li>
<li>Resize the PV</li>
<li>Resize the LV</li>
<li>Resize the filesystem</li>
</ol>
<p>First, you fail and remove the submirror:</p>
<p><code>[root@</code><code>ultra</code><code> /]# <strong>mdadm /dev/md10 -f /dev/mapper/mpath4 -r /dev/mapper/mpath4</strong><br />
mdadm: set /dev/mapper/mpath4 faulty in /dev/md10<br />
mdadm: hot removed /dev/mapper/mpath4<br />
</code><br />
Now, note all paths to the LUN. Kernel sees a separate device at the end of each path to a LUN. In this case they are <em>sdj</em>, <em>sdt</em>, <em>sdg</em> and <em>sdq</em>.</p>
<p><code>[root@</code><code>ultra</code><code> /]# <strong>multipath -ll mpath4</strong><br />
mpath4 (3600508b400011c300000f000008d0000)<br />
[size=12 GB][features="1 queue_if_no_path"][hwhandler="0"]<br />
_ round-robin 0 [prio=100][active]<br />
._ 1:0:3:1     sdj 8:144  [active][ready]<br />
._ 2:0:3:1     sdt 65:48  [active][ready]<br />
_ round-robin 0 [prio=20][enabled]<br />
._ 1:0:2:1     sdg 8:96   [active][ready]<br />
._ 2:0:2:1     sdq 65:0   [active][ready]</code></p>
<p>At this point the problem is to get the kernel to recognize the new size without reboot. After a lot of trying and sifting through man pages I found that <em>blockdev</em> command does the magic. Then I googled &#8220;blockdev resize&#8221; and I found <a title="Detect online disk resize" href="http://lwn.net/Articles/296401/" target="_self">this</a> confirming my finding. So, the next step is to probe all logical paths to the LUN:</p>
<p><code>[root@</code><code>ultra</code><code> /]# <strong>blockdev --rereadpt /dev/sdj<br />
</strong> [root@</code><code>ultra</code><code> /]# <strong>blockdev --rereadpt /dev/sdt</strong><br />
[root@</code><code>ultra</code><code> /]# <strong>blockdev --rereadpt /dev/sdg</strong><br />
[root@</code><code>ultra</code><code> /]# <strong>blockdev --rereadpt /dev/sdq</strong></code></p>
<p>You should see messages in <em>/var/log/messages</em> about kernel seeing new size on all paths. If you were to issue <em>multipath -ll</em> right now you would see that multipathing is still reporting old size. To fix that, flush the device map of the LUN and then recreate it:</p>
<p><code>[root@</code><code>ultra</code><code> /]# <strong>multipath -f mpath4</strong><br />
[root@</code><code>ultra</code><code> /]# <strong>multipath -v2</strong><br />
create: mpath4 (3600508b400011c300000f000008d0000)<br />
[size=13 GB][features="0"][hwhandler="0"]<br />
_ round-robin 0 [prio=100]<br />
._ 1:0:3:1     sdj 8:144  [ready]<br />
._ 2:0:3:1     sdt 65:48  [ready]<br />
_ round-robin 0 [prio=20]<br />
._ 1:0:2:1     sdg 8:96   [ready]<br />
._ 2:0:2:1     sdq 65:0   [ready]</code></p>
<p>Multipathing should be reporting the new size. Now you are ready to put back the grown submirror and let the whole mirror sync:</p>
<p><code>[root@</code><code>ultra</code><code> /]# <strong>mdadm /dev/md10 -a /dev/mapper/mpath4</strong><br />
mdadm: hot added /dev/mapper/mpath4</code></p>
<p>When the mirror has synced up, repeat the above process for the second submirror and wait for the sync to finish. Time to grow the mirror device itself:</p>
<p><code>[root@</code><code>ultra</code><code> /]# <strong>mdadm --grow /dev/md10 --size=max</strong></code></p>
<p>After the completion <em>/proc/mdstat</em> should report increase in size of <em>/dev/md10</em>. Moving on you need to grow the PV that resides on<em> /dev/md10</em>:</p>
<p><code>[root@</code><code>ultra</code><code> /]# <strong>pvresize /dev/md10</strong><br />
Physical volume "/dev/md10" changed<br />
1 physical volume(s) resized / 0 physical volume(s) not resized</code></p>
<p>And finally, you need to resize the LV:</p>
<p><code>[root@</code><code>ultra</code><code> /]# <strong>lvresize -l+100%FREE testvg/testlv</strong><br />
Extending logical volume testlv to 13.00 GB<br />
Logical volume testlv successfully resized</code></p>
<p>Of course, don&#8217;t forget to grow the filesystem itself:</p>
<p><code>[root@</code><code>ultra</code><code> /]# <strong>ext2online /dev/testvg/testlv</strong><br />
ext2online v1.1.18 - 2001/03/18 for EXT2FS 0.5b<br />
[root@</code><code>ultra</code><code> /]# <strong>df</strong><br />
Filesystem           1K-blocks      Used Available Use% Mounted on<br />
/dev/mapper/VolGroup00-rootlv<br />
.                    132304280     5104976 120478588     5% /<br />
/dev/md0                               132134         32791     92521   27% /boot<br />
none                                     8202920                 0   8202920     0% /dev/shm<br />
/dev/mapper/testvg-testlv<br />
.                     13413488         63516   12668820     1% /tmp/test</code></p>
<p>That should be it. The sync time for huge volumes is going to be something to keep in mind. The whole setup is clean and neat without clutter. I could have opted to mirror using LVM, but there seems to be a strange requirement for third, log volume. It is possible to keep the log in memory, but that supposedly causes resync on boot.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.unixpowered.com/blog/2009/02/06/growing-mirrored-lun-in-redhat/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Getting started with SOL on Sun Fire V20z and V40z</title>
		<link>http://www.unixpowered.com/blog/2008/10/04/getting-started-with-sol-on-sun-fire-v20z-and-v40z/</link>
		<comments>http://www.unixpowered.com/blog/2008/10/04/getting-started-with-sol-on-sun-fire-v20z-and-v40z/#comments</comments>
		<pubDate>Sat, 04 Oct 2008 11:40:02 +0000</pubDate>
		<dc:creator>somedude</dc:creator>
				<category><![CDATA[centos]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[linux tips]]></category>
		<category><![CDATA[linux utilities]]></category>
		<category><![CDATA[redhat]]></category>
		<category><![CDATA[sun hardware]]></category>

		<guid isPermaLink="false">http://wayciak.wordpress.com/?p=58</guid>
		<description><![CDATA[SP on Sun Fire V40z can be configured so that you can access system console over the network as you would on a UltraSPARC machine with Net Management port. Here is a quick way to get started using V40z and RedHat. Before starting, connect up SP network interface to the network.
Now, edit /etc/inittab and add [...]]]></description>
			<content:encoded><![CDATA[<p><acronym title="Service Processor">SP</acronym> on Sun Fire <a title="Sun Fire V40z" href="http://sunsolve.sun.com/handbook_pub/validateUser.do?target=Systems/SunFireV40z_R/SunFireV40z_R" target="_self">V40z</a> can be configured so that you can access system console over the network as you would on a UltraSPARC machine with Net Management port. Here is a quick way to get started using V40z and RedHat. Before starting, connect up SP network interface to the network.</p>
<p>Now, edit /etc/inittab and add the following line:</p>
<p><code>co:12345:respawn:/sbin/agetty -t 60 ttyS0 9600 vt100</code></p>
<p>This will spawn <em>agetty</em> in runlevels <em>12345</em> on serial port 1 with <em>9600</em> baud rate and <em>vt100</em> emulation.</p>
<p>Next you need to edit <em>/etc/grub.conf</em> and comment out <em>splashimage</em> line so boot menu gets rendered properly. Then add following two lines:</p>
<p><code>serial --unit=0 --speed=9600<br />
terminal --timeout=10 console serial</code></p>
<p>This will initialize serial port 1 after GRUB startup. If you want to use serial port 2 you would set <em>&#8211;unit=1</em>. The terminal we will be using are <em>console</em> and <em>serial</em> in that order, with timeout of <em>10</em> seconds. Terminal gets selected depending on where keystroke is detected first, before timeout runs out. If timeout expires, first terminal specified is used.</p>
<p>Finally, append following to the kernel line: <em>console=tty0 console=ttyS0,9600n8</em>. So it will end up looking something like this:</p>
<p><code>kernel /vmlinuz-2.6.9-67.ELsmp ro root=/dev/VolGroup00/LogVol00 rhgb quiet console=tty0 console=ttyS0,9600n8</code></p>
<p>Now, you need to add serial port device name to <em>/etc/securetty</em>. This file specifies devices where root can log in. Just append <em>ttyS0</em> (serial port 1) to the end of the file.</p>
<p>Time to reboot and go to BIOS&#8217;s Advanced Settings. Select Console Redirection to Serial Port A and verify you have correct baud rate selected. Reboot the server for all changes to take effect.</p>
<p>At this point SP might not have an IP address assigned, so assign it one using V40z&#8217;s front panel. Once you configured SP with IP address, subnet mask and default gateway, ssh to the IP address, <strong>from local subnet</strong>, using the following:</p>
<p><code>bash-3.00# <strong>ssh setup@IP</strong></code></p>
<p>You will be asked to setup SP usernames and passwords. When you are done, ssh back to the SP using one of the usernames you have set up, and disable and then re-enable Serial Over LAN:</p>
<p><code>localhost $ <strong>platform set console -s platform</strong><br />
localhost $ <strong>platform set console -s sp -e -S 9600</strong></code></p>
<p>After the SP has been re-enabled, it might be a good idea to set up command prompt so you know which server you are logged into:</p>
<p><code>localhost $ <strong>sp set hostname ultra-sp</strong></code></p>
<p>Now you can access the console using:</p>
<p><code>ultra-sp $ <strong>platform console</strong></code></p>
<p>After you connect to the console you can get help by pressing <em>CTRL+E</em> followed by <em>c</em> and <em>?</em>.Here is sample output:</p>
<p><code>----<br />
ultra-sp $ <strong>platform console</strong><br />
[Enter `^Ec?' for help]<br />
Red Hat Enterprise Linux release 4<br />
Kernel 2.4.21-3.EL on an i686</code></p>
<p><code>ultra login:<br />
[help]<br />
.    disconnect                        ;    move to another console<br />
a    attach read/write                 b    send broadcast message<br />
c    toggle flow control               d    down a console<br />
e    change escape sequence            f    force attach read/write<br />
g    group info                        i    information dump<br />
L    toggle logging on/off             l?   break sequence list<br />
l0   send break per config file        l1-9 send specific break sequence<br />
m    display the message of the day    o    (re)open the tty and log file<br />
p    replay the last 60 lines          r    replay the last 20 lines<br />
s    spy read only                     u    show host status<br />
v    show version info                 w    who is on this console<br />
x    show console baud info            z    suspend the connection<br />
|    attach local command              ?    print this message<br />
&lt;cr&gt; ignore/abort command              ^R   replay the last line<br />
ooo send character by octal code<br />
----</code></p>
<p>At this point you should have a usable network console. You might want to make <a title="Sun Fire V20z and Sun Fire V40z Servers--Server Management Guide" href="http://docs.sun.com/app/docs/doc/817-5249-17?l=en" target="_self">additional setup changes </a>to the SP to fit your environment.</p>
<p>The first time I issued <em>platform console</em> command in SP I got this error:</p>
<p><code>console: connect: 59372@console: Connection refused</code></p>
<p>Rebooting SP using sp reboot fixed the issue for me.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.unixpowered.com/blog/2008/10/04/getting-started-with-sol-on-sun-fire-v20z-and-v40z/feed/</wfw:commentRss>
		<slash:comments>2</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 -->
