<?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>IT Support Blog &#187; Linux</title>
	<atom:link href="http://www.aionsolution.com/blog/category/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.aionsolution.com/blog</link>
	<description>[IT Problem Resolved]</description>
	<lastBuildDate>Mon, 12 Dec 2011 10:34:37 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.4</generator>
		<item>
		<title>Understanding swap files in Linux</title>
		<link>http://www.aionsolution.com/blog/linux/understanding-swap-files-in-linux/</link>
		<comments>http://www.aionsolution.com/blog/linux/understanding-swap-files-in-linux/#comments</comments>
		<pubDate>Wed, 29 Jun 2011 05:34:40 +0000</pubDate>
		<dc:creator>aionman</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.aionsolution.com/blog/?p=347</guid>
		<description><![CDATA[http://distilledb.com/blog/archives/date/2009/02/22/swap-files-in-linux.page Understanding swap files in Linux Summary If you run anything close to a modern operating system, you almost certainly interact with a swap file. You might be familiar with the basics of how these work: they allow your OS to prioritize more frequently-used pages in main memory and move the less frequently-used ones to [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://distilledb.com/blog/archives/date/2009/02/22/swap-files-in-linux.page">http://distilledb.com/blog/archives/date/2009/02/22/swap-files-in-linux.page</a></p>
<div>
<h1 id="page-title">Understanding swap files in Linux</h1>
<div></div>
</div>
<div>
<div>
<p><strong>Summary</strong> If you run anything close to a modern operating system, you almost certainly interact with a swap file. You might be familiar with the basics of how these work: they allow your OS to prioritize more frequently-used pages in main memory and move the less frequently-used ones to disk. But there&#8217;s a lot going on underneath the covers. Here&#8217;s a simple guide to swap files in Linux.</p>
<p>To appease some of my hungrier applications and support heftier development efforts, I recently upgraded the memory on my system from 4 GiB to 8 GiB. That gave me occasion to tinker around with the swapping behavior of my system and check things out.</p>
<p>If you run anything close to a modern operating system, you almost certainly interact with a <em>swap file</em>. You might be familiar with the basics of how these work: they allow your OS to prioritize more frequently-used pages in main memory and move the less frequently-used ones to disk. But there&#8217;s a lot going on underneath the covers. Here&#8217;s a simple guide to the theory and practice of swap files in Linux, and how you can tweak things for your benefit.</p>
<h3>An abstract memory model</h3>
<p>It&#8217;ll be useful to have a mental model of the way memory works in general<sup><a href="http://distilledb.com/blog/archives/date/2009/02/22/swap-files-in-linux.page#fn1">1</a></sup>, so we&#8217;ll start from the basis of a simple one here.</p>
<p>In general, all computers have access to <em>physical memory</em>, where the actual bits are manipulated and stored for use. Most modern operating systems present physical memory to higher-level applications as an abstraction called<em>virtual memory</em>. This allows applications to see memory as if it were a contiguous block, even though the underlying physical memory may theoretically be taken from many arbitrary, heterogeneous sources &#8212; multiple memory chips, flash memory, disk drives, and so on.</p>
<p>The memory manager divides virtual memory into chunks of identical size called <em>pages</em>. A page is the smallest amount that the OS will allocate in response to requests from programs. It is also the smallest unit of transfer between main memory and any other location, such as a hard disk. The size of a page is usually fixed by the operating system&#8217;s kernel<sup><a href="http://distilledb.com/blog/archives/date/2009/02/22/swap-files-in-linux.page#fn2">2</a></sup>.</p>
<div><img src="http://distilledb.com/blog/assets/entry-assets/by-id/29/virtual-to-pages.png" alt="" /></p>
<div>Applications see virtual memory as a contiguous resource divided into units called pages. A typical page size for a modern desktop system is about 4 kilobytes.</div>
</div>
<p>As pages are allocated to applications, they are assigned pages in the physical memory space through a special mapping called <em>address translation</em>. Applications don&#8217;t know where they are in the physical space; they see only the pages they use.</p>
<div><img src="http://distilledb.com/blog/assets/entry-assets/by-id/29/virtual-to-physical.png" alt="" /></p>
<div>Address translation maps virtual pages onto physical pages. This mapping is transparent to applications.</div>
</div>
<p>The memory manager knows how to aggregate different backing stores to provide the abstraction of contiguous virtual memory. By updating the address translation mechanism so that a virtual page always points to the correct physical page, the memory manager may move pages around in physical memory without directly impacting applications.</p>
<div><img src="http://distilledb.com/blog/assets/entry-assets/by-id/29/pages-to-memory.png" alt="" /></p>
<div>The backing stores for pages can be quite heterogeneous.</div>
</div>
<h3>Wide variation in different kinds of physical memory</h3>
<p>Not every backing store displays the same storage and speed characteristics. If different types of physical memory display different characteristics, the memory manager can exploit these differences to optimize system performance. It can make intelligent decisions about which pages should go where.</p>
<p>Consider the difference between main memory and a hard drive, for example.</p>
<div>
<table>
<tbody>
<tr>
<th rowspan="3">characteristic</th>
<th colspan="4">storage medium</th>
</tr>
<tr>
<th colspan="2">on disk</th>
<th colspan="2">in main memory</th>
</tr>
<tr>
<th>absolute</th>
<th>relative</th>
<th>absolute</th>
<th>relative</th>
</tr>
<tr>
<td>access time</td>
<td align="center">5ms</td>
<td align="center">1×</td>
<td align="center">10ns</td>
<td align="center">500,000× faster</td>
</tr>
<tr>
<td>peak transfer rate</td>
<td align="center">80 MB/s</td>
<td align="center">1×</td>
<td align="center">8 GB/s</td>
<td align="center">100× faster</td>
</tr>
<tr>
<td>storage space</td>
<td align="center">100 GB</td>
<td align="center">25× larger</td>
<td align="center">4 GB</td>
<td align="center">1×</td>
</tr>
<tr>
<td>price/GB storage</td>
<td align="center">$0.60/GB</td>
<td align="center">20× cheaper</td>
<td align="center">$12/GB</td>
<td align="center">1×</td>
</tr>
</tbody>
</table>
<div>Some comparisons of a typical hard drive and typical main memory on a consumer-grade desktop.</div>
</div>
<p>Because storage on disk-backed file systems does indeed have different characteristics than storage in main memory, there&#8217;s significant room to optimize depending on the characteristics of how pages are accessed. As the table shows, hard disks are several orders of magnitude slower and less efficient at retrieving data than main memory. Thus, the memory manager needs to carefully balance the demand for memory against the different kinds of supply.</p>
<h3>Flavors of pages</h3>
<p>If all pages were of the same kind, deciding which pages should go where would be a simpler decision. For example, one strategy is to make the access time quickest for the pages that are accessed the most frequently. Unfortunately, it&#8217;s not just the types of memory that are heterogeneous, but also the contents of the pages that are stored there. On Linux, there are four different kinds of pages.</p>
<ul>
<li><em>Kernel pages.</em> Pages holding the program contents of the kernel itself. Unlike the other flavors, these are fixed in memory once the operating system has loaded and are never moved.</li>
<li><em>Program pages.</em> Pages storing the contents of programs and libraries. These are read-only, so no updates to disk are needed.</li>
<li><em>File-backed pages.</em> Pages storing the contents of files on disk. If this page has been changed in memory (for example, if it&#8217;s a document you&#8217;re working on), it will eventually need to be written out to disk to synchronize the changes.</li>
<li><em>Anonymous pages.</em> Pages not backed by anything on disk. When a program requests memory be allocated to perform computations or record information, the information resides in anonymous pages.</li>
</ul>
<p>When the in-memory version of a page is the same as the one on disk, we say that the page is <em>clean</em>; the contents are the same. But sometimes the contents of a page have been updated since the last time they were read. When this happens, the page becomes <em>dirty</em>.</p>
<p>A clean page can be repurposed for something else easily; no updates need to be made, and the page can simply be recycled. But a dirty page has to be written back to disk before it can be used again. For file pages, this is an expensive operation, so the kernel tries to avoid the overhead of flushing back to disk when it can.</p>
<p>For anonymous pages, there&#8217;s a different problem. Effectively, they&#8217;re always dirty: the very act of creating the anonymous page means that there is now data that is in memory which isn&#8217;t in disk. If the kernel wants to use anonymous pages for something else, it must first reclaim them. But anonymous pages have no files to back them. How can you flush something back to disk when there&#8217;s nowhere to flush it to?</p>
<h3>Swap files</h3>
<p>The use of swap can resolve many of these issues. <em>Swap</em> is a disk-backed area that&#8217;s treated as an extension of main memory. It serves as a holding area for pages that have been <em>evicted</em> by the kernel. Let&#8217;s use an illustrative example to show how swap files help make memory work better.</p>
<div><img src="http://distilledb.com/blog/assets/entry-assets/by-id/29/page-legend.png" alt="" /></p>
<div>Legend for the next few diagrams. Unused pages have dotted borders; dirty pages have an alert symbol; and anonymous and file pages are colored orange and green, respectively.</div>
</div>
<p>When a moderately loaded system gets additional requests for memory, the kernel generally draws from the pool of free pages first to fulfill these requests. If there are few free pages remaining, the kernel tries to flush clean pages to make room for the new requests.</p>
<div id="page-eviction-1"><img src="http://distilledb.com/blog/assets/entry-assets/by-id/29/page-eviction-1.png" alt="" /></p>
<div>The kernel prefers to go after unused pages first.</div>
</div>
<p>If the clean pages also become depleted, the kernel is forced to clean a dirty page and then flush it. This is an expensive operation. For this reason, the kernel tries to maintain at least some clean pages all the time.</p>
<p>When the ratio of anonymous pages to dirty pages is high and the number of clean pages is low, the kernel is running out of memory. Without swap, this situation will require a number of costly disk writes. Consider a request for allocation when a number of dirty pages are already present.</p>
<div id="page-eviction-2"><img src="http://distilledb.com/blog/assets/entry-assets/by-id/29/page-eviction-2.png" alt="" /></p>
<div>Without swap space, it&#8217;s easier for systems to get overloaded.</div>
</div>
<p>In the figure above, a request for two anonymous pages has come in. There are no more unused pages, so the kernel must drop one of the existing pages to satisfy the request. The kernel can use one page freely: the single clean file page in slot 6.</p>
<p>But to allocate the second page, the kernel now has to flush one of the dirty file pages (in slots 1, 3, or 4) back to disk to make room. It cannot move the page in slot 5 anywhere, because it is anonymous and has no backing store; there&#8217;s nowhere else to put it. Even if this page has not been used in a very long time, it must still occupy space in memory until the process using it has released the page.</p>
<div id="page-eviction-3"><img src="http://distilledb.com/blog/assets/entry-assets/by-id/29/page-eviction-3.png" alt="" /></p>
<div>When space is tight and there&#8217;s no swap the kernel must make room by cleaning dirty pages and freeing them. In this example, the kernel is forced to clean page #1 back to disk to make room for the second allocated page.</div>
</div>
<p>Without swap, the kernel gets boxed into this unfortunate corner more easily.</p>
<p>With swap, however, the kernel gets an additional tool to use in its arsenal. Instead of being forced to clean one of the dirty pages, it can instead evict one of the anonymous pages to the swap region.</p>
<div id="page-eviction-4"><img src="http://distilledb.com/blog/assets/entry-assets/by-id/29/page-eviction-4.png" alt="" /></p>
<div>When swap is available, the kernel doesn&#8217;t need to clean dirty pages, and can instead move anonymous pages to swap.</div>
</div>
<p>As in the earlier non-swap scenario, the kernel use can use the clean page in slot 6 for the first requested page. It is allocated and the clean page is dropped.</p>
<p>For the second requested page, the kernel must no longer clean a dirty page to make room. Instead, it can simply flush one of the anonymous pages to the swap region. The code required to do this is generally very simple and significantly less complex than cleaning a dirty page, and the kernel prefers swapping to cleaning dirty file-backed pages.</p>
<h3>Optimizing your swap settings</h3>
<p>Linux provides a number of ways to interact with your swap. Two are detailed here:</p>
<ul>
<li>Aggressiveness of swapping</li>
<li>Adding and removing additional swap containers</li>
</ul>
<h3>Controlling aggressiveness of swapping</h3>
<p>The more aggressively the kernel swaps, the more efficiently existing memory can be put to use. Pages that look like they&#8217;re not being used will be swapped out rapidly. If the kernel swaps too often, though, applications that were using those pages will take longer to become responsive again as the kernel swaps their memory back into main memory.</p>
<p>For a desktop user, responsiveness of applications can be important, so an aggressive swap may not be desirable, even if it results in less efficient use of memory. For servers and other non-interactive systems, more aggressive swapping may be appropriate and acceptable.</p>
<p>On Linux, this careful balancing act can be configured to meet your personal preferences. The kernel swaps out pages with a zealousness controlled by a <em>swappiness</em> setting.</p>
<p>Swappiness is an integer that ranges from 0 to 100, and indicates the degree to which the kernel favors swap space over main memory. Higher swappiness means that the kernel will move things to swap more frequently. Lower swappiness means that the kernel tries to avoid using swap. A swappiness of zero causes the kernel to avoid swap for as long as possible.</p>
<p>Ubuntu and several other Linux distributions have a default <code>swappiness</code> of 60. You can check your swap setting by reading a <code>/proc/sys</code> value:</p>
<pre>$ cat /proc/sys/vm/swappiness
60</pre>
<p>To temporarily modify your swappiness, simply edit this value:</p>
<pre>$ sudo sysctl vm.swappiness=40
vm.swappiness = 40</pre>
<p>This setting lasts until reboot or you change it again with another <code>sysctl vm.swappiness</code> invocation. To make this setting take effect on every reboot, edit your <code>/etc/sysctl.conf</code> configuration file.</p>
<pre>$ gksudo gedit /etc/sysctl.conf</pre>
<p>Find the <code>vm.swappiness</code> line; if none exists, add it.</p>
<pre>vm.swappiness = 40</pre>
<h3>Adding swap containers</h3>
<p>Modern operating systems generally have either a <em>swap partition</em> or a <em>swap file</em>. In a swap partition, part of the hard drive is sliced off and becomes dedicated to swap. A swap file is just an ordinary file that holds up to its file size in swapped pages.</p>
<p>A swap file is considerably less complicated than a swap partition to establish. There is no speed difference between the two<sup><a href="http://distilledb.com/blog/archives/date/2009/02/22/swap-files-in-linux.page#fn3">3</a></sup>, so swap files are favorable in this respect. However, if you want to be able to hibernate or suspend your computer, using a swap partition is required in some cases. (These suspend/hibernate managers usually cannot handle writing to an active file system.)</p>
<p>Making a new swap file is a simple process. In this example, we&#8217;ll make a 2 GiB swap file and make it available to the system as additional swap space. We&#8217;ll use <code>primary.swap</code> as the name of the example swap file, but there is nothing special about the name of the file or its extension. You may use anything you wish.</p>
<p>First, we need to create the swap file itself. We&#8217;ll use a stream of zeroes as the input source (<code>if=/dev/zero</code>), and write it out to a file named <code>primary.swap</code> in the <code>/mnt</code> directory (<code>of=/mnt/primary.swap</code>). We will write 2048 (<code>count=2048</code>) blocks each 1 MiB in size (<code>bs=1M</code>). Depending on the speed of your hard disks, this may take a little while.</p>
<pre>$ sudo dd if=/dev/zero of=/mnt/primary.swap bs=1M count=2048
2048+0 records in
2048+0 records out
2147483648 bytes (2.1 GB) copied, 30.1085 s, 71.3 MB/s</pre>
<p>Next, we need to format this file and prepare it for use as a swapping space. The <code>mkswap</code> utility sets up a swap area on a device or file.</p>
<pre>$ sudo mkswap /mnt/primary.swap
Setting up swapspace version 1, size = 2097148 KiB
no label, UUID=7be2b3b6-83b0-4afd-8537-197cf12f8c59</pre>
<p>After formatting it, the swap can now be added to our system. Use the <code>swapon</code> utility to activate the swap region.</p>
<pre>$ sudo swapon /mnt/primary.swap</pre>
<p>You can verify that your swap space is now 2 GiB larger.</p>
<pre>$ cat /proc/meminfo | grep SwapTotal
SwapTotal:     2097144 kB</pre>
<p>Your changes will be lost at reboot, so if you want to make them permanent we&#8217;ll need to edit your filesystem table in <code>/etc/fstab</code>.</p>
<pre>$ gksudo gedit /etc/fstab</pre>
<p>Now add your swap file to the list of filesystems to mount at boot by appending a line to the file.</p>
<pre>/mnt/primary.swap  none  swap  sw  0 0</pre>
<h3>Removing a swap file</h3>
<p>Removal works much the same way, but in reverse. If you&#8217;ve added your swap to the <code>/etc/fstab</code> list, you need to remove it here first.</p>
<p>To disable your running swaps, run the <code>swapoff</code> utility. You can either specify the swap you&#8217;d like to disable, or use the <code>-a</code> parameter.</p>
<pre>$ sudo swapoff /mnt/primary.swap</pre>
<p>When you disable swap, you force the kernel to clean every page on the swap and/or push it back to main memory. If there is not enough space to squeeze everything in, you may receive out of memory errors from the kernel, so use this judiciously.</p>
<h3>Conclusion</h3>
<p>Swap files are an essential part of the memory-management modules of operating systems. In Linux, adding and removing swap partitions and files is simple, and you can control how the kernel interacts with swap through configurable parameters. Through the use of these and other techniques, and with an understanding of the basics of swap, you can tweak your system&#8217;s use of memory to your heart&#8217;s content.</p>
<h3>Additional reading</h3>
<ul>
<li><a href="http://fosswire.com/2009/02/08/sysctl-swappiness/">Speed up your system by avoiding the swap file</a>. <em>FOSSWire.</em> Accessed February 8th, 2009.</li>
<li><a href="http://lwn.net/Articles/83588/">2.6 swapping behavior</a>. <em>LWN.net.</em> Accessed February 8th, 2009.</li>
<li><a href="http://help.ubuntu.com/community/SwapFaq">Swap FAQ</a>. <em>Ubuntu Documentation.</em> Accessed February 12th, 2009.</li>
<li>Patterson, David A. and Hennessy, John L. <em>Computer Organization and Design: The hardware/software interface.</em> © 1997. Morgan Kaufmann Publishers, San Francisco, California.</li>
</ul>
<p id="fn1"><sup>1</sup> As this is only a model, we will naturally be leaving off some of the important but messier details.</p>
<p id="fn2"><sup>2</sup> On Linux, you can check your page size with the <code>getconf</code> command, specifying the PAGE_SIZE parameter. This returns the number of pages in bytes. 4 kilobytes (4,096 bytes) is a typical result on the <code>x86</code> and <code>x86_64</code>architectures, so there are 256 pages / <acronym title="megabyte">MB</acronym>.</p>
<pre>$ getconf PAGE_SIZE
4096</pre>
<p id="fn3"><sup>3</sup> See <a href="http://lkml.org/lkml/2006/5/29/3">this Linux kernel mailing list post</a>.</p>
</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.aionsolution.com/blog/linux/understanding-swap-files-in-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux log files</title>
		<link>http://www.aionsolution.com/blog/linux/linux-log-files/</link>
		<comments>http://www.aionsolution.com/blog/linux/linux-log-files/#comments</comments>
		<pubDate>Wed, 29 Jun 2011 04:29:02 +0000</pubDate>
		<dc:creator>aionman</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.aionsolution.com/blog/?p=345</guid>
		<description><![CDATA[Linux Log files and usage =&#62; /var/log/messages : General log messages =&#62; /var/log/boot : System boot log =&#62; /var/log/debug : Debugging log messages =&#62; /var/log/auth.log : User login and authentication logs =&#62; /var/log/daemon.log : Running services such as squid, ntpd and others log message to this file =&#62; /var/log/dmesg : Linux kernel ring buffer log [...]]]></description>
			<content:encoded><![CDATA[<p>Linux Log files and usage</p>
<p>=&gt; /var/log/messages : General log messages</p>
<p>=&gt; /var/log/boot : System boot log</p>
<p>=&gt; /var/log/debug : Debugging log messages</p>
<p>=&gt; /var/log/auth.log : User login and authentication logs</p>
<p>=&gt; /var/log/daemon.log : Running services such as squid, ntpd and others log message to this file</p>
<p>=&gt; /var/log/dmesg : Linux kernel ring buffer log</p>
<p>=&gt; /var/log/dpkg.log : All binary package log includes package installation and other information</p>
<p>=&gt; /var/log/faillog : User failed login log file</p>
<p>=&gt; /var/log/kern.log : Kernel log file</p>
<p>=&gt; /var/log/lpr.log : Printer log file</p>
<p>=&gt; /var/log/mail.* : All mail server message log files</p>
<p>=&gt; /var/log/mysql.* : MySQL server log file</p>
<p>=&gt; /var/log/user.log : All userlevel logs</p>
<p>=&gt; /var/log/xorg.0.log : X.org log file</p>
<p>=&gt; /var/log/apache2/* : Apache web server log files directory</p>
<p>=&gt; /var/log/lighttpd/* : Lighttpd web server log files directory</p>
<p>=&gt; /var/log/fsck/* : fsck command log</p>
<p>=&gt; /var/log/apport.log : Application crash report / log file</p>
]]></content:encoded>
			<wfw:commentRss>http://www.aionsolution.com/blog/linux/linux-log-files/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ssh takes a long time to connect or log in</title>
		<link>http://www.aionsolution.com/blog/linux/ssh-takes-a-long-time-to-connect-or-log-in/</link>
		<comments>http://www.aionsolution.com/blog/linux/ssh-takes-a-long-time-to-connect-or-log-in/#comments</comments>
		<pubDate>Thu, 20 Jan 2011 01:07:24 +0000</pubDate>
		<dc:creator>aionman</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.aionsolution.com/blog/?p=332</guid>
		<description><![CDATA[Large delays (more than 10 seconds) are typically caused by a problem with name resolution: Some versions of glibc (notably glibc 2.1 shipped with Red Hat 6.1) can take a long time to resolve &#8220;IPv6 or IPv4&#8243; addresses from domain names. This can be worked around with by specifying AddressFamily inet option in ssh_config. There may be [...]]]></description>
			<content:encoded><![CDATA[<p>Large delays (more than 10 seconds) are typically caused by a problem with name resolution:</p>
<ul>
<li>Some versions of glibc (notably glibc 2.1 shipped with Red Hat 6.1) can take a long time to resolve &#8220;IPv6 or IPv4&#8243; addresses from domain names. This can be worked around with by specifying <strong>AddressFamily inet</strong> option in <em>ssh_config</em>.</li>
<li>There may be a DNS lookup problem, either at the client or server. You can use the <code>nslookup</code> command to check this on both client and server by looking up the other end&#8217;s name and IP address. In addition, on the server look up the name returned by the client&#8217;s IP-name lookup. You can disable most of the server-side lookups by setting <strong>UseDNS no</strong> in <em>sshd_config</em>.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.aionsolution.com/blog/linux/ssh-takes-a-long-time-to-connect-or-log-in/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installation Notes Broadcom tg3 Linux Driver</title>
		<link>http://www.aionsolution.com/blog/linux/installation-notes-broadcom-tg3-linux-driver/</link>
		<comments>http://www.aionsolution.com/blog/linux/installation-notes-broadcom-tg3-linux-driver/#comments</comments>
		<pubDate>Wed, 01 Dec 2010 15:12:28 +0000</pubDate>
		<dc:creator>aionman</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Networking]]></category>

		<guid isPermaLink="false">http://www.aionsolution.com/blog/?p=310</guid>
		<description><![CDATA[Installation Notes Broadcom tg3 Linux Driver Version 3.57b 04/28/2006 Broadcom Corporation 16215 Alton Parkway, Irvine, CA 92619-7013 Copyright (c) 2004, 2005, 2006 Broadcom Corporation All rights reserved Table of Contents ================= Introduction Limitations Packaging Installing Source RPM Package Building Driver From TAR File Driver Settings Driver Defaults Unloading and Removing Driver Driver Messages Introduction ============ [...]]]></description>
			<content:encoded><![CDATA[<p>Installation Notes<br />
Broadcom tg3 Linux Driver<br />
Version 3.57b<br />
04/28/2006</p>
<p>Broadcom Corporation<br />
16215 Alton Parkway,<br />
Irvine, CA 92619-7013</p>
<p>Copyright (c) 2004, 2005, 2006 Broadcom Corporation<br />
All rights reserved</p>
<p>Table of Contents<br />
=================</p>
<p>Introduction<br />
Limitations<br />
Packaging<br />
Installing Source RPM Package<br />
Building Driver From TAR File<br />
Driver Settings<br />
Driver Defaults<br />
Unloading and Removing Driver<br />
Driver Messages</p>
<p>Introduction<br />
============</p>
<p>This file describes the tg3 Linux driver for the Broadcom NetXtreme<br />
10/100/1000 Mbps PCI/PCI-X/PCI Express Ethernet Network Controllers.<br />
The latest driver is in the latest 2.6 Linux kernel. It can also be<br />
downloaded from http://www.broadcom.com as a source package, but is<br />
generally not necessary to do so if you are using the latest 2.6<br />
upstream kernel from http://www.kernel.org or one of the latest<br />
vendor kernels from Red Hat, SuSE, or others.</p>
<p>The tg3 driver from the Broadcom package is almost identical to the<br />
tg3 driver in the latest 2.6 upstream Linux kernel. It includes some<br />
additional kernel compatible code to allow it to compile on older 2.6<br />
and some 2.4 kernels. The version number is also similar but generally<br />
has a one letter suffix at the end, (e.g. 3.55b) to distinguish it from<br />
the in-kernel tg3 driver.</p>
<p>The next few sections on packaging, compiling, and installation apply<br />
mostly to the Broadcom driver package only.</p>
<p>Limitations<br />
===========</p>
<p>The current version of the driver has been tested on 2.4.x kernels starting<br />
from 2.4.24 and all 2.6.x kernels. The driver may not compile on kernels<br />
older than 2.4.24. Testing is concentrated on i386 and x86_64 architectures.<br />
Only limited testing has been done on some other architectures such as<br />
powerpc and sparc64.</p>
<p>Minor changes to some source files and Makefile may be needed on some<br />
kernels.</p>
<p>Packaging<br />
=========</p>
<p>To replace an older previously installed or in-kernel tg3 driver, follow<br />
the instructions below.</p>
<p>The driver package from http://www.broadcom.com is released in two packaging<br />
formats: source RPM and compressed tar formats. The file names for the two<br />
packages are tg3-&lt;version&gt;.src.rpm and tg3-&lt;version&gt;.tar.gz respectively.<br />
Identical source files to build the driver are included in both packages.</p>
<p>Installing Source RPM Package<br />
=============================</p>
<p>The following are general guidelines for installing the driver.</p>
<p>1. Install the source RPM package:</p>
<p>rpm -ivh tg3-&lt;version&gt;.src.rpm</p>
<p>2. CD to the RPM path and build the binary driver for your kernel:</p>
<p>cd /usr/src/{redhat,OpenLinux,turbo,packages,rpm ..}</p>
<p>rpm -bb SPECS/tg3.spec</p>
<p>or</p>
<p>rpmbuild -bb SPECS/tg3.spec (for RPM version 4.x.x)</p>
<p>Note that the RPM path is different for different Linux distributions.</p>
<p>3. Install the newly built package (driver and man page):</p>
<p>rpm -ivh RPMS/&lt;arch&gt;/tg3-&lt;version&gt;.&lt;arch&gt;.rpm</p>
<p>&lt;arch&gt; is the architecture of the machine, e.g. i386:</p>
<p>rpm -ivh RPMS/i386/tg3-&lt;version&gt;.i386.rpm</p>
<p>Note that the &#8211;force option may be needed on some Linux distributions<br />
if conflicts are reported.</p>
<p>The driver will be installed in the following path:</p>
<p>2.4.x kernels:</p>
<p>/lib/modules/&lt;kernel_version&gt;/kernel/drivers/net/tg3.o</p>
<p>2.6.x kernels:</p>
<p>/lib/modules/&lt;kernel_version&gt;/kernel/drivers/net/tg3.ko</p>
<p>4. Load the driver:</p>
<p>insmod tg3.o<br />
or<br />
insmod tg3.ko (on 2.6.x kernels)<br />
or<br />
modprobe tg3</p>
<p>5. To configure network protocol and address, refer to various Linux<br />
documentations.</p>
<p>Building Driver From TAR File<br />
=============================</p>
<p>The following are general guidelines for installing the driver.</p>
<p>1. Create a directory and extract the files:</p>
<p>tar xvzf tg3-&lt;version&gt;.tar.gz</p>
<p>2. Build the driver tg3.o (or tg3.ko) as a loadable module for the<br />
running kernel:</p>
<p>cd src<br />
make</p>
<p>3. Test the driver by loading it:</p>
<p>insmod tg3.o<br />
or<br />
insmod tg3.ko (on 2.6.x kernels)<br />
or<br />
insmod tg3</p>
<p>4. Install the driver:</p>
<p>make install</p>
<p>See RPM instructions above for the location of the installed driver.</p>
<p>5. To configure network protocol and address, refer to various Linux<br />
documentations.</p>
<p>Driver Settings<br />
===============</p>
<p>This and the rest of the sections below apply to both the in-kernel tg3<br />
driver and the tg3 driver package from Broadcom.</p>
<p>Driver settings can be queried and changed using ethtool. The latest ethtool<br />
can be downloaded from http://sourceforge.net/projects/gkernel if it is not<br />
already installed. The following are some common examples on how to use<br />
ethtool. See the ethtool man page for more information. ethtool settings do<br />
not persist across reboot or module reload. The ethtool commands can be put<br />
in a startup script such as /etc/rc.local to preserve the settings across a<br />
reboot.</p>
<p>1. Show current speed, duplex, and link status:</p>
<p>ethtool eth0</p>
<p>2. Change speed, duplex, autoneg:</p>
<p>Example: 100Mbps half duplex, no autonegotiation:</p>
<p>ethtool -s eth0 speed 100 duplex half autoneg off</p>
<p>Example: Autonegotiation with full advertisement:</p>
<p>ethtool -s eth0 autoneg on</p>
<p>Example: Autonegotiation with 100Mbps full duplex advertisement only:</p>
<p>ethtool -s eth0 speed 100 duplex full autoneg on</p>
<p>3. Show flow control settings:</p>
<p>ethtool -a eth0</p>
<p>4. Change flow control settings:</p>
<p>Example: Turn off flow control</p>
<p>ethtool -A eth0 autoneg off rx off tx off</p>
<p>Example: Turn flow control autonegotiation on with tx and rx advertisement:</p>
<p>ethtool -A eth0 autoneg on rx on tx on</p>
<p>Note that this is only valid if speed is set to autonegotiation.</p>
<p>5. Show offload settings:</p>
<p>ethtool -k eth0</p>
<p>6. Change offload settings:</p>
<p>Example: Turn off TSO (TCP segmentation offload)</p>
<p>ethtool -K eth0 tso off</p>
<p>7. Get statistics:</p>
<p>ethtool -S eth0</p>
<p>8. Perform self-test:</p>
<p>ethtool -t eth0</p>
<p>Note that the interface (eth0) must be up to do all tests.</p>
<p>9. See ethtool man page for more options.</p>
<p>Driver Defaults<br />
===============</p>
<p>Speed :                    Autonegotiation with all speeds advertised</p>
<p>Flow control :             Autonegotiation with rx and tx advertised</p>
<p>MTU :                      1500 (range 46 &#8211; 9000)</p>
<p>Some chips do not support jumbo MTUs bigger than<br />
1500</p>
<p>Rx Ring Size :              200 (range 0 &#8211; 511)</p>
<p>Some chips are fixed at 64</p>
<p>Rx Jumbo Ring Size :        100 (range 0 &#8211; 255)</p>
<p>Not all chips support the jumbo ring, and some<br />
chips that support jumbo frames do not use the<br />
jumbo ring.</p>
<p>Tx Ring Size :              511 (range (MAX_SKB_FRAGS+1) &#8211; 511)</p>
<p>MAX_SKB_FRAGS varies on different kernels and<br />
different architectures. On a 2.6 kernel for<br />
x86, MAX_SKB_FRAGS is 18.</p>
<p>Coalesce rx usecs :          20 (range 0 &#8211; 1023)</p>
<p>Coalesce rx usecs irq :      20 (range 0 &#8211; 255)</p>
<p>Coalesce rx frames :          5 (range 0 &#8211; 1023)</p>
<p>Coalesce rx frames irq :      5 (range 0 &#8211; 255)</p>
<p>Coalesce tx usecs :          72 (range 0 &#8211; 1023)</p>
<p>Coalesce tx usecs irq :      20 (range 0 &#8211; 255)</p>
<p>Coalesce tx frames :         53 (range 0 &#8211; 1023)</p>
<p>Coalesce tx frames irq :     5 (range 0 &#8211; 255)</p>
<p>Coalesce stats usecs   : 1000000 (aprox. 1 sec.)</p>
<p>Some coalescing parameters are not used or have<br />
different defaults on some chips</p>
<p>MSI :                      Enabled (if supported by the chip and passed<br />
the interrupt test)</p>
<p>TSO :                      Enabled on newer chips that support TCP segmentation<br />
offload in hardware.</p>
<p>Unloading and Removing Driver<br />
=============================</p>
<p>To unload the driver, use ifconfig to bring down all eth# interfaces opened<br />
by the driver, then do the following:</p>
<p>rmmod tg3</p>
<p>Note that on 2.6 kernels, it is not necessary to bring down the eth#<br />
interfaces before unloading the driver module.</p>
<p>If the driver was installed using rpm, do the following to remove it:</p>
<p>rpm -e tg3</p>
<p>If the driver was installed using make install from the tar file, the driver<br />
tg3.o (or tg3.ko) has to be manually deleted from the system. Refer<br />
to the section &#8220;Installing Source RPM Package&#8221; for the location of the<br />
installed driver.</p>
<p>Driver Messages<br />
===============</p>
<p>The following are the most common sample messages that may be logged in the file<br />
/var/log/messages. Use dmesg -n &lt;level&gt; to control the level at which messages<br />
will appear on the console. Most systems are set to level 6 by default. To see<br />
all messages, set the level higher.</p>
<p>Driver signon:<br />
&#8212;&#8212;&#8212;&#8212;-</p>
<p>tg3.c:v3.53c (Mar 13, 2006)</p>
<p>NIC detected:<br />
&#8212;&#8212;&#8212;&#8212;</p>
<p>eth0: Tigon3 [partno(BCM95704CA40) rev 2002 PHY(5704)] (PCI:66MHz:64-bit) 10/100/1000BaseT Ethernet 00:10:18:04:3e:64<br />
eth0: RXcsums[1] LinkChgREG[0] MIirq[0] ASF[0] Split[0] WireSpeed[1] TSOcap[1]<br />
eth0: dma_rwctrl[763f0000] dma_mask[64-bit]</p>
<p>Link up and speed indication:<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</p>
<p>tg3: eth0: Link is up at 1000 Mbps, full duplex.<br />
tg3: eth0: Flow control is on for TX and on for RX.</p>
<p>Link down indication:<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>tg3: eth0: Link is down.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.aionsolution.com/blog/linux/installation-notes-broadcom-tg3-linux-driver/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Enable Java Plugin on Firefox 3.6</title>
		<link>http://www.aionsolution.com/blog/linux/enable-java-plugin-on-firefox-3-6/</link>
		<comments>http://www.aionsolution.com/blog/linux/enable-java-plugin-on-firefox-3-6/#comments</comments>
		<pubDate>Thu, 07 Oct 2010 08:50:27 +0000</pubDate>
		<dc:creator>aionman</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.aionsolution.com/blog/?p=299</guid>
		<description><![CDATA[Pre-requisites. I don’t know how much of it its really needed, but I install the whole Sun’s Java 6 packages, $ sudo apt-get install sun-java6-jdk sun-java-6-jre sun-java6-pluging sun-java6-source sun-java6-bin For sure you’ll need the jdk and plugin one… If your internet connection is slow you might try installing these two first and try the above [...]]]></description>
			<content:encoded><![CDATA[<h2>Pre-requisites.</h2>
<p>I don’t know how much of it its really needed, but I install the whole Sun’s Java 6 packages,</p>
<blockquote>
<pre>$ sudo apt-get install sun-java6-jdk sun-java-6-jre sun-java6-pluging
   sun-java6-source sun-java6-bin</pre>
</blockquote>
<p>For sure you’ll need the jdk and plugin one… If your internet  connection is slow you might try installing these two first and try the  above command.</p>
<h2>Configuration of Java for Mozilla.</h2>
<p>For  enable Java plugin on Firefox 3.6,</p>
<blockquote>
<pre>$ sudo update-alternatives --install /usr/lib/mozilla/plugins/libjavaplugin.so \
   mozilla-javaplugin.so /usr/lib/jvm/java-6-sun/jre/lib/i386/libnpjp2.so 50</pre>
</blockquote>
<p>Now it’s time to restart your browser.</p>
<p>For checking that the plugin is enabled, open your Firefox browser and type</p>
<blockquote>
<pre>about:plugins</pre>
</blockquote>
<p>in the address line, there must be the Java application enabled.</p>
<p>﻿</p>
]]></content:encoded>
			<wfw:commentRss>http://www.aionsolution.com/blog/linux/enable-java-plugin-on-firefox-3-6/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Install ioncube in ubuntu</title>
		<link>http://www.aionsolution.com/blog/linux/install-ioncube-in-ubuntu/</link>
		<comments>http://www.aionsolution.com/blog/linux/install-ioncube-in-ubuntu/#comments</comments>
		<pubDate>Wed, 28 Apr 2010 02:39:27 +0000</pubDate>
		<dc:creator>aionman</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.aionsolution.com/blog/?p=276</guid>
		<description><![CDATA[IonCube protects software written using the PHP programming language from being viewed, changed, and run on unlicensed computers. 1. Download ionCube loaders sudo wget http://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86.tar.gz 2. Extract sudo tar zxvf ioncube_loaders_lin_x86.tar.gz 3. Move to a permanent location sudo mv ioncube /usr/local/ 4. Add reference to your php.ini file (sudo pico /etc/php5/apache2/php.ini) zend_extension = /usr/local/ioncube/ioncube_loader_lin_5.2.so There [...]]]></description>
			<content:encoded><![CDATA[<div class="post-header">IonCube protects software written using the PHP programming language from being viewed, changed, and run on unlicensed computers.</div>
<p>1. Download ionCube loaders</p>
<p><code>sudo wget http://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86.tar.gz<br />
</code></p>
<p>2. Extract</p>
<p><code>sudo tar zxvf ioncube_loaders_lin_x86.tar.gz<br />
</code></p>
<p>3. Move to a permanent location</p>
<p><code>sudo mv ioncube /usr/local/<br />
</code></p>
<p>4. Add reference to your php.ini file (sudo pico /etc/php5/apache2/php.ini)</p>
<p><code>zend_extension = /usr/local/ioncube/ioncube_loader_lin_5.2.so<br />
</code></p>
<p><em>There are a few versions of the loader in the tar archive. Use the one that matches your PHP version.</em></p>
<p>5. Restart apache</p>
<p><code>sudo /etc/init.d/apache2 restart</code></p>
<p>6. check installation using following command:<br />
php -v<br />
you should see following output:</p>
<p>PHP 5.1.6 (cli) (built: Apr 7 2009 08:00:04)<br />
Copyright (c) 1997-2006 The PHP Group<br />
Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies<br />
with the ionCube PHP Loader v3.1.34, Copyright (c) 2002-2009, by ionCube Ltd.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.aionsolution.com/blog/linux/install-ioncube-in-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>VMWare &#8211; Guest cannot browse Internet</title>
		<link>http://www.aionsolution.com/blog/linux/vmware-guest-cannot-browse-internet/</link>
		<comments>http://www.aionsolution.com/blog/linux/vmware-guest-cannot-browse-internet/#comments</comments>
		<pubDate>Sun, 11 Apr 2010 01:13:16 +0000</pubDate>
		<dc:creator>aionman</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[VMWare]]></category>

		<guid isPermaLink="false">http://www.aionsolution.com/blog/?p=261</guid>
		<description><![CDATA[I think I figured it out. It isn&#8217;t related to SLlinux, nor to port 443, nor to VMWare and the FC5 port directly, but a combination of the Fedora port and VMware settings. It is related to the MTU setting consistancy between the virtual machine, FC5 and the site in question. For some reason the [...]]]></description>
			<content:encoded><![CDATA[<p><span class="Apple-style-span" style="border-collapse: separate; color: #000000; font-family: Arial; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; font-size: medium;"><span class="Apple-style-span" style="color: #333333; font-family: Arial,Helvetica,sans-serif; font-size: 12px;">I think I figured it out. It isn&#8217;t related to SLlinux, nor to port 443, nor to VMWare and the FC5 port directly, but a combination of the Fedora port and VMware settings. It is related to the MTU setting consistancy between the virtual machine, FC5 and the site in question. For some reason the FC5 was set to 1492 and not 1500 as set under FC3. For this reason some of the HTTPS sites, I assume, require 1500 mtu. All I did was set Fedora&#8217;s eth0&#8242;s MTU setting to 1500 (ip link set eth0 mtu 1500) and it works fine. Weird. I could be wrong, but I think that was the problem. At least now it works. I got this hint from the guys at Fidelity. They thought it was unrelated, but apparently it is.</span></span></p>
<p><span class="Apple-style-span" style="border-collapse: separate; color: #000000; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><span class="Apple-style-span" style="font-family: Tahoma,Arial,Helvetica; font-size: 12px; line-height: 20px; text-align: justify;"><span style="margin: 0px; padding: 0px; border-width: 0px; outline-width: 0px; font-size: 12px; vertical-align: baseline; background-color: transparent; text-decoration: underline;"><strong style="margin: 0px; padding: 0px; border-width: 0px; outline-width: 0px; font-size: 12px; vertical-align: baseline; background-color: transparent; font-weight: 600;">M</strong></span>aximum<span class="Apple-converted-space"> </span><span style="margin: 0px; padding: 0px; border-width: 0px; outline-width: 0px; font-size: 12px; vertical-align: baseline; background-color: transparent; text-decoration: underline;"><strong style="margin: 0px; padding: 0px; border-width: 0px; outline-width: 0px; font-size: 12px; vertical-align: baseline; background-color: transparent; font-weight: 600;">T</strong></span>ransmission<span class="Apple-converted-space"> </span><span style="margin: 0px; padding: 0px; border-width: 0px; outline-width: 0px; font-size: 12px; vertical-align: baseline; background-color: transparent; text-decoration: underline;"><strong style="margin: 0px; padding: 0px; border-width: 0px; outline-width: 0px; font-size: 12px; vertical-align: baseline; background-color: transparent; font-weight: 600;">U</strong></span>nit(MTU), the largest physical packet size, measured in bytes, that a network can transmit. Any messages larger than the MTU are divided into smaller packets before being sent.By optimizing the MTU setting you can gain substantial network<span class="Apple-converted-space"> </span><a class="iAs" style="margin: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px ! important; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-left-width: 0px; outline-width: 0px; font-size: 12px; vertical-align: baseline; background-color: transparent ! important; text-decoration: none ! important; color: #00008b ! important; float: none; left: auto; right: auto; top: auto; bottom: auto; border-top-style: none; border-right-style: none; border-bottom-style: none ! important; border-left-style: none; line-height: normal; text-align: left; position: static ! important; display: inline; font-weight: bold ! important; cursor: pointer ! important;" href="#" target="_blank">performance<img style="margin: 0px; padding: 0px; border-width: 0px; outline-width: 0px; font-size: 12px; vertical-align: baseline; background-color: transparent; max-width: 90%; display: inline ! important; height: 10px; width: 10px; position: relative; top: 1px; left: 1px; float: none;" src="http://images.intellitxt.com/ast/adTypes/mag-glass_10x10.gif" alt="" /></a><span class="Apple-converted-space"> </span>increases, especially when using dial-up modem connections.</p>
<p style="margin: 0px 0px 10px; padding: 0px; border-width: 0px; outline-width: 0px; font-size: 12px; vertical-align: baseline; background-color: transparent; text-indent: 20px;">
<p style="margin: 0px 0px 10px; padding: 0px; border-width: 0px; outline-width: 0px; font-size: 12px; vertical-align: baseline; background-color: transparent; text-indent: 20px;">Default MTU Size for Different Network Topology</p>
<table style="margin: 0px 0px 14px; padding: 0px; border-width: 0px; outline-width: 0px; font-size: 12px; vertical-align: baseline; background-color: transparent; border-collapse: collapse; width: 283px; height: 160px;" border="1" align="center">
<tbody style="margin: 0px; padding: 0px; border-width: 0px; outline-width: 0px; font-size: 12px; vertical-align: baseline; background-color: transparent;">
<tr style="margin: 0px; padding: 0px; border-width: 0px; outline-width: 0px; font-size: 12px; vertical-align: baseline; background-color: transparent;">
<td style="margin: 0px; padding: 4px 10px 4px 5px; border-width: 0px; outline-width: 0px; font-size: 12px; vertical-align: baseline; background-color: transparent;"><strong style="margin: 0px; padding: 0px; border-width: 0px; outline-width: 0px; font-size: 12px; vertical-align: baseline; background-color: transparent; font-weight: 600;"><span style="margin: 0px; padding: 0px; border-width: 0px; outline-width: 0px; font-size: x-small; vertical-align: baseline; background-color: transparent;">Network</span></strong></td>
<td style="margin: 0px; padding: 4px 10px 4px 5px; border-width: 0px; outline-width: 0px; font-size: 12px; vertical-align: baseline; background-color: transparent;"><strong style="margin: 0px; padding: 0px; border-width: 0px; outline-width: 0px; font-size: 12px; vertical-align: baseline; background-color: transparent; font-weight: 600;"><span style="margin: 0px; padding: 0px; border-width: 0px; outline-width: 0px; font-size: x-small; vertical-align: baseline; background-color: transparent;">MTU(Bytes)</span></strong></td>
</tr>
<tr style="margin: 0px; padding: 0px; border-width: 0px; outline-width: 0px; font-size: 12px; vertical-align: baseline; background-color: transparent;">
<td style="margin: 0px; padding: 4px 10px 4px 5px; border-width: 0px; outline-width: 0px; font-size: 12px; vertical-align: baseline; background-color: transparent;"><span style="margin: 0px; padding: 0px; border-width: 0px; outline-width: 0px; font-size: x-small; vertical-align: baseline; background-color: transparent;">16 Mbit/Sec Token Ring</span></td>
<td style="margin: 0px; padding: 4px 10px 4px 5px; border-width: 0px; outline-width: 0px; font-size: 12px; vertical-align: baseline; background-color: transparent;"><span style="margin: 0px; padding: 0px; border-width: 0px; outline-width: 0px; font-size: x-small; vertical-align: baseline; background-color: transparent;">17914</span></td>
</tr>
<tr style="margin: 0px; padding: 0px; border-width: 0px; outline-width: 0px; font-size: 12px; vertical-align: baseline; background-color: transparent;">
<td style="margin: 0px; padding: 4px 10px 4px 5px; border-width: 0px; outline-width: 0px; font-size: 12px; vertical-align: baseline; background-color: transparent;"><span style="margin: 0px; padding: 0px; border-width: 0px; outline-width: 0px; font-size: x-small; vertical-align: baseline; background-color: transparent;">4 Mbits/Sec Token Ring</span></td>
<td style="margin: 0px; padding: 4px 10px 4px 5px; border-width: 0px; outline-width: 0px; font-size: 12px; vertical-align: baseline; background-color: transparent;"><span style="margin: 0px; padding: 0px; border-width: 0px; outline-width: 0px; font-size: x-small; vertical-align: baseline; background-color: transparent;">4464</span></td>
</tr>
<tr style="margin: 0px; padding: 0px; border-width: 0px; outline-width: 0px; font-size: 12px; vertical-align: baseline; background-color: transparent;">
<td style="margin: 0px; padding: 4px 10px 4px 5px; border-width: 0px; outline-width: 0px; font-size: 12px; vertical-align: baseline; background-color: transparent;"><span style="margin: 0px; padding: 0px; border-width: 0px; outline-width: 0px; font-size: x-small; vertical-align: baseline; background-color: transparent;">FDDI</span></td>
<td style="margin: 0px; padding: 4px 10px 4px 5px; border-width: 0px; outline-width: 0px; font-size: 12px; vertical-align: baseline; background-color: transparent;"><span style="margin: 0px; padding: 0px; border-width: 0px; outline-width: 0px; font-size: x-small; vertical-align: baseline; background-color: transparent;">4352</span></td>
</tr>
<tr style="margin: 0px; padding: 0px; border-width: 0px; outline-width: 0px; font-size: 12px; vertical-align: baseline; background-color: transparent;">
<td style="margin: 0px; padding: 4px 10px 4px 5px; border-width: 0px; outline-width: 0px; font-size: 12px; vertical-align: baseline; background-color: transparent;"><span style="margin: 0px; padding: 0px; border-width: 0px; outline-width: 0px; font-size: x-small; vertical-align: baseline; background-color: transparent;">Ethernet</span></td>
<td style="margin: 0px; padding: 4px 10px 4px 5px; border-width: 0px; outline-width: 0px; font-size: 12px; vertical-align: baseline; background-color: transparent;"><span style="margin: 0px; padding: 0px; border-width: 0px; outline-width: 0px; font-size: x-small; vertical-align: baseline; background-color: transparent;">1500</span></td>
</tr>
<tr style="margin: 0px; padding: 0px; border-width: 0px; outline-width: 0px; font-size: 12px; vertical-align: baseline; background-color: transparent;">
<td style="margin: 0px; padding: 4px 10px 4px 5px; border-width: 0px; outline-width: 0px; font-size: 12px; vertical-align: baseline; background-color: transparent;"><span style="margin: 0px; padding: 0px; border-width: 0px; outline-width: 0px; font-size: x-small; vertical-align: baseline; background-color: transparent;">IEEE 802.3/802.2</span></td>
<td style="margin: 0px; padding: 4px 10px 4px 5px; border-width: 0px; outline-width: 0px; font-size: 12px; vertical-align: baseline; background-color: transparent;"><span style="margin: 0px; padding: 0px; border-width: 0px; outline-width: 0px; font-size: x-small; vertical-align: baseline; background-color: transparent;">1492</span></td>
</tr>
<tr style="margin: 0px; padding: 0px; border-width: 0px; outline-width: 0px; font-size: 12px; vertical-align: baseline; background-color: transparent;">
<td style="margin: 0px; padding: 4px 10px 4px 5px; border-width: 0px; outline-width: 0px; font-size: 12px; vertical-align: baseline; background-color: transparent;"><span style="margin: 0px; padding: 0px; border-width: 0px; outline-width: 0px; font-size: x-small; vertical-align: baseline; background-color: transparent;">X.25</span></td>
<td style="margin: 0px; padding: 4px 10px 4px 5px; border-width: 0px; outline-width: 0px; font-size: 12px; vertical-align: baseline; background-color: transparent;"><span style="margin: 0px; padding: 0px; border-width: 0px; outline-width: 0px; font-size: x-small; vertical-align: baseline; background-color: transparent;">576</span></td>
</tr>
</tbody>
</table>
<p style="margin: 0px 0px 10px; padding: 0px; border-width: 0px; outline-width: 0px; font-size: 12px; vertical-align: baseline; background-color: transparent;">To change the MTU of an interface on GNU/Linux, you just need to use ifconfig command to do so, like this for example</p>
<blockquote style="margin: 0px; padding: 10px 20px; border: 1px dashed #666666; outline-width: 0px; font-size: 12px; vertical-align: baseline; background-color: transparent; quotes: none;">
<p style="margin: 0px 0px 10px; padding: 0px; border-width: 0px; outline-width: 0px; font-size: 12px; vertical-align: baseline; background-color: transparent;">sudo ifconfig eth0 mtu 1492</p>
</blockquote>
<p style="margin: 0px 0px 10px; padding: 0px; border-width: 0px; outline-width: 0px; font-size: 12px; vertical-align: baseline; background-color: transparent;">To change it permanently on Debian, put it in the /etc/network/interfaces file .where almost all network parameters are found. To do this, just add a line mtu to the definition of your interface and save the file.</p>
<blockquote style="margin: 0px; padding: 10px 20px; border: 1px dashed #666666; outline-width: 0px; font-size: 12px; vertical-align: baseline; background-color: transparent; quotes: none;">
<p style="margin: 0px 0px 10px; padding: 0px; border-width: 0px; outline-width: 0px; font-size: 12px; vertical-align: baseline; background-color: transparent;">sudo gedit /etc/network/interfaces</p>
</blockquote>
<p style="margin: 0px 0px 10px; padding: 0px; border-width: 0px; outline-width: 0px; font-size: 12px; vertical-align: baseline; background-color: transparent;"><strong style="margin: 0px; padding: 0px; border-width: 0px; outline-width: 0px; font-size: 12px; vertical-align: baseline; background-color: transparent; font-weight: 600;">Example</strong></p>
<p style="margin: 0px 0px 10px; padding: 0px; border-width: 0px; outline-width: 0px; font-size: 12px; vertical-align: baseline; background-color: transparent; text-indent: 20px;">iface eth0 inet static<br />
address 192.168.0.1<br />
network 192.168.0.0<br />
gateway 192.168.0.254<br />
netmask 255.255.255.0<br />
mtu 1492</p>
<p style="margin: 0px 0px 10px; padding: 0px; border-width: 0px; outline-width: 0px; font-size: 12px; vertical-align: baseline; background-color: transparent; text-indent: 20px;"><strong style="margin: 0px; padding: 0px; border-width: 0px; outline-width: 0px; font-size: 12px; vertical-align: baseline; background-color: transparent; font-weight: 600;">Daiup Users</strong></p>
<p style="margin: 0px 0px 10px; padding: 0px; border-width: 0px; outline-width: 0px; font-size: 12px; vertical-align: baseline; background-color: transparent; text-indent: 20px;">For dialup users: the Maximum Transmission Unit (MTU) value can be changed within the file<br />
/etc/ppp/options</p>
<p></span></span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.aionsolution.com/blog/linux/vmware-guest-cannot-browse-internet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Replacing A Failed Hard Drive In A Software RAID1/5 Array</title>
		<link>http://www.aionsolution.com/blog/linux/replacing-a-failed-hard-drive-in-a-software-raid15-array/</link>
		<comments>http://www.aionsolution.com/blog/linux/replacing-a-failed-hard-drive-in-a-software-raid15-array/#comments</comments>
		<pubDate>Thu, 12 Nov 2009 01:05:20 +0000</pubDate>
		<dc:creator>aionman</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.aionsolution.com/blog/?p=238</guid>
		<description><![CDATA[Replacing A Failed Hard Drive In A Software RAID1 Array Version 1.0 Author: Falko Timme &#60;ft [at] falkotimme [dot] com&#62; Last edited 01/21/2007 This guide shows how to remove a failed hard drive from a Linux RAID1/5 array (software RAID), and how to add a new hard disk to the RAID1/5 array without losing data. [...]]]></description>
			<content:encoded><![CDATA[<p><span class="Apple-style-span" style="background-color: #ffffff; border-collapse: separate; color: #000000; font-family: Arial; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; font-size: medium;"><span class="Apple-style-span" style="border-collapse: collapse; font-family: verdana,sans-serif; font-size: 12px; line-height: 18px;"></p>
<h2 style="border-bottom: 1px solid #cccccc; margin: 1em 0px 0.2em; padding: 0px 0px 0.1em; font-family: arial,verdana,sans-serif; font-weight: normal; font-size: 19px; color: #000000;">Replacing A Failed Hard Drive In A Software RAID1 Array</h2>
<p style="margin: 0px 0px 0.8em; padding: 0px;">Version 1.0<span class="Apple-converted-space"> </span><br style="margin: 0px; padding: 0px;" />Author: Falko Timme &lt;ft [at] falkotimme [dot] com&gt;<span class="Apple-converted-space"> </span><br style="margin: 0px; padding: 0px;" />Last edited 01/21/2007</p>
<p style="margin: 0px 0px 0.8em; padding: 0px;">This guide shows how to remove a failed hard drive from a Linux RAID1/5 array (software RAID), and how to add a new hard disk to the RAID1/5 array without losing data.</p>
<p style="margin: 0px 0px 0.8em; padding: 0px;">Take RAID1 as an example.</p>
<h3 style="border-bottom: 1px solid #cccccc; margin: 1em 0px 0px; padding: 0px 0px 0.2em; font-family: arial,verdana,sans-serif; font-weight: bold; font-size: 14px;">1 Preliminary Note</h3>
<p style="margin: 0px 0px 0.8em; padding: 0px;">I have two hard drives,<span class="Apple-converted-space"> </span><span class="system" style="margin: 0px; padding: 0px; color: black; font-family: 'Courier New',Courier,mono; font-size: 12px; font-style: italic;">/dev/sda</span><span class="Apple-converted-space"> </span>and<span class="Apple-converted-space"> </span><span class="system" style="margin: 0px; padding: 0px; color: black; font-family: 'Courier New',Courier,mono; font-size: 12px; font-style: italic;">/dev/sdb</span>, with the partitions<span class="Apple-converted-space"> </span><span class="system" style="margin: 0px; padding: 0px; color: black; font-family: 'Courier New',Courier,mono; font-size: 12px; font-style: italic;">/dev/sda1</span><span class="Apple-converted-space"> </span>and<span class="Apple-converted-space"> </span><span class="system" style="margin: 0px; padding: 0px; color: black; font-family: 'Courier New',Courier,mono; font-size: 12px; font-style: italic;">/dev/sda2</span><span class="Apple-converted-space"> </span>as well as<span class="Apple-converted-space"> </span><span class="system" style="margin: 0px; padding: 0px; color: black; font-family: 'Courier New',Courier,mono; font-size: 12px; font-style: italic;">/dev/sdb1</span><span class="Apple-converted-space"> </span>and<span class="Apple-converted-space"> </span><span class="system" style="margin: 0px; padding: 0px; color: black; font-family: 'Courier New',Courier,mono; font-size: 12px; font-style: italic;">/dev/sdb2</span>.</p>
<p style="margin: 0px 0px 0.8em; padding: 0px;"><span class="system" style="margin: 0px; padding: 0px; color: black; font-family: 'Courier New',Courier,mono; font-size: 12px; font-style: italic;">/dev/sda1</span><span class="Apple-converted-space"> </span>and<span class="Apple-converted-space"> </span><span class="system" style="margin: 0px; padding: 0px; color: black; font-family: 'Courier New',Courier,mono; font-size: 12px; font-style: italic;">/dev/sdb1</span><span class="Apple-converted-space"> </span>make up the RAID1 array<span class="Apple-converted-space"> </span><span class="system" style="margin: 0px; padding: 0px; color: black; font-family: 'Courier New',Courier,mono; font-size: 12px; font-style: italic;">/dev/md0</span>.</p>
<p style="margin: 0px 0px 0.8em; padding: 0px;"><span class="system" style="margin: 0px; padding: 0px; color: black; font-family: 'Courier New',Courier,mono; font-size: 12px; font-style: italic;">/dev/sda2</span><span class="Apple-converted-space"> </span>and<span class="Apple-converted-space"> </span><span class="system" style="margin: 0px; padding: 0px; color: black; font-family: 'Courier New',Courier,mono; font-size: 12px; font-style: italic;">/dev/sdb2</span><span class="Apple-converted-space"> </span>make up the RAID1 array<span class="Apple-converted-space"> </span><span class="system" style="margin: 0px; padding: 0px; color: black; font-family: 'Courier New',Courier,mono; font-size: 12px; font-style: italic;">/dev/md1</span>.</p>
<p class="system" style="margin: 0px 0px 0.8em; padding: 0px; color: black; font-family: 'Courier New',Courier,mono; font-size: 12px; font-style: italic;">/dev/sda1 + /dev/sdb1 = /dev/md0</p>
<p class="system" style="margin: 0px 0px 0.8em; padding: 0px; color: black; font-family: 'Courier New',Courier,mono; font-size: 12px; font-style: italic;">/dev/sda2 + /dev/sdb2 = /dev/md1</p>
<p style="margin: 0px 0px 0.8em; padding: 0px;"><span class="system" style="margin: 0px; padding: 0px; color: black; font-family: 'Courier New',Courier,mono; font-size: 12px; font-style: italic;">/dev/sdb</span><span class="Apple-converted-space"> </span>has failed, and we want to replace it.</p>
<p style="margin: 0px 0px 0.8em; padding: 0px;">
<h3 style="border-bottom: 1px solid #cccccc; margin: 1em 0px 0px; padding: 0px 0px 0.2em; font-family: arial,verdana,sans-serif; font-weight: bold; font-size: 14px;">2 How Do I Tell If A Hard Disk Has Failed?</h3>
<p style="margin: 0px 0px 0.8em; padding: 0px;">If a disk has failed, you will probably find a lot of error messages in the log files, e.g.<span class="Apple-converted-space"> </span><span class="system" style="margin: 0px; padding: 0px; color: black; font-family: 'Courier New',Courier,mono; font-size: 12px; font-style: italic;">/var/log/messages</span><span class="Apple-converted-space"> </span>or<span class="Apple-converted-space"> </span><span class="system" style="margin: 0px; padding: 0px; color: black; font-family: 'Courier New',Courier,mono; font-size: 12px; font-style: italic;">/var/log/syslog</span>.</p>
<p style="margin: 0px 0px 0.8em; padding: 0px;">You can also run</p>
<p class="command" style="border: 1px dashed #2f6fab; margin: 0px 0px 0.8em; padding: 1em; color: black; background-color: #f9f9f9; line-height: 1.1em; font-family: 'Courier New',Courier,mono; font-size: 12px; font-style: italic;">cat /proc/mdstat</p>
<p style="margin: 0px 0px 0.8em; padding: 0px;">and instead of the string<span class="Apple-converted-space"> </span><span class="system" style="margin: 0px; padding: 0px; color: black; font-family: 'Courier New',Courier,mono; font-size: 12px; font-style: italic;">[UU]</span><span class="Apple-converted-space"> </span>you will see<span class="Apple-converted-space"> </span><span class="system" style="margin: 0px; padding: 0px; color: black; font-family: 'Courier New',Courier,mono; font-size: 12px; font-style: italic;">[U_]</span><span class="Apple-converted-space"> </span>if you have a degraded RAID1 array.</p>
<p style="margin: 0px 0px 0.8em; padding: 0px;">
<h3 style="border-bottom: 1px solid #cccccc; margin: 1em 0px 0px; padding: 0px 0px 0.2em; font-family: arial,verdana,sans-serif; font-weight: bold; font-size: 14px;">3 Removing The Failed Disk</h3>
<p style="margin: 0px 0px 0.8em; padding: 0px;">To remove<span class="Apple-converted-space"> </span><span class="system" style="margin: 0px; padding: 0px; color: black; font-family: 'Courier New',Courier,mono; font-size: 12px; font-style: italic;">/dev/sdb</span>, we will mark<span class="Apple-converted-space"> </span><span class="system" style="margin: 0px; padding: 0px; color: black; font-family: 'Courier New',Courier,mono; font-size: 12px; font-style: italic;">/dev/sdb1</span><span class="Apple-converted-space"> </span>and<span class="Apple-converted-space"> </span><span class="system" style="margin: 0px; padding: 0px; color: black; font-family: 'Courier New',Courier,mono; font-size: 12px; font-style: italic;">/dev/sdb2</span><span class="Apple-converted-space"> </span>as failed and remove them from their respective RAID arrays (<span class="system" style="margin: 0px; padding: 0px; color: black; font-family: 'Courier New',Courier,mono; font-size: 12px; font-style: italic;">/dev/md0</span><span class="Apple-converted-space"> </span>and<span class="Apple-converted-space"> </span><span class="system" style="margin: 0px; padding: 0px; color: black; font-family: 'Courier New',Courier,mono; font-size: 12px; font-style: italic;">/dev/md1</span>).</p>
<p style="margin: 0px 0px 0.8em; padding: 0px;">First we mark<span class="Apple-converted-space"> </span><span class="system" style="margin: 0px; padding: 0px; color: black; font-family: 'Courier New',Courier,mono; font-size: 12px; font-style: italic;">/dev/sdb1</span><span class="Apple-converted-space"> </span>as failed:</p>
<p class="command" style="border: 1px dashed #2f6fab; margin: 0px 0px 0.8em; padding: 1em; color: black; background-color: #f9f9f9; line-height: 1.1em; font-family: 'Courier New',Courier,mono; font-size: 12px; font-style: italic;">mdadm &#8211;manage /dev/md0 &#8211;fail /dev/sdb1</p>
<p style="margin: 0px 0px 0.8em; padding: 0px;">The output of</p>
<p class="command" style="border: 1px dashed #2f6fab; margin: 0px 0px 0.8em; padding: 1em; color: black; background-color: #f9f9f9; line-height: 1.1em; font-family: 'Courier New',Courier,mono; font-size: 12px; font-style: italic;">cat /proc/mdstat</p>
<p style="margin: 0px 0px 0.8em; padding: 0px;">should look like this:</p>
<p class="system" style="margin: 0px 0px 0.8em; padding: 0px; color: black; font-family: 'Courier New',Courier,mono; font-size: 12px; font-style: italic;">server1:~# cat /proc/mdstat<br style="margin: 0px; padding: 0px;" />Personalities : [linear] [multipath] [raid0] [raid1] [raid5] [raid4] [raid6] [raid10]<br style="margin: 0px; padding: 0px;" />md0 : active raid1 sda1[0] sdb1[2](F)<br style="margin: 0px; padding: 0px;" /> 24418688 blocks [2/1] [U_]<br style="margin: 0px; padding: 0px;" /><br style="margin: 0px; padding: 0px;" />md1 : active raid1 sda2[0] sdb2[1]<br style="margin: 0px; padding: 0px;" /> 24418688 blocks [2/2] [UU]<br style="margin: 0px; padding: 0px;" /><br style="margin: 0px; padding: 0px;" />unused devices: &lt;none&gt;</p>
<p style="margin: 0px 0px 0.8em; padding: 0px;">Then we remove<span class="Apple-converted-space"> </span><span class="system" style="margin: 0px; padding: 0px; color: black; font-family: 'Courier New',Courier,mono; font-size: 12px; font-style: italic;">/dev/sdb1</span><span class="Apple-converted-space"> </span>from<span class="Apple-converted-space"> </span><span class="system" style="margin: 0px; padding: 0px; color: black; font-family: 'Courier New',Courier,mono; font-size: 12px; font-style: italic;">/dev/md0</span>:</p>
<p class="command" style="border: 1px dashed #2f6fab; margin: 0px 0px 0.8em; padding: 1em; color: black; background-color: #f9f9f9; line-height: 1.1em; font-family: 'Courier New',Courier,mono; font-size: 12px; font-style: italic;">mdadm &#8211;manage /dev/md0 &#8211;remove /dev/sdb1</p>
<p style="margin: 0px 0px 0.8em; padding: 0px;">The output should be like this:</p>
<p class="system" style="margin: 0px 0px 0.8em; padding: 0px; color: black; font-family: 'Courier New',Courier,mono; font-size: 12px; font-style: italic;">server1:~# mdadm &#8211;manage /dev/md0 &#8211;remove /dev/sdb1<br style="margin: 0px; padding: 0px;" />mdadm: hot removed /dev/sdb1</p>
<p style="margin: 0px 0px 0.8em; padding: 0px;">And</p>
<p class="command" style="border: 1px dashed #2f6fab; margin: 0px 0px 0.8em; padding: 1em; color: black; background-color: #f9f9f9; line-height: 1.1em; font-family: 'Courier New',Courier,mono; font-size: 12px; font-style: italic;">cat /proc/mdstat</p>
<p style="margin: 0px 0px 0.8em; padding: 0px;">should show this:</p>
<p class="system" style="margin: 0px 0px 0.8em; padding: 0px; color: black; font-family: 'Courier New',Courier,mono; font-size: 12px; font-style: italic;">server1:~# cat /proc/mdstat<br style="margin: 0px; padding: 0px;" />Personalities : [linear] [multipath] [raid0] [raid1] [raid5] [raid4] [raid6] [raid10]<br style="margin: 0px; padding: 0px;" />md0 : active raid1 sda1[0]<br style="margin: 0px; padding: 0px;" /> 24418688 blocks [2/1] [U_]<br style="margin: 0px; padding: 0px;" /><br style="margin: 0px; padding: 0px;" />md1 : active raid1 sda2[0] sdb2[1]<br style="margin: 0px; padding: 0px;" /> 24418688 blocks [2/2] [UU]<br style="margin: 0px; padding: 0px;" /><br style="margin: 0px; padding: 0px;" />unused devices: &lt;none&gt;</p>
<p style="margin: 0px 0px 0.8em; padding: 0px;">Now we do the same steps again for<span class="Apple-converted-space"> </span><span class="system" style="margin: 0px; padding: 0px; color: black; font-family: 'Courier New',Courier,mono; font-size: 12px; font-style: italic;">/dev/sdb2</span><span class="Apple-converted-space"> </span>(which is part of<span class="Apple-converted-space"> </span><span class="system" style="margin: 0px; padding: 0px; color: black; font-family: 'Courier New',Courier,mono; font-size: 12px; font-style: italic;">/dev/md1</span>):</p>
<p class="command" style="border: 1px dashed #2f6fab; margin: 0px 0px 0.8em; padding: 1em; color: black; background-color: #f9f9f9; line-height: 1.1em; font-family: 'Courier New',Courier,mono; font-size: 12px; font-style: italic;">mdadm &#8211;manage /dev/md1 &#8211;fail /dev/sdb2</p>
<p class="command" style="border: 1px dashed #2f6fab; margin: 0px 0px 0.8em; padding: 1em; color: black; background-color: #f9f9f9; line-height: 1.1em; font-family: 'Courier New',Courier,mono; font-size: 12px; font-style: italic;">cat /proc/mdstat</p>
<p class="system" style="margin: 0px 0px 0.8em; padding: 0px; color: black; font-family: 'Courier New',Courier,mono; font-size: 12px; font-style: italic;">server1:~# cat /proc/mdstat<br style="margin: 0px; padding: 0px;" />Personalities : [linear] [multipath] [raid0] [raid1] [raid5] [raid4] [raid6] [raid10]<br style="margin: 0px; padding: 0px;" />md0 : active raid1 sda1[0]<br style="margin: 0px; padding: 0px;" /> 24418688 blocks [2/1] [U_]<br style="margin: 0px; padding: 0px;" /><br style="margin: 0px; padding: 0px;" />md1 : active raid1 sda2[0] sdb2[2](F)<br style="margin: 0px; padding: 0px;" /> 24418688 blocks [2/1] [U_]<br style="margin: 0px; padding: 0px;" /><br style="margin: 0px; padding: 0px;" />unused devices: &lt;none&gt;</p>
<div id="adrectangleb" style="border-width: 0px; margin: 0px; padding: 0px; height: 250px;">
<div id="defer-adrectangleb" style="border-width: 0px; margin: 0px; padding: 0px;">
<div style="border-width: 0px; margin: 0px; padding: 0px;"><a style="margin: 0px; padding: 0px; color: #003399; text-decoration: underline;" href="http://ad.doubleclick.net/click;h=v8/38e3/0/0/%2a/d;44306;0-0;0;39511760;4307-300/250;0/0/0;u=idgt-32375414_1257987117,1129898e4009900,none,idgt.apple_L;~aopt=2/1/53/0;~sscs=%3f" target="_blank"><img style="border-width: 0px; margin: 0px; padding: 0px;" src="http://static.2mdn.net/viewad/817-grey.gif" border="0" alt="Click here to find out more!" /></a></div>
</div>
</div>
<p class="command" style="border: 1px dashed #2f6fab; margin: 0px 0px 0.8em; padding: 1em; color: black; background-color: #f9f9f9; line-height: 1.1em; font-family: 'Courier New',Courier,mono; font-size: 12px; font-style: italic;">mdadm &#8211;manage /dev/md1 &#8211;remove /dev/sdb2</p>
<p class="system" style="margin: 0px 0px 0.8em; padding: 0px; color: black; font-family: 'Courier New',Courier,mono; font-size: 12px; font-style: italic;">server1:~# mdadm &#8211;manage /dev/md1 &#8211;remove /dev/sdb2<br style="margin: 0px; padding: 0px;" />mdadm: hot removed /dev/sdb2</p>
<p class="command" style="border: 1px dashed #2f6fab; margin: 0px 0px 0.8em; padding: 1em; color: black; background-color: #f9f9f9; line-height: 1.1em; font-family: 'Courier New',Courier,mono; font-size: 12px; font-style: italic;">cat /proc/mdstat</p>
<p class="system" style="margin: 0px 0px 0.8em; padding: 0px; color: black; font-family: 'Courier New',Courier,mono; font-size: 12px; font-style: italic;">server1:~# cat /proc/mdstat<br style="margin: 0px; padding: 0px;" />Personalities : [linear] [multipath] [raid0] [raid1] [raid5] [raid4] [raid6] [raid10]<br style="margin: 0px; padding: 0px;" />md0 : active raid1 sda1[0]<br style="margin: 0px; padding: 0px;" /> 24418688 blocks [2/1] [U_]<br style="margin: 0px; padding: 0px;" /><br style="margin: 0px; padding: 0px;" />md1 : active raid1 sda2[0]<br style="margin: 0px; padding: 0px;" /> 24418688 blocks [2/1] [U_]<br style="margin: 0px; padding: 0px;" /><br style="margin: 0px; padding: 0px;" />unused devices: &lt;none&gt;</p>
<p style="margin: 0px 0px 0.8em; padding: 0px;">Then power down the system:</p>
<p class="command" style="border: 1px dashed #2f6fab; margin: 0px 0px 0.8em; padding: 1em; color: black; background-color: #f9f9f9; line-height: 1.1em; font-family: 'Courier New',Courier,mono; font-size: 12px; font-style: italic;">shutdown -h now</p>
<p style="margin: 0px 0px 0.8em; padding: 0px;">and replace the old<span class="Apple-converted-space"> </span><span class="system" style="margin: 0px; padding: 0px; color: black; font-family: 'Courier New',Courier,mono; font-size: 12px; font-style: italic;">/dev/sdb</span><span class="Apple-converted-space"> </span>hard drive with a new one (<span class="highlight" style="margin: 0px; padding: 0px; color: #ff0000; font-family: Georgia,'Times New Roman',Times,serif; font-size: 12px; text-decoration: underline;">it must have at least the same size as the old one &#8211; if it&#8217;s only a few MB smaller than the old one then rebuilding the arrays will fail</span>).</p>
<p style="margin: 0px 0px 0.8em; padding: 0px;">
<h3 style="border-bottom: 1px solid #cccccc; margin: 1em 0px 0px; padding: 0px 0px 0.2em; font-family: arial,verdana,sans-serif; font-weight: bold; font-size: 14px;">4 Adding The New Hard Disk</h3>
<p style="margin: 0px 0px 0.8em; padding: 0px;">After you have changed the hard disk<span class="Apple-converted-space"> </span><span class="system" style="margin: 0px; padding: 0px; color: black; font-family: 'Courier New',Courier,mono; font-size: 12px; font-style: italic;">/dev/sdb</span>, boot the system.</p>
<p style="margin: 0px 0px 0.8em; padding: 0px;">The first thing we must do now is to create the exact same partitioning as on<span class="Apple-converted-space"> </span><span class="system" style="margin: 0px; padding: 0px; color: black; font-family: 'Courier New',Courier,mono; font-size: 12px; font-style: italic;">/dev/sda</span>. We can do this with one simple command:</p>
<p class="command" style="border: 1px dashed #2f6fab; margin: 0px 0px 0.8em; padding: 1em; color: black; background-color: #f9f9f9; line-height: 1.1em; font-family: 'Courier New',Courier,mono; font-size: 12px; font-style: italic;">sfdisk -d /dev/sda | sfdisk /dev/sdb</p>
<p style="margin: 0px 0px 0.8em; padding: 0px;">You can run</p>
<p class="command" style="border: 1px dashed #2f6fab; margin: 0px 0px 0.8em; padding: 1em; color: black; background-color: #f9f9f9; line-height: 1.1em; font-family: 'Courier New',Courier,mono; font-size: 12px; font-style: italic;">fdisk -l</p>
<p style="margin: 0px 0px 0.8em; padding: 0px;">to check if both hard drives have the same partitioning now.</p>
<p style="margin: 0px 0px 0.8em; padding: 0px;">Next we add<span class="Apple-converted-space"> </span><span class="system" style="margin: 0px; padding: 0px; color: black; font-family: 'Courier New',Courier,mono; font-size: 12px; font-style: italic;">/dev/sdb1</span><span class="Apple-converted-space"> </span>to<span class="Apple-converted-space"> </span><span class="system" style="margin: 0px; padding: 0px; color: black; font-family: 'Courier New',Courier,mono; font-size: 12px; font-style: italic;">/dev/md0</span><span class="Apple-converted-space"> </span>and<span class="Apple-converted-space"> </span><span class="system" style="margin: 0px; padding: 0px; color: black; font-family: 'Courier New',Courier,mono; font-size: 12px; font-style: italic;">/dev/sdb2</span><span class="Apple-converted-space"> </span>to<span class="Apple-converted-space"> </span><span class="system" style="margin: 0px; padding: 0px; color: black; font-family: 'Courier New',Courier,mono; font-size: 12px; font-style: italic;">/dev/md1</span>:</p>
<p class="command" style="border: 1px dashed #2f6fab; margin: 0px 0px 0.8em; padding: 1em; color: black; background-color: #f9f9f9; line-height: 1.1em; font-family: 'Courier New',Courier,mono; font-size: 12px; font-style: italic;">mdadm &#8211;manage /dev/md0 &#8211;add /dev/sdb1</p>
<p class="system" style="margin: 0px 0px 0.8em; padding: 0px; color: black; font-family: 'Courier New',Courier,mono; font-size: 12px; font-style: italic;">server1:~# mdadm &#8211;manage /dev/md0 &#8211;add /dev/sdb1<br style="margin: 0px; padding: 0px;" />mdadm: re-added /dev/sdb1</p>
<p class="command" style="border: 1px dashed #2f6fab; margin: 0px 0px 0.8em; padding: 1em; color: black; background-color: #f9f9f9; line-height: 1.1em; font-family: 'Courier New',Courier,mono; font-size: 12px; font-style: italic;">mdadm &#8211;manage /dev/md1 &#8211;add /dev/sdb2</p>
<p class="system" style="margin: 0px 0px 0.8em; padding: 0px; color: black; font-family: 'Courier New',Courier,mono; font-size: 12px; font-style: italic;">server1:~# mdadm &#8211;manage /dev/md1 &#8211;add /dev/sdb2<br style="margin: 0px; padding: 0px;" />mdadm: re-added /dev/sdb2</p>
<p style="margin: 0px 0px 0.8em; padding: 0px;">Now both arays (<span class="system" style="margin: 0px; padding: 0px; color: black; font-family: 'Courier New',Courier,mono; font-size: 12px; font-style: italic;">/dev/md0</span><span class="Apple-converted-space"> </span>and<span class="Apple-converted-space"> </span><span class="system" style="margin: 0px; padding: 0px; color: black; font-family: 'Courier New',Courier,mono; font-size: 12px; font-style: italic;">/dev/md1</span>) will be synchronized. Run</p>
<p class="command" style="border: 1px dashed #2f6fab; margin: 0px 0px 0.8em; padding: 1em; color: black; background-color: #f9f9f9; line-height: 1.1em; font-family: 'Courier New',Courier,mono; font-size: 12px; font-style: italic;">cat /proc/mdstat</p>
<p style="margin: 0px 0px 0.8em; padding: 0px;">to see when it&#8217;s finished.</p>
<p style="margin: 0px 0px 0.8em; padding: 0px;">During the synchronization the output will look like this:</p>
<p class="system" style="margin: 0px 0px 0.8em; padding: 0px; color: black; font-family: 'Courier New',Courier,mono; font-size: 12px; font-style: italic;">server1:~# cat /proc/mdstat<br style="margin: 0px; padding: 0px;" />Personalities : [linear] [multipath] [raid0] [raid1] [raid5] [raid4] [raid6] [raid10]<br style="margin: 0px; padding: 0px;" />md0 : active raid1 sda1[0] sdb1[1]<br style="margin: 0px; padding: 0px;" /> 24418688 blocks [2/1] [U_]<br style="margin: 0px; padding: 0px;" /> [=&gt;...................]  recovery =  9.9% (2423168/24418688) finish=2.8min speed=127535K/sec<br style="margin: 0px; padding: 0px;" /><br style="margin: 0px; padding: 0px;" />md1 : active raid1 sda2[0] sdb2[1]<br style="margin: 0px; padding: 0px;" /> 24418688 blocks [2/1] [U_]<br style="margin: 0px; padding: 0px;" /> [=&gt;...................]  recovery =  6.4% (1572096/24418688) finish=1.9min speed=196512K/sec<br style="margin: 0px; padding: 0px;" /><br style="margin: 0px; padding: 0px;" />unused devices: &lt;none&gt;</p>
<p style="margin: 0px 0px 0.8em; padding: 0px;">When the synchronization is finished, the output will look like this:</p>
<p class="system" style="margin: 0px 0px 0.8em; padding: 0px; color: black; font-family: 'Courier New',Courier,mono; font-size: 12px; font-style: italic;">server1:~# cat /proc/mdstat<br style="margin: 0px; padding: 0px;" />Personalities : [linear] [multipath] [raid0] [raid1] [raid5] [raid4] [raid6] [raid10]<br style="margin: 0px; padding: 0px;" />md0 : active raid1 sda1[0] sdb1[1]<br style="margin: 0px; padding: 0px;" /> 24418688 blocks [2/2] [UU]<br style="margin: 0px; padding: 0px;" /><br style="margin: 0px; padding: 0px;" />md1 : active raid1 sda2[0] sdb2[1]<br style="margin: 0px; padding: 0px;" /> 24418688 blocks [2/2] [UU]<br style="margin: 0px; padding: 0px;" /><br style="margin: 0px; padding: 0px;" />unused devices: &lt;none&gt;</p>
<p style="margin: 0px 0px 0.8em; padding: 0px;">That&#8217;s it, you have successfully replaced<span class="Apple-converted-space"> </span><span class="system" style="margin: 0px; padding: 0px; color: black; font-family: 'Courier New',Courier,mono; font-size: 12px; font-style: italic;">/dev/sdb</span>!</p>
<p></span></span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.aionsolution.com/blog/linux/replacing-a-failed-hard-drive-in-a-software-raid15-array/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How To Install VMware Server On A CentOS 5</title>
		<link>http://www.aionsolution.com/blog/linux/how-to-install-vmware-server-on-a-centos-5/</link>
		<comments>http://www.aionsolution.com/blog/linux/how-to-install-vmware-server-on-a-centos-5/#comments</comments>
		<pubDate>Fri, 14 Aug 2009 03:12:49 +0000</pubDate>
		<dc:creator>aionman</dc:creator>
				<category><![CDATA[CentOS]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.aionsolution.com/blog/?p=186</guid>
		<description><![CDATA[How To Install VMware Server On A CentOS 5.0 Desktop This tutorial provides step-by-step instructions on how to install VMware Server on a CentOS 5.0 desktop system. With VMware Server you can create and run guest operating systems (&#8220;virtual machines&#8221;) such as Linux, Windows, FreeBSD, etc. under a host operating system. This has the benefit that [...]]]></description>
			<content:encoded><![CDATA[<h2>How To Install VMware Server On A CentOS 5.0 Desktop</h2>
<p>This tutorial provides step-by-step instructions on how to install <a href="http://www.vmware.com/download/server/" target="_blank">VMware Server</a> on a CentOS 5.0 desktop system. With VMware Server you can create and run guest operating systems (&#8220;virtual machines&#8221;) such as Linux, Windows, FreeBSD, etc. under a host operating system. This has the benefit that you can run multiple operating systems on the same hardware which saves a lot of money, and you can move virtual machines from one VMware Server to the next one (or to a system that has the VMware Player which is also free).</p>
<p>Also, with VMware Server <a href="http://www.vmware.com/download/server/" target="_blank"></a>you can let your old Windows desktop (that you previously converted into a VMware virtual machine with <a href="http://www.vmware.com/products/converter/" target="_blank">VMware Converter</a>, as described in this tutorial:<a href="http://www.howtoforge.com/vmware_converter_windows_linux" target="_blank">http://www.howtoforge.com/vmware_converter_windows_linux</a>) run under your CentOS desktop. This can be useful if you depend on some applications that exist for Windows only, or if you want to switch to Linux slowly.</p>
<p>I want to say first that this is not the only way of setting up such a system. There are many ways of achieving this goal but this is the way I take. I do not issue any guarantee that this will work for you!</p>
<h3>1 Find Out Your Kernel Version</h3>
<p>Before we go on and install additional software, it&#8217;s a good idea to find out about your kernel version because in chapter 2 we will install the package <span class="system">kernel-devel</span> which is needed by VMware Server. There are multiple <span class="system">kernel-devel</span> packages available, and to select the right one you need to know your kernel version.</p>
<p>To find out about your kernel version, open a terminal (<span class="system">Applications &gt; Accessories &gt; Terminal</span>):</p>
<p><img src="http://www.aionsolution.com/blog/wp-content/uploads/2009/08/19.png" alt="" width="550" height="413" /></p>
<p>Then become root by running:</p>
<p class="command">su</p>
<p>Then run</p>
<p class="command">uname -r</p>
<p>The output should look like this:</p>
<p class="system">[root@localhost Desktop]# uname -r<br />
2.6.18-8.1.3.el5</p>
<p>which means you have kernel <span class="system">2.6.18-8.1.3.el5</span> installled.</p>
<h3>2 Installing Required Packages</h3>
<p>Before we install VMware Server, we must install some prerequisites. To install them, go to <span class="system">Applications &gt; Add/Remove Software</span>:</p>
<p><img src="http://www.aionsolution.com/blog/wp-content/uploads/2009/08/1.png" alt="" width="550" height="413" /></p>
<p>Type in the root password:</p>
<p><img src="http://www.aionsolution.com/blog/wp-content/uploads/2009/08/2.png" alt="" width="550" height="413" /></p>
<p>The Package Manager opens. Go to the <span class="system">Browse</span> tab and select:</p>
<ul>
<li class="system">Development &gt; Development Libraries</li>
<li class="system">Development &gt; Development Tools</li>
</ul>
<p><img src="http://www.aionsolution.com/blog/wp-content/uploads/2009/08/3.png" alt="" width="550" height="413" /></p>
<p>Then go to the <span class="system">Search</span> tab and search for <span class="system">xinetd</span>. Select the <span class="system">xinetd</span> package for installation:</p>
<p><img src="http://www.aionsolution.com/blog/wp-content/uploads/2009/08/4.png" alt="" width="550" height="413" /></p>
<p>Do the same for the <span class="system">kernel-devel</span> package. <span class="highlight">Please make sure you select the kernel-devel package that corresponds to your current kernel (so if you kernel is 2.6.18-8.1.3.el5, select the kernel-devel &#8211; 2.6.18-8.1.3.el5.i686 package).</span></p>
<p><img src="http://www.aionsolution.com/blog/wp-content/uploads/2009/08/5.png" alt="" width="550" height="413" /></p>
<p>Click on <span class="system">Apply</span> afterwards.</p>
<p>The Package Manager will then resolve all dependencies, download the packages, maybe ask you to accept some unknown software keys (please accept them), and finally install the packages.</p>
<h3>3 VMware Server</h3>
<p>To download VMware Server, go to <a href="http://www.vmware.com/download/server/" target="_blank">http://www.vmware.com/download/server/</a> and click on <span class="system">Download Now</span>:</p>
<p><img src="http://www.aionsolution.com/blog/wp-content/uploads/2009/08/12.png" alt="" width="550" height="413" /></p>
<p>Accept the license agreement by clicking on <span class="system">Yes</span>:</p>
<p><img src="http://www.aionsolution.com/blog/wp-content/uploads/2009/08/13.png" alt="" width="550" height="413" /></p>
<p>Then download the VMware Server for Linux <span class="highlight">.tar.gz</span> file (not the rpm file!) to your desktop (e.g. to <span class="system">/home/falko/Desktop)</span>:</p>
<p><img src="http://www.aionsolution.com/blog/wp-content/uploads/2009/08/14.png" alt="" width="550" height="413" /></p>
<p><img src="http://www.aionsolution.com/blog/wp-content/uploads/2009/08/15.png" alt="" width="550" height="413" /></p>
<p><img src="http://www.aionsolution.com/blog/wp-content/uploads/2009/08/16.png" alt="" width="550" height="413" /></p>
<p>To get the serial number you need to run VMware Server, go to <a href="http://register.vmware.com/content/registration.html" target="_blank">http://register.vmware.com/content/registration.html</a>. Fill in your personal details. Afterwards you will get a page with a serial number for VMware Server. Write it down or print it out:</p>
<p><img src="http://www.aionsolution.com/blog/wp-content/uploads/2009/08/17.png" alt="" width="550" height="413" /></p>
<p><img src="http://www.aionsolution.com/blog/wp-content/uploads/2009/08/18.png" alt="" width="550" height="413" /></p>
<p>To install VMware Server, open a terminal (<span class="system">Applications &gt; Accessories &gt; Terminal</span>) and become root:</p>
<p class="command">su</p>
<p>Then go to the location where you saved the VMware Server .tar.gz file, e.g. <span class="system">/home/falko/Desktop</span> (replace <span class="system">falko</span> with your own username!):</p>
<p class="command">cd /home/falko/Desktop</p>
<p>Unpack the VMware Server .tar.gz file and run the installer:</p>
<p class="command">tar xvfz VMware-server-*.tar.gz<br />
cd vmware-server-distrib<br />
./vmware-install.pl</p>
<p>The installer will ask you a lot of questions. You can always accept the default values simply by hitting <span class="system">&lt;ENTER&gt;</span>. When it asks you</p>
<p class="system">In which directory do you want to keep your virtual machine files?<br />
[/var/lib/vmware/Virtual Machines]</p>
<p>you can accept the default value or specify a different location where you have more free disk space, e.g. like <span class="system">/home/falko/virtual_machines</span>, but this is up to you and not necessary.</p>
<p>At the end of the installation, you will be asked to enter a serial number:</p>
<p class="system">Please enter your 20-character serial number.</p>
<p class="system">Type XXXXX-XXXXX-XXXXX-XXXXX or &#8216;Enter&#8217; to cancel:</p>
<p>Fill in your serial number for VMware Server.</p>
<p>After the successful installation, you can delete the VMware Server download file and the installation directory:</p>
<p class="command">cd ../<br />
rm -f VMware-server*<br />
rm -fr vmware-server-distrib/</p>
<p>You will now find VMware Server under <span class="system">Applications &gt; System Tools</span>:</p>
<p><img src="http://www.aionsolution.com/blog/wp-content/uploads/2009/08/20.png" alt="" width="550" height="413" /></p>
<p>When you start it, select <span class="system">Local host</span>:</p>
<p><strong>With VMware 2.0 The most noticeable change is that the vmware server console is … gone.</strong></p>
<p><img src="http://www.aionsolution.com/blog/wp-content/uploads/2009/08/21.png" alt="" width="550" height="413" /></p>
<p>Afterwards, you can create virtual machines (or import your virtual Windows machine that you created with <a href="http://www.vmware.com/products/converter/" target="_blank">VMware Converter</a>):</p>
<p><a href="http://www.aionsolution.com/blog/wp-content/uploads/2009/08/22.png"><img class="alignnone size-full wp-image-208" title="22" src="http://www.aionsolution.com/blog/wp-content/uploads/2009/08/22.png" alt="22" width="550" height="413" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.aionsolution.com/blog/linux/how-to-install-vmware-server-on-a-centos-5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Replacing A Failed Hard Drive In A Software RAID1 Array</title>
		<link>http://www.aionsolution.com/blog/linux/replacing-a-failed-hard-drive-in-a-software-raid1-array/</link>
		<comments>http://www.aionsolution.com/blog/linux/replacing-a-failed-hard-drive-in-a-software-raid1-array/#comments</comments>
		<pubDate>Tue, 04 Aug 2009 05:22:09 +0000</pubDate>
		<dc:creator>aionman</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[RAID]]></category>
		<category><![CDATA[Rebuild RAID]]></category>

		<guid isPermaLink="false">http://www.aionsolution.com/blog/?p=162</guid>
		<description><![CDATA[This guide shows how to remove a failed hard drive from a Linux RAID1 array (software RAID), and how to add a new hard disk to the RAID1 array without losing data. I do not issue any guarantee that this will work for you! 1 Preliminary Note In this example I have two hard drives, /dev/sda [...]]]></description>
			<content:encoded><![CDATA[<h2><span style="font-weight: normal; font-size: 13px;">This guide shows how to remove a failed hard drive from a Linux RAID1 array (software RAID), and how to add a new hard disk to the RAID1 array without losing data.</span></h2>
<p>I do not issue any guarantee that this will work for you!</p>
<h3>1 Preliminary Note</h3>
<p>In this example I have two hard drives, <span class="system">/dev/sda</span> and <span class="system">/dev/sdb</span>, with the partitions <span class="system">/dev/sda1</span> and <span class="system">/dev/sda2</span> as well as <span class="system">/dev/sdb1</span> and <span class="system">/dev/sdb2</span>.</p>
<p><span class="system">/dev/sda1</span> and <span class="system">/dev/sdb1</span> make up the RAID1 array <span class="system">/dev/md0</span>.</p>
<p><span class="system">/dev/sda2</span> and <span class="system">/dev/sdb2</span> make up the RAID1 array <span class="system">/dev/md1</span>.</p>
<p class="system">/dev/sda1 + /dev/sdb1 = /dev/md0</p>
<p class="system">/dev/sda2 + /dev/sdb2 = /dev/md1</p>
<p><span class="system">/dev/sdb</span> has failed, and we want to replace it.</p>
<h3>2 How Do I Tell If A Hard Disk Has Failed?</h3>
<p>If a disk has failed, you will probably find a lot of error messages in the log files, e.g. <span class="system">/var/log/messages</span> or <span class="system">/var/log/syslog</span>.</p>
<p>You can also run</p>
<p class="command">cat /proc/mdstat</p>
<p>and instead of the string <span class="system">[UU]</span> you will see <span class="system">[U_]</span> if you have a degraded RAID1 array.</p>
<h3>3 Removing The Failed Disk</h3>
<p>To remove <span class="system">/dev/sdb</span>, we will mark <span class="system">/dev/sdb1</span> and <span class="system">/dev/sdb2</span> as failed and remove them from their respective RAID arrays (<span class="system">/dev/md0</span> and <span class="system">/dev/md1</span>).</p>
<p>First we mark <span class="system">/dev/sdb1</span> as failed:</p>
<p class="command">mdadm &#8211;manage /dev/md0 &#8211;fail /dev/sdb1</p>
<p>The output of</p>
<p class="command">cat /proc/mdstat</p>
<p>should look like this:</p>
<p class="system">server1:~# cat /proc/mdstat<br />
Personalities : [linear] [multipath] [raid0] [raid1] [raid5] [raid4] [raid6] [raid10]<br />
md0 : active raid1 sda1[0] sdb1[2](F)<br />
24418688 blocks [2/1] [U_]</p>
<p>md1 : active raid1 sda2[0] sdb2[1]<br />
24418688 blocks [2/2] [UU]</p>
<p>unused devices: &lt;none&gt;</p>
<p>Then we remove <span class="system">/dev/sdb1</span> from <span class="system">/dev/md0</span>:</p>
<p class="command">mdadm &#8211;manage /dev/md0 &#8211;remove /dev/sdb1</p>
<p>The output should be like this:</p>
<p class="system">server1:~# mdadm &#8211;manage /dev/md0 &#8211;remove /dev/sdb1<br />
mdadm: hot removed /dev/sdb1</p>
<p>And</p>
<p class="command">cat /proc/mdstat</p>
<p>should show this:</p>
<p class="system">server1:~# cat /proc/mdstat<br />
Personalities : [linear] [multipath] [raid0] [raid1] [raid5] [raid4] [raid6] [raid10]<br />
md0 : active raid1 sda1[0]<br />
24418688 blocks [2/1] [U_]</p>
<p>md1 : active raid1 sda2[0] sdb2[1]<br />
24418688 blocks [2/2] [UU]</p>
<p>unused devices: &lt;none&gt;</p>
<p>Now we do the same steps again for <span class="system">/dev/sdb2</span> (which is part of <span class="system">/dev/md1</span>):</p>
<p class="command">mdadm &#8211;manage /dev/md1 &#8211;fail /dev/sdb2</p>
<p class="command">cat /proc/mdstat</p>
<p class="system">server1:~# cat /proc/mdstat<br />
Personalities : [linear] [multipath] [raid0] [raid1] [raid5] [raid4] [raid6] [raid10]<br />
md0 : active raid1 sda1[0]<br />
24418688 blocks [2/1] [U_]</p>
<p>md1 : active raid1 sda2[0] sdb2[2](F)<br />
24418688 blocks [2/1] [U_]</p>
<p>unused devices: &lt;none&gt;</p>
<div id="adrectangleb">
<div id="defer-adrectangleb">
<div>mdadm &#8211;manage /dev/md1 &#8211;remove /dev/sdb2</div>
</div>
</div>
<p class="system">server1:~# mdadm &#8211;manage /dev/md1 &#8211;remove /dev/sdb2<br />
mdadm: hot removed /dev/sdb2</p>
<p class="command">cat /proc/mdstat</p>
<p class="system">server1:~# cat /proc/mdstat<br />
Personalities : [linear] [multipath] [raid0] [raid1] [raid5] [raid4] [raid6] [raid10]<br />
md0 : active raid1 sda1[0]<br />
24418688 blocks [2/1] [U_]</p>
<p>md1 : active raid1 sda2[0]<br />
24418688 blocks [2/1] [U_]</p>
<p>unused devices: &lt;none&gt;</p>
<p>Then power down the system:</p>
<p class="command">shutdown -h now</p>
<p>and replace the old <span class="system">/dev/sdb</span> hard drive with a new one (<span class="highlight">it must have at least the same size as the old one &#8211; if it&#8217;s only a few MB smaller than the old one then rebuilding the arrays will fail</span>).</p>
<h3>4 Adding The New Hard Disk</h3>
<p>After you have changed the hard disk <span class="system">/dev/sdb</span>, boot the system.</p>
<p>The first thing we must do now is to create the exact same partitioning as on <span class="system">/dev/sda</span>. We can do this with one simple command:</p>
<p class="command">sfdisk -d /dev/sda | sfdisk /dev/sdb</p>
<p>You can run</p>
<p class="command">fdisk -l</p>
<p>to check if both hard drives have the same partitioning now.</p>
<p>Next we add <span class="system">/dev/sdb1</span> to <span class="system">/dev/md0</span> and <span class="system">/dev/sdb2</span> to <span class="system">/dev/md1</span>:</p>
<p class="command">mdadm &#8211;manage /dev/md0 &#8211;add /dev/sdb1</p>
<p class="system">server1:~# mdadm &#8211;manage /dev/md0 &#8211;add /dev/sdb1<br />
mdadm: re-added /dev/sdb1</p>
<p class="command">mdadm &#8211;manage /dev/md1 &#8211;add /dev/sdb2</p>
<p class="system">server1:~# mdadm &#8211;manage /dev/md1 &#8211;add /dev/sdb2<br />
mdadm: re-added /dev/sdb2</p>
<p>Now both arays (<span class="system">/dev/md0</span> and <span class="system">/dev/md1</span>) will be synchronized. Run</p>
<p class="command">cat /proc/mdstat</p>
<p>to see when it&#8217;s finished.</p>
<p>During the synchronization the output will look like this:</p>
<p class="system">server1:~# cat /proc/mdstat<br />
Personalities : [linear] [multipath] [raid0] [raid1] [raid5] [raid4] [raid6] [raid10]<br />
md0 : active raid1 sda1[0] sdb1[1]<br />
24418688 blocks [2/1] [U_]<br />
[=&gt;...................]  recovery =  9.9% (2423168/24418688) finish=2.8min speed=127535K/sec</p>
<p>md1 : active raid1 sda2[0] sdb2[1]<br />
24418688 blocks [2/1] [U_]<br />
[=&gt;...................]  recovery =  6.4% (1572096/24418688) finish=1.9min speed=196512K/sec</p>
<p>unused devices: &lt;none&gt;</p>
<p>When the synchronization is finished, the output will look like this:</p>
<p class="system">server1:~# cat /proc/mdstat<br />
Personalities : [linear] [multipath] [raid0] [raid1] [raid5] [raid4] [raid6] [raid10]<br />
md0 : active raid1 sda1[0] sdb1[1]<br />
24418688 blocks [2/2] [UU]</p>
<p>md1 : active raid1 sda2[0] sdb2[1]<br />
24418688 blocks [2/2] [UU]</p>
<p>unused devices: &lt;none&gt;</p>
<p>That&#8217;s it, you have successfully replaced <span class="system">/dev/sdb</span>!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.aionsolution.com/blog/linux/replacing-a-failed-hard-drive-in-a-software-raid1-array/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

