<?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>Your Warranty Is Void.com &#187; Linux</title>
	<atom:link href="http://www.yourwarrantyisvoid.com/category/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.yourwarrantyisvoid.com</link>
	<description>Linux, Hardware, Software and Chaos. What more is there?</description>
	<lastBuildDate>Sun, 15 Aug 2010 02:56:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Hardware Porn: Seagate Dockstar teardown</title>
		<link>http://www.yourwarrantyisvoid.com/2010/07/14/hardware-porn-seagate-dockstar-teardown/</link>
		<comments>http://www.yourwarrantyisvoid.com/2010/07/14/hardware-porn-seagate-dockstar-teardown/#comments</comments>
		<pubDate>Thu, 15 Jul 2010 01:00:20 +0000</pubDate>
		<dc:creator>firestorm_v1</dc:creator>
				<category><![CDATA[Embedded devices]]></category>
		<category><![CDATA[Hardware Pr0n]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[seagate]]></category>
		<category><![CDATA[storage]]></category>
		<category><![CDATA[usb]]></category>

		<guid isPermaLink="false">http://www.yourwarrantyisvoid.com/?p=504</guid>
		<description><![CDATA[I was given a very interesting product by a friend of mine that happened to catch a good deal on woot.com a few days ago.  Apparently Seagate has made a network fileserver device for their Freeagent Go line of portable USB drives called the Freeagent DockStar. (I can only think that this is a play [...]]]></description>
			<content:encoded><![CDATA[<p><img class="aligncenter size-full wp-image-505" title="Seagate Logo" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2010/07/seagatelogo.png" alt="Seagate Logo" width="136" height="79" />I was given a very interesting product by a friend of mine that happened to catch a good deal on woot.com a few days ago.  Apparently Seagate has made a network fileserver device for their Freeagent Go line of portable USB drives called the Freeagent DockStar. (I can only think that this is a play on Battlestar Galactica&#8217;s Baystar &#8211; a cylon &#8220;aircraft-carrier&#8221; of sorts.)  When I went to look for pictures online of the hardware, I was dismayed to find nothing about the inside of the little thing.  So here they are in all their exposed glory, the innards of the Seagate Dockstar.</p>
<p><span id="more-504"></span></p>
<div id="attachment_506" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2010/07/Dockstar-box.jpg"><img class="size-medium wp-image-506" title="Dockstar box" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2010/07/Dockstar-box-300x225.jpg" alt="Dockstar box" width="300" height="225" /></a><p class="wp-caption-text">Dockstar box</p></div>
<p>This is the box that the Dockstar came in.  Having not bought a non-OEM seagate drive in ages, I was pleasantly surprised that they used normal cardboard instead of some plastic case for this device.  Seagate is really pushing their &#8220;Go Green&#8221; incentive by changing the entire box (even the box inside) with easy to recycle cardboard instead of that translucent plastic &#8220;tray&#8221; that normally accompanies electronics.  While not necessarily an indication of product performance, it does show that they care about the environment.</p>
<div id="attachment_507" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2010/07/Dockstar-contents.jpg"><img class="size-medium wp-image-507" title="Dockstar contents" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2010/07/Dockstar-contents-300x225.jpg" alt="Dockstar contents" width="300" height="225" /></a><p class="wp-caption-text">Dockstar contents</p></div>
<p>Inside the box, aside from the little &#8220;Getting Started Manual&#8221; is the following items:  A Universal power brick pre-fitted with the US style prongs, a shielded ethernet cable and of course, the dockstar itself.</p>
<div id="attachment_509" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2010/07/universal-plug.jpg"><img class="size-medium wp-image-509" title="universal plug sticker" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2010/07/universal-plug-300x225.jpg" alt="universal plug sticker" width="300" height="225" /></a><p class="wp-caption-text">universal plug sticker</p></div>
<p>Here&#8217;s a closeup of the universal plug and all it&#8217;s various warnings and certifications.  I have seen a shift towards these universal plugs and away from the more proprietary plugs that manufacturers would normally use as a cost saving process. Since there is no one world-wide standard on power for every country that Seagate does business with, why spend that money building 20+ different power adapters when all you need is one with different prongs to fit whatever country&#8217;s plugs you&#8217;re going to be selling to.</p>
<div id="attachment_510" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2010/07/up-details.jpg"><img class="size-medium wp-image-510" title="Universal Plug details" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2010/07/up-details-300x225.jpg" alt="Universal Plug details" width="300" height="225" /></a><p class="wp-caption-text">Universal Plug details</p></div>
<p>And, just because I&#8217;m a sucker for details (and I keep losing the power bricks), here&#8217;s the voltage and amperage rating of the power brick.  Output is 12vDC 2Amps with a positive tip.</p>
<div id="attachment_508" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2010/07/dockstar-front.jpg"><img class="size-medium wp-image-508" title="dockstar front" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2010/07/dockstar-front-300x225.jpg" alt="Dockstar front" width="300" height="225" /></a><p class="wp-caption-text">Dockstar front</p></div>
<p>Finally, we get to the dockstar to find what secrets it holds.  The front panel has one LED for device status and the USB mini-B port for the Freeagent drive to sit in.  Unlike most older-style USB devices, the Seagate Freeagent is powered entirely through the USB port, eliminating the need for two cables to power one device.  Overall it&#8217;s a simple presentation of what looks to be a fairly complex device.</p>
<div id="attachment_511" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2010/07/dockstar-back.jpg"><img class="size-medium wp-image-511" title="Dockstar Back" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2010/07/dockstar-back-300x225.jpg" alt="Dockstar Back" width="300" height="225" /></a><p class="wp-caption-text">Dockstar Back</p></div>
<p>The back of the dockstar has two USB ports, the Gigabit Ethernet port and the power port on it.  I would like for there to have been a link and an activity LED for the Ethernet port, but unfortunately this was not implemented.  I guess I&#8217;m a sucker for LEDs.</p>
<div id="attachment_512" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2010/07/dockstar-side.jpg"><img class="size-medium wp-image-512" title="Right side of dockstar" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2010/07/dockstar-side-300x225.jpg" alt="Right side of dockstar" width="300" height="225" /></a><p class="wp-caption-text">Right side of dockstar</p></div>
<p>The right side of the dockstar features another USB port and the reset switch for the device.  The left side of the dockstar (not pictured) only has cooling vents on the side.</p>
<div id="attachment_513" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2010/07/dockstar-bottom.jpg"><img class="size-medium wp-image-513" title="dockstar bottom" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2010/07/dockstar-bottom-300x225.jpg" alt="Dockstar Bottom" width="300" height="225" /></a><p class="wp-caption-text">Dockstar Bottom</p></div>
<p>This is the bottom of the dockstar which has a large sticker that shows the serial numbers and MAC address of the device.  Of note, there was one number on this sticker which is formatted like some kind of product activation key and is formatted as follows:  six alphanumeric characters,  hyphen, six alphanumeric characters, hyphen, two alphanumeric characters, hyphen, six alphanumeric characters, hyphen, six alphanumeric characters.   At first glance, I thought these were hexadecimal numbers however the letters used were not between A-F and so it&#8217;s currently unclear what this number is for.  There is no mention of what this number is for in the documentation.</p>
<div id="attachment_514" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2010/07/spudger.jpg"><img class="size-medium wp-image-514" title="Gaining access to the insides" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2010/07/spudger-300x225.jpg" alt="Gaining access to the insides" width="300" height="225" /></a><p class="wp-caption-text">Gaining access to the insides</p></div>
<p>Typically on a device like this and most small consumer devices, there are four screws on the bottom (usually under the black slip-resistant dots) however the Dockstar doesn&#8217;t have any.  In order to gain access, I used a metal spudger to work the bottom away from the top half of the body.  There are two notches on each side of the square base, so you may need to use something flat like a spudger, small flathead screwdriver or a expansion slot blank to pry it open.</p>
<div id="attachment_515" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2010/07/just-opened.jpg"><img class="size-medium wp-image-515" title="Cracked the case" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2010/07/just-opened-300x225.jpg" alt="Cracked the case" width="300" height="225" /></a><p class="wp-caption-text">Cracked the case</p></div>
<p>Once you cracked the case open (hopefully without breaking it), you should see the small cable that connects the top USB port to the dockstar&#8217;s mainboard.  Carefully disconnect this cable and the two halves should now be seperated.</p>
<div id="attachment_516" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2010/07/mb-top.jpg"><img class="size-medium wp-image-516" title="Mainboard top view" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2010/07/mb-top-300x225.jpg" alt="Mainboard top view" width="300" height="225" /></a><p class="wp-caption-text">Mainboard top view</p></div>
<p>This is the dockstar in all it&#8217;s nude glory. The front of the device is to the right in this photograph. The small black square is Nanya 1Gb (comes out to ~128 megabytes)  DDR-2 RAM in a BGA package. <a href="http://www.nanya.com/NanyaAdmin/GetFiles.ashx?ID=502" target="_blank">Datasheet available here</a> and the large square is the device&#8217;s main processor.  From research I have performed, this appears to be a Marvell 1.2GHZ processor (just like the sheevaplug devices that Marvell is also selling. I tried to pull some more datasheets from plugcomputer.org, but their datasheet listing is quite lacking.  For now, just know that it&#8217;s an arm compliant processor and when I post an update article, I will have more juicy details on the capabilities of the processor.  Also of note, just below and to the right of the processor is a small ten pin header.  Presumably this can be used for a serial port however I do not have the cable for that.  Once I get it in and test it, I will update this article with a pinout diagram for you. Since this device is so low-level I would not recommend trying to connect a regular serial port to it directly as it more than likely requires a level shifter like a MAX232 to bring the -12/+12VDC down into something that won&#8217;t blast the components.</p>
<div id="attachment_517" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2010/07/mb-bottom.jpg"><img class="size-medium wp-image-517" title="Mainboard bottom" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2010/07/mb-bottom-300x225.jpg" alt="Mainboard bottom" width="300" height="225" /></a><p class="wp-caption-text">Mainboard bottom</p></div>
<p>This is the bottom of the dockstar&#8217;s mainboard.  Unfortunately, the board is now oriented that the front of the dockstar is now at the bottom of the picture. (Bad cameraman, no cookie.)  There&#8217;s not really much to note here as the board layout is jam packed with passive components.  The large black square on the lower right is the NAND storage for the device and while I couldn&#8217;t pull up the datasheet for it, the guys over at PlugPBX already had a <a href="http://forums.plugpbx.org/index.php?topic=97.0" target="_blank">forum post</a> that showed the Dockstar&#8217;s hardware specs for us.  According to their chart, the dockstar&#8217;s storage is 256MB. which should be more than adequate for general Linux fun.  The small chip just under the black tape in the upper right hand corner of the board is presumably the ethernet NIC however googling the chip numbers came up with nothing.</p>
<p>Just looking at the hardware overall, it would appear that the Seagate Dockstar is a very capable device that just needs to be altered to run whatever we choose to run with it.  While the software on the device (stock) comes with a filesharing service called Pogoplug, I do not intend on using that software and will be looking to get this device as far away from stock as possible.  Here is a list of some things I&#8217;ve been thinking of doing with it so far:</p>
<ul>
<li>Home NAS (without Internet file sharing)</li>
<li>multihomed router (I have a stack of pegasus USB modules)</li>
<li>semiportable network notification device (USB to parallel port, HD44780 LCD display)</li>
<li>realtime data acquisition device (USB logger and serial ports?)</li>
<li>Apple MT-DAAPd server for streaming music to iTunes installations on your local network</li>
</ul>
<p>Some sites I&#8217;ve seen while doing research have mentioned things from a in-home webserver with databases, to even a PBX server (take a look at <a href="http://www.plugpbx.org/" target="_blank">www.plugpbx.org</a>)</p>
<p>The big question is:  What would you do with it? Feel free to leave a comment as to what you&#8217;d do with this device, suggestions, information, etc.</p>
<p>FIRESTORM_v1</p>
<h1><span style="color: #ff0000;"><em><span style="text-decoration: underline;"><strong>BIG FAT OBNOXIOUS WARNING!:</strong></span></em></span><span style="color: #ff0000;"> </span></h1>
<p>Because of the Dockstar&#8217;s affinity to want to &#8220;phone home&#8221; thanks to the Pogoplug software,  I would not recommend plugging this into your live network just yet.  In all of the research I have done for this device, just about every site I have seen has posted some kind of warning about this.  The dockstar was originally designed to run with pogoplug which is an internet filesharing service that allows you to access your files from anywhere with Internet connectivity.  I don&#8217;t exactly trust an outside third party to have access to my files on a device that is only going to be used on a local network so I have not connected mine up to even test it.  If you are going to do any work with this device, I recommend that you use a dedicated mini-hub or switch and that it not be allowed to connect to the Internet until you have a complete understanding of what all it wants to do. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.yourwarrantyisvoid.com/2010/07/14/hardware-porn-seagate-dockstar-teardown/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Android:Sprint officially releases Android 2.1 for Samsung Moment!</title>
		<link>http://www.yourwarrantyisvoid.com/2010/05/15/androidsprint-officially-releases-android-2-1-for-samsung-moment/</link>
		<comments>http://www.yourwarrantyisvoid.com/2010/05/15/androidsprint-officially-releases-android-2-1-for-samsung-moment/#comments</comments>
		<pubDate>Sat, 15 May 2010 07:10:43 +0000</pubDate>
		<dc:creator>firestorm_v1</dc:creator>
				<category><![CDATA[Embedded devices]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Product Reviews]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://www.yourwarrantyisvoid.com/?p=447</guid>
		<description><![CDATA[While writing up the review for the Samsung Moment versus the Palm Pre, I happened to find out that Sprint has now released Android 2.1 (Eclair) for the Moment.  Guess now I have to start over again, but the up side is that this is a very significant update from Samsung&#8217;s initial release, Android 1.5. [...]]]></description>
			<content:encoded><![CDATA[<p>While writing up the review for the Samsung Moment versus the Palm Pre, I happened to find out that Sprint has now released Android 2.1 (Eclair) for the Moment.  Guess now I have to start over again, but the up side is that this is a very significant update from Samsung&#8217;s initial release, Android 1.5.</p>
<p>You can download the update from Sprint at <a title="Sprint's samsung moment update page" href="http://shop.sprint.com/en/software_downloads/pda_smartphone/samsung_moment.shtml" target="_blank">http://shop.sprint.com/en/software_downloads/pda_smartphone/samsung_moment.shtml</a></p>
<p>Please note: According to the instructions available at the link above, you will need to use a Windows PC to apply the update to your phone.  I will be posting a mirror shortly and it will show up in the &#8220;Download Files&#8221; page at the top of this page.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.yourwarrantyisvoid.com/2010/05/15/androidsprint-officially-releases-android-2-1-for-samsung-moment/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Site News: I have a new toy!</title>
		<link>http://www.yourwarrantyisvoid.com/2010/04/01/site-news-i-have-a-new-toy/</link>
		<comments>http://www.yourwarrantyisvoid.com/2010/04/01/site-news-i-have-a-new-toy/#comments</comments>
		<pubDate>Thu, 01 Apr 2010 16:06:55 +0000</pubDate>
		<dc:creator>firestorm_v1</dc:creator>
				<category><![CDATA[Embedded devices]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Product Reviews]]></category>
		<category><![CDATA[Site News]]></category>

		<guid isPermaLink="false">http://www.yourwarrantyisvoid.com/2010/04/01/site-news-i-have-a-new-toy/</guid>
		<description><![CDATA[Well my life has been busy as all get out and I do have a new post in the works however I&#8217;m taking a quick break because I have a new toy that makes for a far better story. I have recently gotten my hands on a new Samsung Moment on the Sprint network. Within [...]]]></description>
			<content:encoded><![CDATA[<p>Well my life has been busy as all get out and I do have a new post in the works however I&#8217;m taking a quick break because I have a new toy that makes for a far better story.</p>
<p>I have recently gotten my hands on a new Samsung Moment on the Sprint network.  Within the next few days, I will post all the gory details from this Android n00b and will be offering a comparison against the other smartphone I have, the Palm Pre.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.yourwarrantyisvoid.com/2010/04/01/site-news-i-have-a-new-toy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using Clonezilla to make your HD bigger</title>
		<link>http://www.yourwarrantyisvoid.com/2009/12/29/using-clonezilla-to-make-your-hd-bigge/</link>
		<comments>http://www.yourwarrantyisvoid.com/2009/12/29/using-clonezilla-to-make-your-hd-bigge/#comments</comments>
		<pubDate>Tue, 29 Dec 2009 20:08:49 +0000</pubDate>
		<dc:creator>firestorm_v1</dc:creator>
				<category><![CDATA[How-To's]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[network boot]]></category>
		<category><![CDATA[PXE]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.yourwarrantyisvoid.com/?p=217</guid>
		<description><![CDATA[(Ok, innuendo aside&#8230;) Well, the Christmas/Yule break is over with and it&#8217;s time to get cracking.   If you were like me this holiday season, you were either placed in the position if needing to do a hard drive upgrade for someone else or you received a new hard drive of your own that warrants upgrading.  [...]]]></description>
			<content:encoded><![CDATA[<h1 style="text-align: center;">
<p style="text-align: center;"><img class="size-medium wp-image-273   aligncenter" title="HD upgrade" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/12/HD-upgrade-300x153.jpg" alt="HD upgrade" width="240" height="122" /></p>
</h1>
<p>(Ok, innuendo aside&#8230;)</p>
<p>Well, the Christmas/Yule break is over with and it&#8217;s time to get cracking.   If you were like me this holiday season, you were either placed in the position if needing to do a hard drive upgrade for someone else or you received a new hard drive of your own that warrants upgrading.  The CloneZilla site didn&#8217;t contain very clear instructions for what to do so I decided to write this howto documenting the process. In this howto, I will cover using the free application &#8220;CloneZilla&#8221; to perform a hard drive upgrade on a test installation of Windows XP from 4GB to a 10GB drive.</p>
<h3><span id="more-217"></span></h3>
<h3>Foreword:</h3>
<p>Of course, it&#8217;s Christmastime/Yule and I took pity on my girlfriend&#8217;s laptop which had two things going against it.  Firstly, it had vista and secondly it had a 80GB hard drive.  I&#8217;m not sure why Toshiba in their infinite wisdom only gave it a 80GB HD, but they did. Thankfully I had just completed an upgrade to another machine and had a 250GB hard drive to spare.  So I set out to upgrade her hard drive and fix at least one of the two reasons that her laptop was evil.</p>
<p>A lot of research turned up various solutions however none of them were very viable or were free.  Most of them required two hard drives in one computer and although her laptop did have the solder traces for the second SATA hard drive connector I&#8217;m not about to take a soldering iron to her laptop, she&#8217;d kill me.  So with that said and with my head still attached to my body, I kept searching.  I found a Live CD application called CloneZilla which had Cloning abilities much like a certain Symantic product but was free and didn&#8217;t require extensive configuration to get to work.  Unfortunately the instructions were not very clear at all and after spending a nailbiting hour trying to start the copy, I finally got it done and decided to document the process in case someone else got stuck in the same need that I did.</p>
<p>In this HOWTO, I will be upgrading a 4GB Virtual Disk in VMware with that of a 10GB Virtual disk.  Aside from the fact that it&#8217;s all virtualized, this is indeed a true upgrade and is exactly how you would do an upgrade for a real &#8220;physical&#8221; computer.</p>
<h3>Prerequisites</h3>
<p>You will need the following items for a successful transfer:</p>
<ol>
<li> The CloneZilla CD available from <a title="Clonezilla community site" href="http://clonezilla.org/" target="_blank">http://clonezilla.org/</a> I&#8217;m using Clonezilla Live version 1.2.2-31.</li>
<li>A Windows computer that has a hard drive with free space greater than the size of the original disk you are upgrading.  (If you&#8217;re upgrading a 40GB HD, then this machine must have at least 40GB free on it.) This will be the WIndows Image Server.</li>
<li>The hard drive to upgrade</li>
<li>A working network where your machine to upgrade can browse the other windows machine&#8217;s file shares. (This is CRITICAL, as the other machine will store your disk image for the upgrade.)</li>
<li>A case of beer, rum, vodka, etc&#8230;</li>
</ol>
<p>The &#8220;other machine&#8221; in #2 will be the image server.  This is where CloneCD will copy the files to that make up the disk image.  I will review how to set up a fileshare in Windows for this however any machine that does SMB filesharing can work.  There are other options available however SMB sharing works the easiest.</p>
<h3>Process Overview</h3>
<p>In this HOWTO, we will be upgrading a Windows XP Virtual Machine with a 4GB HD to a 10 GB HD.  Although I&#8217;m using VMware Server to capture the screenshots, this same method can be used to upgrade almost any home Windows computer.  I&#8217;m not sure if Windows 7 or if Windows Server 200* will work but in all theory they should too.  The process for upgrading will go something like this:</p>
<ol>
<li>Examine the existing system to upgrade and get existing disk size</li>
<li>Configure Windows Image Server to accomodate images</li>
<li>Boot system to upgrade with Clonezilla, configure and start copy process</li>
<li>Swap out hard drives, reboot with Clonezilla and configure to start the restore process</li>
<li>Take whatever OS steps are needed to take advantage of new space. (OS Dependent)</li>
</ol>
<h3>Step 1:  Examine the existing system</h3>
<p>This one&#8217;s easy.  Just fire up the existing machine and take a look at the hard drive.  In my example system, there&#8217;s only one hard drive.  All I did in this screenshot was open My Computer and Right Click on Local Disk C: then go to &#8220;Properties&#8221;:</p>
<div id="attachment_223" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/12/systoupgrade.jpg"><img class="size-medium wp-image-223" title="systoupgrade" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/12/systoupgrade-300x225.jpg" alt="Test system to upgrade" width="300" height="225" /></a><p class="wp-caption-text">Test system to upgrade</p></div>
<p>If a machine has more than one partition, you might need to go to Local Disk Managment (Start -&gt; Run -&gt; diskmgmt.msc ) Here&#8217;s a screenshot of what our test system looks like through Disk managment:</p>
<div id="attachment_224" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/12/systoupgrade2.jpg"><img class="size-medium wp-image-224" title="systoupgrade2" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/12/systoupgrade2-300x225.jpg" alt="System To Upgrade (Disk managment view)" width="300" height="225" /></a><p class="wp-caption-text">System To Upgrade (Disk managment view)</p></div>
<p>Based on this information and according to disk managment, the <strong>minimum</strong> free space we need on our windows image server will be 4GB.  I would recommend an extra GB just in case. Now that we know how big the disk is and how much space we need, let&#8217;s get the image server configured.</p>
<h3>Step 2:  Configuration of the Windows image server</h3>
<p>This section covers how to set up the Windows Image server for the new image.  We will need to create a new directory for the image files, create a new user on the server and then assign that user with full permissions to that directory over the network.</p>
<h4>Step 2a: Add the user</h4>
<p>Right click on the My Computer Icon and go to Manage</p>
<div id="attachment_218" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/12/manage.jpg"><img class="size-medium wp-image-218" title="Manage option in My computer Right click menu" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/12/manage-300x257.jpg" alt="" width="300" height="257" /></a><p class="wp-caption-text">&quot;Manage&quot; option in Rt Click menu, Easy way to get to users and Groups</p></div>
<p style="text-align: center;">
<p>This will bring up the Computer Managment Console.  Click on the &#8220;+&#8221; next to &#8220;Users and Groups&#8221;, then click on Users.  This will show you all of the currently installed users on the system and should resemble something like below:</p>
<div id="attachment_219" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/12/cmpmgmt.jpg"><img class="size-medium wp-image-219" title="cmpmgmt" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/12/cmpmgmt-300x213.jpg" alt="Users view in Computer Managment" width="300" height="213" /></a><p class="wp-caption-text">Users view in Computer Managment</p></div>
<p>Right click on the right side of the window and click on &#8220;New User&#8230;&#8221;</p>
<div id="attachment_220" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/12/newuser1.jpg"><img class="size-medium wp-image-220" title="Users and Groups Right Click Menu" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/12/newuser1-300x214.jpg" alt="Users and Groups Right Click Menu" width="300" height="214" /></a><p class="wp-caption-text">Users and Groups Right Click Menu</p></div>
<p style="text-align: left;">In the &#8220;New User&#8221; dialog box that pops up, you want to set the following options:  Username = clone Description = CloneZilla user&#8221;, Password = clone  &#8220;User Cannot Change Password&#8221; and &#8220;Password Never Expires&#8221; should both be checked. &#8220;Account Is Disabled&#8221; and &#8220;User Must Change password at next login&#8221; should be cleared (unchecked).  See below for the reference screenshot:</p>
<p style="text-align: left;">
<div id="attachment_221" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/12/newuser2.jpg"><img class="size-medium wp-image-221" title="newuser2" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/12/newuser2-300x214.jpg" alt="New User settings" width="300" height="214" /></a><p class="wp-caption-text">New User Settings</p></div>
<p>Click &#8220;Create&#8221; and then click &#8220;Close&#8221;.  You can see the new user in the screenshot below highlighted in a red box.</p>
<div id="attachment_222" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/12/newuser3.jpg"><img class="size-medium wp-image-222" title="newuser3" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/12/newuser3-300x214.jpg" alt="Our new Clone user" width="300" height="214" /></a><p class="wp-caption-text">Our new Clone user</p></div>
<h4>Step 2B: Configure the file share and add the user to the share.</h4>
<p>Now that we have the user in the system, we need to create the file share. In this case, I&#8217;m using a directory inside my &#8220;D:&#8221; drive to store the images.  <strong>MAKE SURE THAT WHERE YOU STORE YOUR IMAGES EXCEEDS THE CAPACITY OF THE DRIVE TO BE COPIED!</strong> In our case, we found that the system to upgrade is 4GB, so we need at least a 5GB disk to copy to.</p>
<p>Go ahead and locate a suitable place for your clone files.  In this case &#8220;D:&#8221; is completely blank except for the system files that Windows generates for partitions.  Right click and create a new folder called &#8220;clone&#8221;</p>
<div id="attachment_225" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/12/clonedir.jpg"><img class="size-medium wp-image-225" title="clonedir" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/12/clonedir-300x240.jpg" alt="My clone directory" width="300" height="240" /></a><p class="wp-caption-text">My clone directory</p></div>
<p>Right click on the clone folder and go to &#8220;Sharing and Security&#8221;.  Fill out the form and name the share &#8220;Clone&#8221; however don&#8217;t click OK just yet.</p>
<div id="attachment_226" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/12/clonedir2.jpg"><img class="size-medium wp-image-226" title="clonedir2" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/12/clonedir2-300x257.jpg" alt="clone directory sharing properties" width="300" height="257" /></a><p class="wp-caption-text">clone directory sharing properties</p></div>
<p>We need to make sure that the &#8220;clone&#8221; user we created earlier has full access permissions to this directory.  Click on &#8220;Permissions&#8221; and add the &#8220;clone&#8221; user to the directory with full permissions.To do this, click &#8220;Add&#8221; on the Permissions screen, type in &#8220;clone&#8221;, type in &#8220;Check Names&#8221;, then hit OK.  In my case, it added &#8220;ZEUS\clone&#8221; which is still correct.  ZEUS is the name of the image server.</p>
<div id="attachment_227" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/12/clonedir3.jpg"><img class="size-medium wp-image-227" title="clonedir3" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/12/clonedir3-300x241.jpg" alt="Adding Clone to sharing permissions" width="300" height="241" /></a><p class="wp-caption-text">Adding clone to sharing permissions</p></div>
<p>Now, I have &#8220;clone&#8221; added to the permissions window and set the proper access permissions for that username as shown below.  Go ahead and click OK to the Permissions window and to the sharing properties window.</p>
<div id="attachment_228" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/12/clonedir4.jpg"><img class="size-medium wp-image-228" title="clonedir4" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/12/clonedir4-300x254.jpg" alt="Permissions are set" width="300" height="254" /></a><p class="wp-caption-text">Permissions are set</p></div>
<p>If all works well, you should see a &#8220;waiter&#8217;s hand&#8221; appear below the directory icon.  This hand icon shows that this directory is shared across the network and is available for access be it read-only or read/write.  At this point, we are done with configuring the server.  We&#8217;ve added the &#8220;clone&#8221; user to the server, added a suitable &#8220;clone&#8221; directory for Clonezilla to store and retrieve the disk image&#8217;s files from and we have added proper permissions to the directory for the clone user.</p>
<h4>Step 2c:  Test it out!</h4>
<p>Go back to our initial machine to upgrade.  You should be able to find your image server by browsing &#8220;My Network Places&#8221;.  In my case, the image server was named &#8220;zeus&#8221; and showed up only after I clicked on &#8220;View Workgroup Computers&#8221; as shown in this screenshot.  You should get a similar password prompt when you try to access your image server:</p>
<div id="attachment_229" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/12/clonetest.jpg"><img class="size-medium wp-image-229" title="clonetest" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/12/clonetest-300x225.jpg" alt="Clone share testing" width="300" height="225" /></a><p class="wp-caption-text">Clone share testing</p></div>
<p>Login with the user credentials we created in 2A, (username and password of &#8220;clone&#8221;) and you should be presented with a directory listing like the one shown below:</p>
<div id="attachment_230" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/12/clonetest2.jpg"><img class="size-medium wp-image-230" title="clonetest2" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/12/clonetest2-300x225.jpg" alt="directory listing " width="300" height="225" /></a><p class="wp-caption-text">directory listing</p></div>
<p>We have proven that our clone user works, but let&#8217;s test to make sure that we can write to it.  Double click on the clone share and try to create a text file.  (Right Click -&gt; New -&gt; Text File)  If it creates a &#8220;New Text File.txt&#8221; like shown below, this means that your permissions are correct and you&#8217;re good to go.  If you get any kind of read/write error, check your permissions on the image server.</p>
<div id="attachment_231" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/12/clonetest3.jpg"><img class="size-medium wp-image-231" title="clonetest3" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/12/clonetest3-300x225.jpg" alt="Write test for clone user" width="300" height="225" /></a><p class="wp-caption-text">Write test for clone user</p></div>
<p>If you&#8217;ve gotten this far, then congratulations, you&#8217;re ready to do the copy.  Go ahead and shut down the system you&#8217;re upgrading and get ready for the next step:</p>
<h3>Step 3:  Boot system to upgrade with Clonezilla, configure and start copy process</h3>
<p>Go ahead and boot the upgrade system with the CloneZilla CD. You will be presented with a boot menu like the one below. Go ahead and select the first menu option &#8220;Clonezilla live (Default Settings, VGA 1024&#215;768)&#8221;:</p>
<div id="attachment_232" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/12/Clonezilla.jpg"><img class="size-medium wp-image-232" title="Clonezilla" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/12/Clonezilla-300x225.jpg" alt="Clonezilla boot menu" width="300" height="225" /></a><p class="wp-caption-text">Clonezilla Boot Menu</p></div>
<p>It will then take a bit and flash a lot of linux based stuff at you.  Finally you should be directed to choose a language.  The prompt should look like this now:</p>
<div id="attachment_233" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/12/clonezilla1.jpg"><img class="size-medium wp-image-233" title="clonezilla1" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/12/clonezilla1-300x225.jpg" alt="Choose a language menu" width="300" height="225" /></a><p class="wp-caption-text">Choose a language menu</p></div>
<p>You will then get a prompt about keymaps.  When in doubt, just leave it alone.</p>
<div id="attachment_234" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/12/clonezilla2.jpg"><img class="size-medium wp-image-234" title="clonezilla2" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/12/clonezilla2-300x225.jpg" alt="Keymap prompt" width="300" height="225" /></a><p class="wp-caption-text">Keymap prompt</p></div>
<p>More console stuff will flash past and then you&#8217;ll get the prompt you&#8217;ve been waiting for.  Unless you&#8217;re very very advanced, you will only use the &#8220;Start Clonezilla&#8221; menu option:</p>
<div id="attachment_235" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/12/clonezilla3.jpg"><img class="size-medium wp-image-235" title="clonezilla3" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/12/clonezilla3-300x225.jpg" alt="Start Clonezilla" width="300" height="225" /></a><p class="wp-caption-text">Start Clonezilla</p></div>
<p>Now we&#8217;re at a screen that is really confusing.  We want to work with the disks but we also want to work with images to create partitions.  In this instance, we&#8217;re going from the disk to an image file on our windows image server then back to disk again.  In our instance, we will need to use option 1, Device-Image.</p>
<div id="attachment_236" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/12/clonezilla4.jpg"><img class="size-medium wp-image-236" title="clonezilla4" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/12/clonezilla4-300x225.jpg" alt="Image/Disk option menu" width="300" height="225" /></a><p class="wp-caption-text">Image/Disk option menu</p></div>
<p>In this screen, it&#8217;s asking where are we storing the image.  The answer is &#8220;samba/Network Neighborhood server&#8221; however if we needed to, we could use a local SSH server as well.</p>
<div id="attachment_237" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/12/clonezilla5.jpg"><img class="size-medium wp-image-237" title="clonezilla5" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/12/clonezilla5-300x225.jpg" alt="Image Server Type dialog" width="300" height="225" /></a><p class="wp-caption-text">Image Server Type dialog</p></div>
<p>Now it&#8217;s asking how we connect to our network.  99% of the time this will be &#8220;dhcp&#8221; as you will know if you&#8217;re using static for anything.  If you have a Linksys router or similar router/firewall device, select DHCP.</p>
<div id="attachment_238" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/12/clonezilla6.jpg"><img class="size-medium wp-image-238" title="clonezilla6" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/12/clonezilla6-300x225.jpg" alt="network type dialog" width="300" height="225" /></a><p class="wp-caption-text">network type dialog</p></div>
<p>After you get a successful IP address, CloneZilla needs to know what IP address your windows image server is.  In my example, the windows image server (zeus) is 192.168.0.5.</p>
<div id="attachment_239" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/12/clonezilla7.jpg"><img class="size-medium wp-image-239" title="clonezilla7" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/12/clonezilla7-300x225.jpg" alt="IP address dialog" width="300" height="225" /></a><p class="wp-caption-text">IP address dialog</p></div>
<p>Next, Clonezilla needs to ask for the Domain.  If you are not using a domain, then tab to &#8220;Cancel&#8221; and hit Enter.  I&#8217;m not using a domain here, so I just hit Cancel.  This is reserved for corporate networks that use a special server called a Domain Controller.</p>
<div id="attachment_240" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/12/clonezilla8.jpg"><img class="size-medium wp-image-240" title="clonezilla8" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/12/clonezilla8-300x225.jpg" alt="Domain prompt" width="300" height="225" /></a><p class="wp-caption-text">Domain prompt</p></div>
<p>Now Clonezilla needs to know the username of the account to connect to the server.  This will be the username and password you created in Step 2 above.  For our test, we put clone as the username</p>
<div id="attachment_241" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/12/clonezilla9.jpg"><img class="size-medium wp-image-241" title="clonezilla9" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/12/clonezilla9-300x225.jpg" alt="user prompt" width="300" height="225" /></a><p class="wp-caption-text">user prompt</p></div>
<p>Clonezilla prompts us for the location (the share name) of where to put the images.  In the steps above, we used &#8220;clone&#8221; as the share name.  This is the location we give to Clonezilla so it can store its images. <strong>Be sure to leave the leading / at the beginning of the directory name</strong>.</p>
<div id="attachment_242" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/12/clonezilla10.jpg"><img class="size-medium wp-image-242" title="clonezilla10" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/12/clonezilla10-300x225.jpg" alt="directory name for images" width="300" height="225" /></a><p class="wp-caption-text">directory name for images</p></div>
<p>Next, it&#8217;s time for the password.  When prompted, type in the password.  Although this prompt looks different than the others, this is not a sign that something has gone wrong so relax.</p>
<div id="attachment_243" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/12/clonezilla11.jpg"><img class="size-medium wp-image-243" title="clonezilla11" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/12/clonezilla11-300x225.jpg" alt="password dialog" width="300" height="225" /></a><p class="wp-caption-text">password dialog</p></div>
<p>If all of the information you entered was correct, you will get a filesystem mount listing similar to what is shown here.  If something went wrong, you&#8217;ll get an error message outlining the possible error and a chance to re-enter the information.  If it doesn&#8217;t give you the option to reenter or something isn&#8217;t right, just hit the power switch..  In this screenshot, you can see that the last line starting with //192.168.0.5&#8230;&#8230;  is our image server and that it is mounted correctly!</p>
<div id="attachment_244" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/12/clonezilla12.jpg"><img class="size-medium wp-image-244" title="clonezilla12" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/12/clonezilla12-300x225.jpg" alt="" width="300" height="225" /></a><p class="wp-caption-text">mount listing</p></div>
<p style="text-align: left;">Since we have successfully mounted our image storage as part of the liveCD&#8217;s filesystem, it&#8217;s time to start the copy.  You will be prompted for which mode to run Clonezilla in.  I recommend the &#8220;Beginner&#8221; method as it makes the entire copy easy.</p>
<div id="attachment_245" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/12/clonezilla13.jpg"><img class="size-medium wp-image-245" title="clonezilla13" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/12/clonezilla13-300x225.jpg" alt="Mode select dialog" width="300" height="225" /></a><p class="wp-caption-text">Mode select dialog</p></div>
<p>Now we are prompted on what to do.  We will start off by selecting the first option &#8220;savedisk&#8221; as we want to save the existing disk to the image server.  We will use &#8220;restoredisk&#8221;  later.</p>
<div id="attachment_246" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/12/clonezilla14.jpg"><img class="size-medium wp-image-246" title="clonezilla14" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/12/clonezilla14-300x225.jpg" alt="Function select" width="300" height="225" /></a><p class="wp-caption-text">Function Select</p></div>
<p>If you are wanting to manage multiple images, you have the option to name them with something more descriptive .  For now, I selected the default name which is in YYYY-MM-DD-HH format.</p>
<div id="attachment_247" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/12/clonezilla15.jpg"><img class="size-medium wp-image-247" title="clonezilla15" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/12/clonezilla15-300x225.jpg" alt="Image Name Select prompt" width="300" height="225" /></a><p class="wp-caption-text">Image Name Select prompt</p></div>
<p>Now we tell CloneCD which hard drive to copy.  In most systems, there will only be one hard drive, however make sure you have the right one if not.  You can select and deselect by using the space bar to toggle the asterisk.  An asterisk in the brackets &#8220;[*]&#8221; means that the item is selected however the brackets alone &#8220;[ ]&#8221; means the item is deselected.</p>
<div id="attachment_248" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/12/clonezilla16.jpg"><img class="size-medium wp-image-248" title="clonezilla16" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/12/clonezilla16-300x225.jpg" alt="Drive Select prompt" width="300" height="225" /></a><p class="wp-caption-text">Drive Select prompt</p></div>
<p>One last word from Clonezilla before it starts copying.  If we wanted to run in console mode (which I will never do. <img src='http://www.yourwarrantyisvoid.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' />  ) we could do it all with one command.  Just hit enter to get past this prompt and start the copying.   This also tells us that it has successfully found and identified the drive we selected to copy and shut down Linux&#8217;s logical volume manager to allow direct access to the disk to copy.</p>
<div id="attachment_249" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/12/clonezilla17.jpg"><img class="size-medium wp-image-249" title="clonezilla17" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/12/clonezilla17-300x225.jpg" alt="Pre-copy ready" width="300" height="225" /></a><p class="wp-caption-text">Pre-copy ready</p></div>
<p>One last final confirmation that the information we have entered is correct.  Remember that making this image does NOT make any filesystem changes to the original hard drive and in fact, no changes to the original hard drive are ever made.  This is especially good in case you need to revert your upgrade, you can just swap out hard drives and you&#8217;re back where you started from.  If everything is correct in the yellow text, go ahead and type &#8220;Y&#8221; and hit enter.  This will start the copy process.</p>
<div id="attachment_250" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/12/clonezilla18.jpg"><img class="size-medium wp-image-250" title="clonezilla18" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/12/clonezilla18-300x225.jpg" alt="confirmation prompt" width="300" height="225" /></a><p class="wp-caption-text">confirmation prompt</p></div>
<p>Finally, the copy begins.  Go ahead and grab a soda, watch a movie or something as this will take a considerable amount of time depending on the size of your hard drive.  In my test example transferring a 4GB hard drive, it took roughly 16 minutes to complete.  My girlfriend&#8217;s 80GB hard drive took several hours to copy.</p>
<div id="attachment_252" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/12/clonezilla19.jpg"><img class="size-medium wp-image-252" title="clonezilla19" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/12/clonezilla19-300x225.jpg" alt="copy started" width="300" height="225" /></a><p class="wp-caption-text">Copy Started</p></div>
<p>At last, the file copy is complete and we are ready to exit Clonezilla:</p>
<div id="attachment_253" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/12/clonezilla20.jpg"><img class="size-medium wp-image-253" title="clonezilla20" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/12/clonezilla20-300x225.jpg" alt="copy complete" width="300" height="225" /></a><p class="wp-caption-text">Copy complete.</p></div>
<p>Hit &#8220;Enter&#8221; then hit 0 for power off.  After a few seconds, you will get the message &#8220;Please remove the disc, close the tray (if any) and press Enter to continue. Hit enter and your computer should now turn off.  Go ahead and perform the drive swap now. We&#8217;re halfway there!</p>
<h3>Step 4:  Swap out hard drives, reboot with Clonezilla and configure to start the restore process</h3>
<p>Before continuing, you want to make sure that your hard drive is recognized by the BIOS.  In my test setup, I have swapped out the original 4GB VMware disk with a 10GB Vmware disk and it is displayed in the BIOS here:</p>
<div id="attachment_254" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/12/clonezilla21.jpg"><img class="size-medium wp-image-254" title="clonezilla21" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/12/clonezilla21-300x225.jpg" alt="BIOS showing new hard drive" width="300" height="225" /></a><p class="wp-caption-text">BIOS showing new hard drive</p></div>
<p>Just like before, we will use the same options to create the disk image to restore the disk image.    Use all of the instructions in step 2 all the way until you get to the Mode screen shown below.  Instead of selecting &#8220;savedisk&#8221; like we did at the last screen, we want to use &#8220;restoredisk&#8221; instead.</p>
<div id="attachment_255" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/12/clonezilla22.jpg"><img class="size-medium wp-image-255" title="clonezilla22" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/12/clonezilla22-300x225.jpg" alt="Select Mode dialog, revisited" width="300" height="225" /></a><p class="wp-caption-text">Select Mode dialog, revisited</p></div>
<p>Now we select the image to restore to disk. Since we only have one image listed, this is the one we use.</p>
<div id="attachment_256" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/12/clonezilla23.jpg"><img class="size-medium wp-image-256" title="clonezilla23" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/12/clonezilla23-300x225.jpg" alt="Select Image dialog" width="300" height="225" /></a><p class="wp-caption-text">Select Image dialog</p></div>
<p>Once we have selected a viable image, now we are prompted to select the target device.  Again, it&#8217;s the only hard drive, so it&#8217;s the device we want:</p>
<div id="attachment_257" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/12/clonezilla24.jpg"><img class="size-medium wp-image-257" title="clonezilla24" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/12/clonezilla24-300x225.jpg" alt="Select Target dialog" width="300" height="225" /></a><p class="wp-caption-text">Select Target dialog</p></div>
<p>Just like before, it will tell us that we can rerun this restore using a single command from command mode:</p>
<div id="attachment_258" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/12/clonezilla25.jpg"><img class="size-medium wp-image-258" title="clonezilla25" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/12/clonezilla25-300x225.jpg" alt="clone command line " width="300" height="225" /></a><p class="wp-caption-text">clone command line</p></div>
<p>This time, the warning needs to be read.  This is just prior to performing any filesystem changes to the new hard drive.   If you are absolutely sure, go ahead and answer &#8220;y&#8221; to start the restore process:</p>
<div id="attachment_259" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/12/clonezilla26.jpg"><img class="size-medium wp-image-259" title="clonezilla26" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/12/clonezilla26-300x225.jpg" alt="restore confirmation text" width="300" height="225" /></a><p class="wp-caption-text">restore confirmation text</p></div>
<p>One last time, it asks to make sure you are sure about your restore decision.  If everything is correct, answer &#8220;Y&#8221;.</p>
<div id="attachment_260" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/12/clonezilla27.jpg"><img class="size-medium wp-image-260" title="clonezilla27" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/12/clonezilla27-300x225.jpg" alt="Final restore prompt" width="300" height="225" /></a><p class="wp-caption-text">Final restore prompt</p></div>
<p>A good bit of text will go across the screen and you will ultimately end up at a partclone screen like the one below.  The text that you saw earlier is the partition application creating the destination partition for the image.  Once created, partclone takes over and starts restoring the data from the image. Again, grab another drink, (I&#8217;ve got a margarita) and wait a few hours for the image to restore.</p>
<div id="attachment_261" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/12/clone28.jpg"><img class="size-medium wp-image-261" title="clone28" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/12/clone28-300x225.jpg" alt="Partition restore in progress" width="300" height="225" /></a><p class="wp-caption-text">Partition restore in progress</p></div>
<p>Once the restore process completes, you will be prompted to power off.  Hit Enter, select option 1 and remove the CD from the CDROM tray when prompted.</p>
<div id="attachment_262" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/12/clone29.jpg"><img class="size-medium wp-image-262" title="clone29" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/12/clone29-300x225.jpg" alt="restore completed" width="300" height="225" /></a><p class="wp-caption-text">restore completed</p></div>
<p>Once the system reboots, it should automatically start Windows.  If it does, you&#8217;re ready to go to the last step!</p>
<h3>Step 5: Take whatever OS steps are needed to take advantage of new space. (OS Dependent)</h3>
<p>Now these steps depend on which OS you&#8217;re using. At this point, we have made an image of the old drive, saved that image to another server and restored it to a new blank drive that is larger than the original image.  As shown earlier, we have a 10GB disk in our machine to upgrade and we have just restored our 4GB image to it. We have successfully booted windows however our disk properties show that the disk image is still 4GB.  (Ignore the disk space used, as I was shutting down the disk image it decided to install 50 windows updates&#8230;)</p>
<div id="attachment_263" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/12/clone30.jpg"><img class="size-medium wp-image-263" title="clone30" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/12/clone30-300x225.jpg" alt="Disk space still the same?" width="300" height="225" /></a><p class="wp-caption-text">Disk space still the same?</p></div>
<p>Here is the same shot of the disk managment window after the upgrade/restore.  You can see that it is a 10GB drive, but is still a 4GB partition.</p>
<div id="attachment_264" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/12/clone31.jpg"><img class="size-medium wp-image-264" title="clone31" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/12/clone31-300x225.jpg" alt="disk managment" width="300" height="225" /></a><p class="wp-caption-text">disk managment</p></div>
<p><span style="text-decoration: underline;"><strong>Attention Vista Users!!:</strong></span> If you are running Windows Vista, you can use Disk Managment to expand the disk size.  All you have to do is right click on the C: partition shown above then go to &#8220;Expand Disk&#8221;.  This will walk you through the process for expanding the disk to take up the entire space of your new drive.  I&#8217;ll add new instructions to this as soon as my girlfriend lets me use her laptop again.</p>
<p>For those of you not running Vista, keep reading. At this point, we have validated that our restored image works properly.  Now all we need to do is resize the partition to take up the entire disk.  Thankfully clonezilla has a solution for that.  Reboot using the CloneZilla CD. Answer the same questions regarding keymap like you did before except instead of starting clonezilla, we want to enter the Clonezilla shell.</p>
<div id="attachment_265" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/12/clone32.jpg"><img class="size-medium wp-image-265" title="clone32" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/12/clone32-300x225.jpg" alt="Go to Clonezilla shell" width="300" height="225" /></a><p class="wp-caption-text">Go to Clonezilla shell</p></div>
<p>You will get dropped to a text prompt that presents you with several options.  You will want to select option 2, &#8220;Enter Command Line Prompt&#8221;.  Once done, you will be at a user@debian prompt as shown here:</p>
<div id="attachment_266" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/12/clone33.jpg"><img class="size-medium wp-image-266" title="clone33" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/12/clone33-300x225.jpg" alt="command prompt" width="300" height="225" /></a><p class="wp-caption-text">command prompt</p></div>
<p>We are going to use the utility &#8220;ntfsresize&#8221; in order to increase the size of the partition that we restored to the new disk but first we need more information.  Before we get started, run the command &#8220;<strong>su -</strong>&#8221; to get to the &#8220;root&#8221; user. This will allow us to modify the drive&#8217;s layout.    At the above menu prompt, hit the digit <strong>2</strong> for &#8220;<strong>Enter command line prompt</strong>&#8221; and then type &#8220;<strong>su -</strong>&#8221; at the &#8220;<strong>user@debian ~$</strong>&#8221; prompt.  The screen should then look like the screen below.</p>
<div id="attachment_432" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/12/cz-root.jpg"><img class="size-medium wp-image-432" title="SU to root" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/12/cz-root-300x225.jpg" alt="SU to root" width="300" height="225" /></a><p class="wp-caption-text">SU to root</p></div>
<p>Then we will use &#8220;fdisk&#8221; to get the disk&#8217;s full size.  I ran the command &#8220;<strong>fdisk -l /dev/hda</strong>&#8221; to get the drive size:</p>
<div id="attachment_267" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/12/clone34.jpg"><img class="size-medium wp-image-267" title="clone34" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/12/clone34-300x225.jpg" alt="fdisk disk size" width="300" height="225" /></a><p class="wp-caption-text">fdisk disk size</p></div>
<p>This is important as we are going to <strong>delete</strong> the partition, then <strong>recreate</strong> the partition.  First off let&#8217;s run &#8220;<strong>fdisk /dev/hda</strong>&#8221; and use &#8220;p&#8221; to get the partition size.  In this screen, we see that the partition starts at 1 and ends at 521.  We want it to extend to the rest of the disk.  We&#8217;ll start off by using &#8220;d&#8221; to delete the partition, (FDISK will assume partition 1) and then create a New partition using the defaults as shown below (Use the commands &#8220;N&#8221; for New partition, &#8220;P&#8221; for primary partition, and give it partition number 1).  Once we have created the new partition, we will need to set the &#8220;System&#8221; back to HPFS/NTFS otherwise NTFSresize won&#8217;t work properly.  Below is the FDISK responses to these commands we&#8217;ve used so far.</p>
<div id="attachment_268" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/12/clone35.jpg"><img class="size-medium wp-image-268" title="clone35" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/12/clone35-300x225.jpg" alt="FDISk resizing" width="300" height="225" /></a><p class="wp-caption-text">FDISK resizing</p></div>
<p>Now that we&#8217;ve create the new partition, we have to reset it&#8217;s type.  Use the &#8220;t&#8221; command and set it to ID of 7 (HPFS/NTFS) and then use &#8220;a&#8221; to toggle it&#8217;s bootable state.  We want to be able to boot into Windows after all.  Use the &#8220;w&#8221; command to write the partition data to the hard drive and exit.  Now that we have reset the partition size, we can use NTFSResize to expand the NTFS data.  Cross your fingers and run &#8220;<strong>ntfsresize /dev/hda</strong>&#8221; and it should produce output like what is shown here.  When run with no additional parameters, NTFSResize should automatically find the beginning and the end of the partition and expand the existing NTFS data to take the entire drive as shown:</p>
<div id="attachment_269" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/12/clone36.jpg"><img class="size-medium wp-image-269" title="clone36" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/12/clone36-300x225.jpg" alt="NTFSResize" width="300" height="225" /></a><p class="wp-caption-text">NTFSResize</p></div>
<p>With our newly resized partition we should be able to reboot and get into our Windows environment.  To do that, just type &#8220;<strong>reboot</strong>&#8221; and remove the CD when prompted.  <span style="text-decoration: underline;"><strong>Note:</strong></span> The above screenshot missed me using the &#8220;a&#8221; and &#8220;w&#8221; commands to toggle bootable status.  Here&#8217;s what it looks like:</p>
<div id="attachment_270" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/12/clone37.jpg"><img class="size-medium wp-image-270" title="clone37" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/12/clone37-300x225.jpg" alt="Bootable flag now set" width="300" height="225" /></a><p class="wp-caption-text">Bootable flag now set, sorry guys. <img src='http://www.yourwarrantyisvoid.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p></div>
<p>Ok, so now that I have fixed my grievous error, it&#8217;s time to reboot.  With any luck, your computer will boot Windows and go staight into a chkdsk environment.  <span style="text-decoration: underline;"><strong>THIS IS OK!</strong></span>, this means that Windows sees the new partition size and that it needs to run a consistency check.  DO NOT PANIC!!!  Let the consistency check run, then it will reboot your computer again.  After it boots for the second time, it might prompt to restart because it found new hardware (the new HD).  This is OK as well.  Let the windows installation reboot.  Once it has completed rebooting for the third time,  get your disk properties by right clicking on C: drive and going to Properties.  As shown below, we have successfully resized our partition to take up the entire drive and are now sitting at 10GB (well 9.99GB according to windows.):</p>
<div id="attachment_271" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/12/clone38.jpg"><img class="size-medium wp-image-271" title="clone38" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/12/clone38-300x225.jpg" alt="Windows XP's new filesize" width="300" height="225" /></a><p class="wp-caption-text">Windows XP&#39;s new filesize</p></div>
<p>Here is a screenshot from Windows XP&#8217;s Disk managment to show that we used the entire drive:</p>
<div id="attachment_272" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/12/clone39.jpg"><img class="size-medium wp-image-272" title="clone39" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/12/clone39-300x225.jpg" alt="Disk managment with new partition sizes" width="300" height="225" /></a><p class="wp-caption-text">Disk managment with new partition sizes</p></div>
<p>At this point, we have successfully finished the migration!  Here&#8217;s a rundown of what all we did in this step:</p>
<ol>
<li>We restored the partition to the new drive</li>
<li>We verified that the restore worked properly when booted into, e.g windows booted properly and without errors.</li>
<li>We then deleted the existing partition, recreated a new partition and then set the partition type and bootable flag using Linux&#8217;s FDISK on the Clonezilla CD.</li>
<li>We used NTFSResize to expand the NTFS data to take up the entire new resized partition.</li>
<li>We then booted into Windows and let it do a filesystem check</li>
<li>When Windows was restarted again, we validated through Properties and &#8220;Disk Management&#8221; that the new disk was used fully.</li>
</ol>
<p>This was the most complex part of the migration as CloneZilla only goes about 90% of the way to migrating to a new, larger hard drive.  I hope that this howto provides the last 10% that you are looking for.  With this howto and a copy of CloneZilla, you can then upgrade almost ANY hard drive that Linux supports and can even go from IDE to SATA or SATA to IDE if need be.</p>
<h3>Afterword:</h3>
<p>I sincerely hope that this helps someone out there trying to make sense of a hard drive upgrade.  I know that I learned a lot about partitions and filesystem structures by attempting an upgrade of my girlfriend&#8217;s laptop and this Windows XP installation.  I know that working with partitions is a scary thing as you could potentially lose data but keep in mind that your &#8220;original&#8221; hard drive still has all the original data on it, as does the image that was stored on the windows image server.</p>
<p>The items in this howto can potentially be a life saver especially if you have a family member that keeps messing their computer up.  You could create an image after you have performed all needed windows updates and software installations and then retain it for if something goes wrong.  Rather than having to manually do an OS reload, you can run though this HOWTO in an hour and have their system up and running again, fully patched and ready to go.</p>
<p>I hope that you had a great Christmas/Yule  with your family and look forward to keep going strong in 2010.  As always, thank you for your continued patronage, you are always welcome here at YourWarrantyIsVoid.com!</p>
<p>FIRESTORM_v1</p>
]]></content:encoded>
			<wfw:commentRss>http://www.yourwarrantyisvoid.com/2009/12/29/using-clonezilla-to-make-your-hd-bigge/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Add an SD card slot to a WRT54G v2</title>
		<link>http://www.yourwarrantyisvoid.com/2009/09/09/add-an-sd-card-slot-to-a-wrt54g-v2/</link>
		<comments>http://www.yourwarrantyisvoid.com/2009/09/09/add-an-sd-card-slot-to-a-wrt54g-v2/#comments</comments>
		<pubDate>Wed, 09 Sep 2009 08:27:18 +0000</pubDate>
		<dc:creator>firestorm_v1</dc:creator>
				<category><![CDATA[Embedded devices]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[How-To's]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Linksys]]></category>
		<category><![CDATA[parts]]></category>
		<category><![CDATA[router]]></category>
		<category><![CDATA[SD card]]></category>
		<category><![CDATA[WRT54G]]></category>

		<guid isPermaLink="false">http://www.yourwarrantyisvoid.com/?p=95</guid>
		<description><![CDATA[In this post, we&#8217;ll cover step-by-step how to add a SD cardslot to your Linksys WRT54G running DD-WRT and how to configure it in the DD-WRT UI.    Granted, this has been done a lot already, however there is a significant lack of information on how to do it on the older V2&#8242;s.  Read more for [...]]]></description>
			<content:encoded><![CDATA[<p><img class="aligncenter size-full wp-image-97" title="router" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/09/M130.png" alt="router" width="128" height="137" />In this post, we&#8217;ll cover step-by-step how to add a SD cardslot to your Linksys WRT54G running DD-WRT and how to configure it in the DD-WRT UI.    Granted, this has been done a lot already, however there is a significant lack of information on how to do it on the older V2&#8242;s.  Read more for the complete step-by-step guide.<span id="more-95"></span></p>
<p>One of the advantages to using alternative firmware on &#8220;stock&#8221; devices is that it allows you to unlock the full potential of your hardware.  Using the latest version of DD-WRT, you can now enable esternal storage on your WRT54G to add to the default image.  With additional storage for your router, the possibilities are endless.</p>
<p><span style="text-decoration: underline;"><strong>PLEASE NOTE:</strong></span> The pictures and information for adding the SD cardslot is only applicable to the Version 2 of the Linksys router.  Attempting to do this on newer routers using this guide may result in damage to the router, the SD card or both.  You can not hold me liable for any damage, so please read first and do some research before you crack the case open. The 15 minutes you may spend now may save you some blue smoke later.</p>
<p><strong>Items Required:</strong></p>
<ul>
<li><strong>SD card slot</strong> &#8211; I stole one out of a 4 in one card reader from a failed hacking attempt from another project.</li>
<li><strong>SD card</strong> &#8211; Use a cheap one to verify it&#8217;s working first, then use whatever size you want.</li>
<li><strong>A piece of PCB &#8211; </strong>I used a piece of board that I had left over from another project, but <a title="Radio Shack Perfboard" href="http://www.radioshack.com/product/index.jsp?productId=2104052" target="_blank">this one from Radio Shack</a> works well too.<em> </em></li>
<li><strong>Jumper Wire</strong> &#8211; If you have multiple colors, this would be beneficial in keeping the lines straight for wiring.</li>
<li><strong>Small nuts and bolts</strong></li>
<li><strong>Fine Tip soldering iron</strong></li>
<li><strong>Dremel cutting tool</strong></li>
<li><strong>(Optional) Razor Knife or X-acto Knife set</strong></li>
</ul>
<p>First thing&#8217;s first.  This howto only covers the process of adding the card slot to the router and configuring DD-WRT.  It does not cover installing DD-WRT on the router or which router is best for the process.  The process of installing DD-WRT is very very well documented as well as the router&#8217;s specs for <a title="DD-WRT supported devices" href="http://www.dd-wrt.com/wiki/index.php/Supported_Devices" target="_blank">supported devices</a> over at the <a title="DD-WRT Wiki" href="http://www.dd-wrt.com/wiki/index.php/Main_Page" target="_blank">DD-WRT Wiki</a>.</p>
<h2>Getting to know the SD card</h2>
<p><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/09/DSCF0386.JPG"><img class="aligncenter size-medium wp-image-98" title="SD card pinout" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/09/DSCF0386-300x296.jpg" alt="SD card pinout" width="300" height="296" /></a>The SD card pinout shown above indicates that although the card has 9 pins, we will only be using 7 of them.  Unlike most devices, the indented pin is not pin 1, but is pin 9, with pin 1 next to it.  Here&#8217;s a quick reference showing what each pin is and what it does:</p>
<ul>
<li>Pin 1 &#8211; Chip Select &#8211; When this is brought high, the SD card is &#8220;turned on&#8221; and allows it to receive data or send data in sync with the CLK pin (pin 5)</li>
<li>Pin 2 &#8211; Data In &#8211; This pin is used to receive data from the WRT54G for writing or for commands</li>
<li>Pin 3 &#8211; Vss (GND) &#8211; This is a ground pin and is tied to Pin 6 for one less wire to deal with.  It is important that both pins be brought together.</li>
<li>Pin 4 &#8211; VCC (or +5VDC) &#8211; This pin supplies power to the SD card.</li>
<li>Pin 5 &#8211; CLK &#8211; This is the clock line that the WRT sends to the SD card.  This pin synchronizes the data coming in or going out of the WRT54G so that the SD card has the proper timing to read and write data.</li>
<li>Pin 6 &#8211; Vss (GND) &#8211; This pin is also ground.</li>
<li>Pin 7 &#8211; DO &#8211; This pin is data out to the WRT54G</li>
<li>Pin 8 &#8211; Not Connected for this project.</li>
<li>Pin 9 &#8211; Also not connected for this project.</li>
</ul>
<p>We will be using some connections in the WRT54G called GPIOs to connect the various pins of the SD card to the WRT54G&#8217;s hardware.  These GPIO pins are already used for other functions, but with the driver built into DD-WRT, we can use them to also control the SD card.</p>
<h2>Step 1: Prepare the SD Card slot:</h2>
<p><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/09/DSCF0332.JPG"><img class="aligncenter size-medium wp-image-99" title="SD card slot" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/09/DSCF0332-300x225.jpg" alt="SD card slot" width="300" height="225" /></a>This is a picture of the SD card slot that I will be using.</p>
<p><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/09/DSCF0335.JPG"><img class="aligncenter size-medium wp-image-100" title="Card slot and perfboard" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/09/DSCF0335-300x225.jpg" alt="Card slot and perfboard" width="300" height="225" /></a>In this picture, I felt it necessary to scrape off the PCB solder pads under the SD card itself.  This is where the X-acto knife kit comes in handy.  The two solder &#8220;dots&#8221; in between the screw holes is for anchoring the tabs of the SD card slot and is recommended for making the card slot resistant to damage from repeated inserts and extracts.</p>
<p><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/09/DSCF0333.JPG"><img class="aligncenter size-medium wp-image-101" title="Card slot and PCB back-end" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/09/DSCF0333-300x225.jpg" alt="Card slot and PCB back-end" width="300" height="225" /></a>In this shot, I have lucked out.  Each of the pins from the card slot match one of the solder pads on the PCB with no difficulty.  This will greatly help soldering the wires to the cardslot.</p>
<p><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/09/DSCF0336.JPG"><img class="aligncenter size-medium wp-image-102" title="Ground wires in place" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/09/DSCF0336-300x225.jpg" alt="Ground wires in place" width="300" height="225" /></a>I recommend starting off with the ground wires, pin3 and pin 6.  The little loop is the bridge between the two.</p>
<p><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/09/DSCF0339.JPG"><img class="aligncenter size-medium wp-image-103" title="DSCF0339" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/09/DSCF0339-300x225.jpg" alt="DSCF0339" width="300" height="225" /></a>Wire the rest of the wires to their respective pins on the SD card slot. When all is said and done, you should have 6 wires.   At this point, we&#8217;re done with the card slot and we&#8217;re ready to start soldering to the WRT54G.</p>
<h2>Step 2: Making connections</h2>
<p>If you haven&#8217;t done so already, go ahead and take the WRT54G apart.</p>
<ul>
<li>Start by unplugging the WRT54G&#8217;s power and network cables.</li>
<li>Unscrew both of the antennas and set aside</li>
<li>Grab the grey part of the WRT54G in one hand and the blue part in your other hand.</li>
<li>Pull the two halves apart and set the blue part aside.</li>
<li>Slide the top cover away from the bottom half of the WRT54G.</li>
</ul>
<p>Now for the hard part.  There are six locations that need to be wired up in order for this to work properly.  We&#8217;ll start off with the easy one. Pin 1 (CS) goes to the + side of the DMZ LED.  In this orientation, the component side of the PCB faces away from you, essentially you&#8217;re looking up from the bottom.</p>
<p><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/09/DSCF03871.JPG"><img class="aligncenter size-medium wp-image-105" title="CS pin to + of DMZ LED" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/09/DSCF03871-300x225.jpg" alt="CS pin to + of DMZ LED" width="300" height="225" /></a>Attach the pin 1 lead to the <strong>right</strong> pin of the  DMZ LED.</p>
<p><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/09/DSCF0342-reduced1.JPG"><img class="aligncenter size-medium wp-image-107" title="Pin 4, +5v and Pin 3,6 GND" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/09/DSCF0342-reduced1-300x225.jpg" alt="Pin 4, +5v and Pin 3,6 GND" width="300" height="225" /></a>In this picture, we will be using the In Circuit Programmer port for pin 4 and pins 3,6.  The Pin 4 (+5V) goes to the pin 1 on the ICP port, while the pins 3,6 (GND) goes to pin 10 of the ICP port. Orient the router so that the two antennas point up and away from you and that the component side faces you. The ICP port is an unpopulated 10 pin header located in the lower right hand quadrant of the router&#8217;s circuit board.</p>
<p>The next three leads are the most important AND the most difficult.  You can click on the image to get a larger view if you need it.</p>
<p><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/09/DSCF03401.JPG"><img class="aligncenter size-medium wp-image-108" title="Last three pins" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/09/DSCF03401-300x185.jpg" alt="Last three pins" width="300" height="185" /></a>With the same orientation discussed as before, just south of the ADMtek chip is where the last three pins go.  This is the hardest part of the build as you must attach to a resistor network that itself is very tiny.  It took me several attempts and I had to superglue the wires down so that they wouldn&#8217;t move (not shown in this shot).</p>
<p><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/09/DSCF03402.JPG"><img class="aligncenter size-medium wp-image-109" title="Extreme close up" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/09/DSCF03402-300x201.jpg" alt="Extreme close up" width="300" height="201" /></a>Here is an EXTREME close up of the resistor network (still same orientation).  This is a 4 resistor chip, with 2 rows of 4 pins each.  Pin 1 is the upper left hand corner and is wired to DI (pin 2) of the SD card. Pin 6 (second from the left on the lower side of the resistor network) goes to the CLK (pin 5) of the SD card, while pin 7 of the resistor network is wired to DO (pin 7) of the SD card.</p>
<h2>Step 3: Box it up!</h2>
<p>Now that you&#8217;ve gotten the card set up, it&#8217;s time to put it together.  Now, there are many a howto that have a million and one locations to mount the card slot.  I wanted something that didn&#8217;t look kludged together or didn&#8217;t have the cardslot sticking out of some random location. I instead chose the back of the WRT, just above the ethernet ports.</p>
<p><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/09/DSCF0345.JPG"><img class="aligncenter size-medium wp-image-110" title="SD card slot and Dremel" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/09/DSCF0345-300x225.jpg" alt="SD card slot and Dremel" width="300" height="225" /></a>Thankfully for me, the SD card was slightly larger than the diameter of the cutting wheel of my Dremel.  Making a single cut was quite easy.</p>
<p><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/09/DSCF0348.JPG"><img class="aligncenter size-medium wp-image-111" title="SD card in place" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/09/DSCF0348-300x225.jpg" alt="SD card in place" width="300" height="225" /></a>I made my cut just above the Ethernet ports and secured the PCB to the top cover.  The bolts holding the PCB in place were just short enough to clear the RJ45 connection block so no additional work was necessary.</p>
<p><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/09/DSCF0352.JPG"><img class="aligncenter size-medium wp-image-112" title="Completed mod" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/09/DSCF0352-300x225.jpg" alt="Completed mod" width="300" height="225" /></a>Here&#8217;s a view after the WRT54G completely assembled (and also where my Dremel nicked the plastic cover)</p>
<p><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/09/DSCF0353.JPG"><img class="aligncenter size-medium wp-image-113" title="DSCF0353" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/09/DSCF0353-300x225.jpg" alt="DSCF0353" width="300" height="225" /></a>One more shot of the completed mod, the only thing I would like to have done is found countersunk bolts.  Unfortunately, I was limited to what I had on hand at the time.  All in all, it&#8217;s a very clean modification.</p>
<h2>Step 4: Configure DD-WRT</h2>
<p>Now all that&#8217;s left to do is to configure DD-WRT.  Before we begin, make sure that you have cleared out the SD card of any data you want prior to working with it.  Once we get the card working, the router will format the card with an EXT3 filesystem, erasing anything already on the card.</p>
<p>Go ahead and hook up the router to power and network.  Don&#8217;t stick the SD card in just yet, first we have to configure DD-WRT for the card.  Click on &#8220;Managment&#8221; and scroll down to the &#8220;MMC/SD card support&#8221;.  Enable it if it&#8217;s not already enabled and set the GPIO pins detect to &#8220;Manual&#8221;.</p>
<p><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/09/SD-success-Mozilla-Firefox-1.png"><img class="aligncenter size-medium wp-image-114" title="SD card GPIO pin settings" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/09/SD-success-Mozilla-Firefox-1-300x210.png" alt="SD card GPIO pin settings" width="300" height="210" /></a>When you select &#8220;Manual&#8221;, you will need to put in some numbers for the four signal leads.  I used the following settings:</p>
<ul>
<li>DI (Data In) &#8211; GPIO 5</li>
<li>DO (Data Out) &#8211; GPIO 3</li>
<li>CLK (Clock) &#8211; GPIO 4</li>
<li>CS (Chip Select) &#8211; GPIO 7</li>
</ul>
<p>Scroll down, and hit &#8220;Save Settings&#8221;.  The screen will fade out then fade back in.  Once the screen fades back in, disconnect the power from the WRT and insert your SD card. Power on the router and you should notice that the DMZ LED starts flashing intermittently.  This is good news.</p>
<p>Log back into the DD-WRT admin panel and hopefully, if everything is correct, you will see values filled in for Total/Free Size.  If you do, then congratulations. you&#8217;re done!  You can login via Telnet to the router and see that it&#8217;s mounted and ready to roll.</p>
<p><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/09/mounted-SD.png"><img class="aligncenter size-medium wp-image-115" title="mounted SD" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/09/mounted-SD-300x208.png" alt="mounted SD" width="300" height="208" /></a>From here, you can now compile things on a Linux box, save them to your SD card and then use your SD card to launch your programs on the WRT itself.  Just remember to mount and umount the card and you won&#8217;t have to worry about corrupting the filesystem on the card.</p>
<h2>Afterword:</h2>
<p>Thanks goes out to the DD-WRT user community for making this possible and thanks goes to the original person that hacked out GPIO SD-card support into the kernel running on DD-WRT.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.yourwarrantyisvoid.com/2009/09/09/add-an-sd-card-slot-to-a-wrt54g-v2/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Make APCUPSd tweet for help!</title>
		<link>http://www.yourwarrantyisvoid.com/2009/08/18/make-apcupsd-tweet-for-help/</link>
		<comments>http://www.yourwarrantyisvoid.com/2009/08/18/make-apcupsd-tweet-for-help/#comments</comments>
		<pubDate>Tue, 18 Aug 2009 22:02:52 +0000</pubDate>
		<dc:creator>firestorm_v1</dc:creator>
				<category><![CDATA[How-To's]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[APC]]></category>
		<category><![CDATA[apcupsd]]></category>
		<category><![CDATA[API]]></category>
		<category><![CDATA[Twitter]]></category>

		<guid isPermaLink="false">http://www.yourwarrantyisvoid.com/?p=51</guid>
		<description><![CDATA[Well, the world is abuzz with all things twitter so I figured that I&#8217;d join the fray.  But rather than tweeting about farts being blasted into an office chair or a toilet that twitters or even a tweeting toaster, I decided to do something useful with this thing called Twitter.  I have APCUPSd running on [...]]]></description>
			<content:encoded><![CDATA[<p><img class="aligncenter size-full wp-image-61" title="images" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/08/images.jpeg" alt="images" width="150" height="65" /></p>
<p>Well, the world is abuzz with all things twitter so I figured that I&#8217;d join the fray.  But rather than <a href="http://www.instructables.com/id/The-Twittering-Office-Chair/">tweeting about farts being blasted into an office chair</a> or a <a href="http://aculei.net/~shardy/hacklabtoilet/">toilet that twitters</a> or even a <a href="http://www.instructables.com/id/social_networking_for_my_toaster/">tweeting toaster</a>, I decided to do something useful with this thing called Twitter.  I have APCUPSd running on a Linux box that tweets when the server detects a change in power.  Read more to find out how you can incorporate this into your linux server.</p>
<p><span id="more-51"></span>After thinking about my network monitor application that &#8220;tweets&#8221; when a server goes down or comes up unexpectedly, I thought I&#8217;d take a look at seeing what it would take to get notified when my server lost power.  I already installed and configured APCUPSd and it was confirmed as working so now I wanted to be notified on power changes.</p>
<p>The whole &#8220;twitter&#8221; thing had caught on right when I was looking for a solution to a problem I had.  The issue was that I had a server that was randomly dropping offline and freezing and I needed a way to be notified realtime of when the machine went down.  Well I spent a few days developing a network monitor application that has since then grew into quite a nice suite.</p>
<p>I did some research and found out that the Twitter application had an API that could be called to post updates.  I did some further searching and found how to post to Twitter using PHP-CURL, and later on found that CURL was a standalone application that could be called from the commandline. With that, I found out what I needed to do and set it up.</p>
<h2>Prerequisites</h2>
<p>In order to make this work, you will need the following:</p>
<ul>
<li>Root access on a linux box running APCUPSd with a known working good configuration.</li>
<li>Two twitter accounts, one for your phone and one for your monitor application.</li>
<li>the CURL application installed on your linux box. (Ubuntu users can <strong>apt-get install curl</strong> to install it automatically)</li>
</ul>
<p>I&#8217;m not going to cover how to set up a new Twitter account. I&#8217;m sure everyone has been beaten over the head with it already.</p>
<h2>1:  You must follow your newly created friend</h2>
<p>Twitter for SMS will work if these conditions are met:</p>
<ol>
<li>You have a twitter account that you receive twitter messages on.</li>
<li>Your twitter account must &#8220;follow&#8221; your monitor application&#8217;s twitter account.</li>
</ol>
<p>In this case, I have set up &#8220;trs_netstat&#8221; as my monitor application&#8217;s twitter account and I follow it with my own twitter account.</p>
<p><strong>Notes:</strong><strong> </strong>A cellphone plan with unlimited SMS is a REQUIREMENT, I used almost 2200 SMS messages last month.  I also recommend enabling privacy mode on your accounts so that way you&#8217;re not broadcasting to the world that your UPS is running on battery.</p>
<p>In order to make sure that your computer can successfully communicate with Twitter, use the syntax below:</p>
<p><code><br />
root@linux ~ # curl -u <em>{twitter username}</em>:<em>{twitter password}</em> -d status="This is a test message." http://twitter.com/statuses/update.xml<br />
</code></p>
<p>If everything works the way it should, you should in turn get a lot of XML data back.  This is a good thing.  If you got a lot of XML data but no post on the Twitter site, look for the following line in your XML</p>
<p><code><br />
&lt;error&gt;Not found&lt;/error&gt;<br />
</code></p>
<p>This means that the URL you specified is incorrect, and other errors will show up in the XML, typically with the &lt;error&gt;&lt;/error&gt; tags.</p>
<h2>2: Create the scripts&#8230; or not?</h2>
<p>I read up on the APCUPSD website on how to customize how apcupsd behaves when certain events are triggered.</p>
<blockquote><p>To write your own routine for the <tt><span>powerout</span></tt> action, you create shell script named <tt><span>powerout</span></tt> and put it in the lib directory (normally /etc/apcupsd). When the <tt><span>powerout</span></tt> action is invoked by apcupsd, apccontrol will first give control to your script. If you want apccontrol to continue with the default action, simply exit your script with an exit status of zero. If you do not want apccontrol to continue with the default action, your script should exit with the special exit code of 99. However, in this case, please be aware that you must ensure proper shutdown of your machine if necessary.</p></blockquote>
<p>So waitasec&#8230; APCUPSd supports 21 different configuration options.  So if I want to get notification of all 21 events, I gotta write 21 scripts or create 21 symlinks?  How about, &#8220;Heck no!&#8221;</p>
<p>By adding a call to my script within apccontrol, I can ensure that I get all the notifications that apcupsd would send and there would be no need to set up 21 symlinks.</p>
<p>In my /etc/apcupsd/apccontrol on line 58, I added the call to my twitapc script shown below:</p>
<pre><code>
     if [ $? = 99 ] ; then
         exit 0
    fi
 fi
 ${SCRIPTDIR}/twitapc ${1} ${2} ${3} {$4}
 case "$1" in
     killpower)
         echo "Apccontrol doing: ${APCUPSD} --killpower on UPS ${2}"
</code></pre>
<p>The line that starts off with ${SCRIPTDIR} is the one you want to add.  The ${1} ${2} ${3} {$4} is important as this hands off variables that apccontrol was invoked with to twitapc for action.  Some of the variables passed are actions like &#8220;killpower&#8221; shown above, and one of them includes the UPS name.  You want to keep this information with twitapc so that you get these notifications.</p>
<h2>3: Add my script to your configuration (or &#8230;.)</h2>
<p>This is the twitapc script.  If it looks identical to the apccontrol script, that&#8217;s because it is.  I copied apccontrol and changed some of the variables to perform the calls I needed. Theapccontrol script already covered the events with good coverage so there wasn&#8217;t a need to rewrite an entire script.</p>
<pre><code>
#!/bin/sh
#
# Copyright (C) 1999-2002 Riccardo Facchetti
#
#  for apcupsd release 3.14.2 (15 September 2007) - debian
#
# platforms/apccontrol.  Generated from apccontrol.in by configure.
#
#  Note, this is a generic file that can be used by most
#   systems. If a particular system needs to have something
#   special, start with this file, and put a copy in the
#   platform subdirectory.
#
#
# These variables are needed for set up the autoconf other variables.
#
#----------------------------------------------------------------------
#
# Script modified for twitapc by FIRESTORM_v1.
#
#
#
#
#
#

prefix=/usr
exec_prefix=${prefix}

APCPID=/var/run/apcupsd.pid
APCUPSD=/sbin/apcupsd
SHUTDOWN=/sbin/shutdown
SCRIPTSHELL=/bin/sh
SCRIPTDIR=/etc/apcupsd
WALL=wall

#
#Leave the lines above alone, these are the lines you want to edit:
#
#
#
tw_user='Twitter Username'
tw_pass='Twitter Password'
tw_url='http://twitter.com/statuses/update.xml'
timestamp=$(date +%m%d%Y-%H%M)

case "$1" in
 killpower)
 msg="Apccontrol doing: ${APCUPSD} --killpower on UPS ${2}"
 sleep 10
 msg="Apccontrol has done: ${APCUPSD} --killpower on UPS ${2}"
 ;;
 commfailure)
 msg="Warning communications lost with UPS ${2}"
 ;;
 commok)
 msg="Communications restored with UPS ${2}"
 ;;
#
# powerout, onbattery, offbattery, mainsback events occur
#   in that order.
#
 powerout)
 ;;
 onbattery)
 msg="Power failure on UPS ${2}. Running on batteries."
 ;;
 offbattery)
 msg="Power has returned on UPS ${2}..."
 ;;
 mainsback)
 msg="Mains power restored on UPS ${2}..."
 ;;
 failing)
 msg="Battery power exhaused on UPS ${2}. Doing shutdown."
 ;;
 timeout)
 msg="Battery time limit exceeded on UPS ${2}. Doing shutdown."
 ;;
 loadlimit)
 msg="Remaining battery charge below limit on UPS ${2}. Doing shutdown."
 ;;
 runlimit)
 msg="Remaining battery runtime below limit on UPS ${2}. Doing shutdown."
 ;;
 doreboot)
 msg="UPS ${2} initiating Reboot Sequence"
 ;;
 doshutdown)
 msg="UPS ${2} initiated Shutdown Sequence"
 ;;
 annoyme)
 msg="Power problems with UPS ${2}. Please logoff."
 ;;
 emergency)
 msg="Emergency Shutdown. Possible battery failure on UPS ${2}."
 ;;
 changeme)
 msg="Emergency! Batteries have failed on UPS ${2}. Change them NOW"
 ;;
 remotedown)
 msg="Remote Shutdown. Beginning Shutdown Sequence."
 ;;
 startselftest)
 ;;
 endselftest)
 ;;
 battdetach)
 ;;
 twittest)
 msg="TwitAPC Test Message"
 echo "Test message sent. Please check your phone."
 ;;
 battattach)
 ;;
 *)  echo "Usage: ${0##*/} command"
 echo "       warning: this script is intended to be launched by"
 echo "       apcupsd and should never be launched by users."
 echo " To test your twitter connection, run the below command:"
 echo " # twitapc twittest"
 exit 1
 ;;
esac

if [ -n "$msg" ]

 then
 curl -o /dev/null -s -u $tw_user:$tw_pass -d status="$msg ::$timestamp" $tw_url
fi
</code></pre>
<p>( I apologize that this code is not properly indented. The HTML editor application stripped out the whitespace. )</p>
<p>All that is needed is to adjust the $tw_username and the tw_password to match your account settings.  If you want to test it, just run it from command line with the parameter twittest</p>
<pre><code>
root@littleblackbox:/etc/apcupsd# ./twitapc twittest
Test message sent. Please check your phone.
</code></pre>
<p>This will send the test message.  If it isn&#8217;t working for you, remove the &#8220;-o /dev/null -s &#8221; from the curl statement at the bottom of the script.</p>
<h2>4:  Profit!!!</h2>
<p>If the twitter test message worked, then you&#8217;re in it for real.  Test it out by, you guessed it, pulling out the UPS power cord from the wall socket.  Of course the UPS will switch to battery and will start beeping, but within a few seconds, you should get a text message from Twitter with the user ID of the account specified in twitapc.</p>
<p>After a few seconds, plug it back in and you should get two more after power is restored and the system is back to normal.</p>
<p>Here is a screenshot of my network monitor twitter page with some sample notifications on it.</p>
<p><img class="aligncenter size-full wp-image-67" title="trs_netstat twitter" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/08/trs_netstat-twitter1.bmp" alt="trs_netstat twitter" /></p>
<p>I added a timestamp to the script as my phone doesn&#8217;t always display timestamps on it&#8217;s text messages. It&#8217;s formatted MMDDYYYY-HHMM and can be easily changed in the script</p>
<p>I am always interested to hear your comments and your suggestions.  If you have a success story, by all means tell me.<br />
Have fun and happy twitter-ups-ing..</p>
<p>FIRESTORM_v1</p>
]]></content:encoded>
			<wfw:commentRss>http://www.yourwarrantyisvoid.com/2009/08/18/make-apcupsd-tweet-for-help/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Setting up Ubuntu to tftpboot with menu for installations</title>
		<link>http://www.yourwarrantyisvoid.com/2009/08/17/setting-up-ubuntu-to-tftpboot-with-menu-for-installations/</link>
		<comments>http://www.yourwarrantyisvoid.com/2009/08/17/setting-up-ubuntu-to-tftpboot-with-menu-for-installations/#comments</comments>
		<pubDate>Mon, 17 Aug 2009 05:02:25 +0000</pubDate>
		<dc:creator>firestorm_v1</dc:creator>
				<category><![CDATA[How-To's]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[network boot]]></category>
		<category><![CDATA[PXE]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[TFTP]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.yourwarrantyisvoid.com/?p=27</guid>
		<description><![CDATA[This howto will cover performing the necessary steps for configuring Ubuntu Server 9.04 to distribute pxelinux images over the network for you to use to install Ubuntu or your favorite Linux distribution over the network. No more fumbling for installation CDs or boot floppies! I have done countless Linux installations where a Boot CD or [...]]]></description>
			<content:encoded><![CDATA[<p><img class="aligncenter size-full wp-image-28" title="servers" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/08/servers.JPG" alt="servers" width="513" height="137" /></p>
<p>This howto will cover performing the necessary steps for configuring Ubuntu Server 9.04 to distribute pxelinux images over the network for you to use to install Ubuntu or your favorite Linux distribution over the network.  No more fumbling for installation CDs or boot floppies!<br />
<span id="more-27"></span></p>
<p>I have done countless Linux installations where a Boot CD or a boot floppy was required to install with.  Typically I&#8217;d find that media was scratched or otherwise inoperable.  Fed up with it, I sought out a solution to make it work to where I didn&#8217;t need a CD or a floppy disk.  This HOWTO will take you from a Ubuntu server to an Ubuntu Server that now allows for TFTP booting!  It&#8217;s not as hard as it sounds and I completed my installation in little over an hour.  The longest part was to mount the CDROM images and perform the copy.</p>
<p>While not all network adapters support PXE booting, most onboard NICs do.  If unsure, there&#8217;s nothing wrong with keeping a network bootable NIC in your parts drawer for use later.</p>
<h2>Prerequisites:</h2>
<p>Required:</p>
<ul>
<li>Root access on a computer already set up with Ubuntu Server that has a valid IP address and is connected to the network.</li>
<li>A computer with a bootable network card (I recommend the Intel Pro 100 series) or an installation of VMware for testing the TFTP boot environment.</li>
<li>A Hub, Switch or router that can act like a hub or switch.</li>
<li>Linux installation CDs of the distribution you want to use. (For this installation, I will be using CentOS 5 as the install to make available on the network)</li>
<li>Access to edit the DHCP configuration of the server handing out IP addresses.</li>
<li>A copy of the Ultimate Boot CD, or the ISO image to the UBCD.  The UBCD can be downloaded from <a href="http://www.ultimatebootcd.com/">http://www.ultimatebootcd.com/</a></li>
<li>A copy of the pxelinux.0 file from <a href="http://syslinux.zytor.com/wiki/index.php/Download">http://syslinux.zytor.com/</a></li>
</ul>
<p>This document assumes that you have basic knowledge of Linux as far as navigating the filesystem and filesystem structure.  Since this is considered &#8220;administration level&#8221; work, this will require that you work as the &#8220;root&#8221; user and understand the ramifications of using this level of access.  If you have questions about a specific command, either continue reading without performing the step or perform some Google searches to find out what the command does.  This document will not require you to compile anything or know any significant amount of code and examples are provided so that you can cut and paste as much as possible.</p>
<h2>Overview</h2>
<p>This howto is  broken up into several sections to make reading a bit easier.  Feel free to leave comments on what works and what doesn&#8217;t and ask for help if you desire.</p>
<ul>
<li>Installation and configuration of tftpd-hpa for Ubuntu</li>
<li>File placement in the /tftpboot directory</li>
<li>Configuration of pxelinux.0 and the DHCP server</li>
<li>Installation of VSFTPd for Ubuntu</li>
<li>MD5sum, Mounting, Copying and Unmounting the disk images</li>
<li>Configuring boot menus using the menu.c32 from the UBCD</li>
<li>Troubleshooting</li>
<li>Tips and Tricks</li>
</ul>
<p style="padding-left: 30px;">Commands that you can use are highlighted in <strong>bold</strong> with examples being shown in a code box.</p>
<p style="padding-left: 30px;"><span style="text-decoration: underline;"><strong>WARNING:</strong></span> This signifies a critical message that needs to be read and understood prior to command execution otherwise system damage may result</p>
<p style="padding-left: 30px;"><strong>NOTE:</strong> This is an informational note that you might want to consider for better understanding od a command used.</p>
<p style="padding-left: 30px;"><em>Options in italics</em><strong> </strong>are parameters to a command that need to be supplied.  If an option is surrounded by curly brackets {<em>like this</em>} it is indicating an additional option that may vary on your system.  If an option <em><strong>shows up in bold and italics</strong> </em>, then it is meant to be used together as a command referenced.</p>
<p style="padding-left: 30px;">&#8220;Files in quotes&#8221; are either representative of screen output or a file that will be worked with. This will be context sensitive.</p>
<h2>Installation and Configuration of TFTPD-HPA for Ubuntu</h2>
<p>With all that prep talk out of the way, let&#8217;s get started.  Go ahead and log into the server that you will be performing the install on.</p>
<p>First off, let&#8217;s make sure that you&#8217;re root, by typing <strong>whoami</strong> in the login window:</p>
<pre><code>root@littleblackbox:~# whoami
root</code></pre>
<p>If <strong>whoami</strong> returns something other than &#8220;root&#8221;, then either <strong>su &#8211; </strong>and become root or ask for assistance.</p>
<p>Now that you&#8217;re root, we will tell the server to get the tftpd-hpa package from the Ubuntu repository. We&#8217;ll use the command <strong>apt-get <em>install tftpd-hpa</em></strong> This will tell apt-get to fetch the application and install it to your machine so you can use it.</p>
<pre>
<code>root@littleblackbox:~# apt-get install tftpd-hpa
 </code></pre>
<p>You will see a lot of fetch text scroll back but as long as it shows up that &#8220;tftpd-hpa installed successfully&#8221; then you are good to go on to the next step.  First off, we need to decide where the &#8220;tftpboot&#8221; directory will live that is used by tftpd-hpa to distribute.</p>
<p style="padding-left: 30px;"><strong>NOTE:</strong> Ubuntu by default will create a &#8220;/var/lib/tftpboot&#8221; directory as part of the tftpd-hpa installation. You can keep this path if you want, however in my installation I chose to go with &#8220;/tftpboot&#8221; instead.  If you wish to use &#8220;/var/lib/tftpboot&#8221; then be sure to substitute that path in place of &#8220;/tftpboot&#8221;.</p>
<p>I went ahead and created the &#8220;/tftpboot&#8221; directory by using the following command:</p>
<pre>
<code> root@littleblackbox:~# mkdir /tftpboot
</code></pre>
<p>Now that we have the directory, we need to edit the &#8220;/etc/defaut/tftpd-hpa&#8221; file so that the application has the correct information to start:</p>
<pre><code>
#Defaults for tftpd-hpa
RUN_DAEMON="no"
OPTIONS="-l -s /var/lib/tftpboot"
</code></pre>
<p>Change the &#8220;RUN_DAEMON&#8221; from no to yes, and change the &#8220;OPTIONS&#8221; to reflect where you want the tftpboot files to go.  My file looks like the one below:</p>
<pre><code>#Defaults for tftpd-hpa
RUN_DAEMON="yes"
OPTIONS="-l -s /tftpboot"
 </code></pre>
<p>This tells the tftpd-hpa application to always run and that we want to use the &#8220;/tftpboot&#8221; directory to serve our image. Now we need to start the service:</p>
<pre><code>
root@littleblackbox:~# /etc/init.d/tftpd-hpa start
Starting HPA's tftpd: in.tftpd.
</code></pre>
<p>If the display shows &#8220;in.tftpd.&#8221; then you&#8217;re successful, Pretty easy so far, but now we get into the harder stuff.</p>
<h2>File Placement in the /tftpboot directory</h2>
<p>Now that we have our tftp server running, let&#8217;s put some files in place.</p>
<ul>
<li>Copy the pxelinux.0 to /tftpboot</li>
<li>Copy the menu.c32, chain.c32 from the UBCD to /tftpboot</li>
<li>Copy the memtest image from the UBCD to /tftpboot/images</li>
<li>Copy the defaults.cfg from the UBCD to /tftpboot/menus/</li>
</ul>
<p>While you&#8217;re at it, let&#8217;s make two directories as well:</p>
<pre><code>
root@littleblackbox:/tftpboot#mkdir menus
root@littleblackbox:/tftpboot#mkdir images
root@littleblackbox:/tftpboot#mkdir pxelinux.cfg
</code></pre>
<p>The &#8220;menus&#8221; directory will be where we will place the menu files, the &#8220;images&#8221; directory is for the boot disk images that we&#8217;ll link to in the menus that we&#8217;ll create, and the &#8220;pxelinux.cfg&#8221; directory will be where we place the configuration file for the PXE loader.  The PXE loader is capable of so much more than just what we&#8217;re doing here, but that is way outside the scope of this howto.</p>
<p style="padding-left: 30px;"><strong>NOTE:</strong> Keeping this directory organized is important.  Duplicate filenames and mis-coded directory paths are the most common foul-ups when working with tftp or when working with files in general.  Cleanliness may be next to Godliness, but in a linux server, it&#8217;s vital to prevent &#8220;oops&#8221;es.</p>
<h2>Configuration of pxelinux.0 and the DHCP server</h2>
<p>Some of you that did some prior research may be screaming &#8220;What about the DHCP server?&#8221;   Well that&#8217;s coming up, but first we gotta finish building the TFTP configuration so we can test it first.</p>
<p>First off, let&#8217;s create a file in &#8220;/tftpboot/pxelinux.cfg&#8221; called &#8220;default&#8221;.  This is important because as soon as PXElinux bootstraps the machine, it&#8217;s going to want to find a configuration file.  If no file is specified, the machine will scout about looking for a configuration in the &#8220;pxelinux.cfg&#8221; directory until it either finds one at which point it will boot the image specified or it will give up and sit there with some error on the screen.</p>
<p>For the &#8220;default&#8221; configuration file, copy and paste this in.</p>
<pre><code>
default main
 prompt 1
 timeout 15
 label main
 kernel menu.c32
 append menus/main.mnu
 </code></pre>
<p>The first line <strong>default</strong> tells pxelinux to show the item with the same label as the default selected boot option. If the <strong>timeout</strong> value is reached (15 seconds), then that boot image is started if it is available.</p>
<p>The second line <strong>prompt 1</strong> forces pxelinux to show the &#8220;boot:&#8221; prompt after it has loaded.</p>
<p>The third line <strong>timeout <em>15</em></strong> sets the boot delay to give you the option of entering a boot image.  It&#8217;s not really used in this configuration as we will be &#8220;booting&#8221; the menu system, but it&#8217;s there to keep the configuration standards compliant, which is always a good thing.</p>
<p>The fourth, fifth and sixth lines make up the default boot image that we want to load and is a format you&#8217;ll want to remember for later.  It will come back to you again.</p>
<ol>
<li><strong>LABEL</strong> <em>main</em> &#8211;  This is how the item is presented at boot time (or menu generation time).</li>
<li><strong>KERNEL</strong> <em>menu.c32</em> &#8211; This is the kernel image to boot if the option is selected.</li>
<li><strong>APPEND</strong> <em>menus/main.mnu</em> &#8211; This line specifies any additional kernel level options that the kernel needs to operate. Typically there may be a call to an initrd (initial ramdisk) or some other commands.  This specific line tells the &#8220;menu.c32&#8243; menu kernel to load the &#8220;menus/main.mnu&#8221; menu as a boot parameter to get the menu to render.</li>
</ol>
<p>Save the file as &#8220;default&#8221; within the &#8220;/tftpboot/pxelinux.cfg&#8221; directory. Now that we have the default configuration created, it&#8217;s time to create the first menu.  Don&#8217;t worry too much about the parameters right now as we&#8217;ll go over them in the next section.  Copy and past this into a text editor and save it as &#8220;main.mnu&#8221;</p>
<pre><code>
MENU INCLUDE /menus/defaults.cfg
LABEL memtest
 MENU LABEL Memtest86 V3.3
 KERNEL /images/memtest
</code></pre>
<p>This will be the first menu in your menu system.  Since we&#8217;ve finished with the tftpboot directory, let&#8217;s compare.   I use the command <strong>tree</strong> to print out this list, you can <strong>apt-get install tree</strong> to compare it or just compare the list with your &#8220;/tftpboot&#8221; directory contents:</p>
<pre><code>
root@littleblackbox:/# tree /tftpboot
/tftpboot
|-- images
| `-- memtest
|-- menu.c32
|-- menus
| |-- defaults.cfg
| `-- main.mnu
|-- pxelinux.0
`-- pxelinux.cfg
     `-- default
</code></pre>
<p>Now, there is one critical bad thing that we&#8217;ve been missing. It&#8217;s also the only thing preventing us from testing the installation at this point.  We need to configure the DHCP server!</p>
<p style="padding-left: 30px;"><strong>NOTE:</strong> The following instructions are for Linux and are tailored for a situation where the DHCP server is on the same computer as the TFTP server.  This is important as the directives we add to your configuration tell the TFTP client where to go to get the image needed to boot the machine.  If you have another server that serves IP addresses via DHCP, then you will need to adjust the IP address to point to the IP of the tftp server.  If you cannot adjust your DHCP server&#8217;s parameters, consider starting a DHCP server on this machine instead of using the unadjustable DHCP server.</p>
<p>When the PXE (or Preboot eXecution Environment) starts a machine, it has just enough software to initialize the NIC and pull for an IP address.  When the DHCP server responds to the PXE&#8217;s request, along with the IP address, it will provide a TFTP server address and the image name for booting.  The PXE then takes this information and attempts to download and execute the image from the TFTP server.</p>
<p>What this means is that you don&#8217;t have to have the TFTP server on the same machine as the DHCP server but you DO have to be able to get the TFTP server&#8217;s IP and the image name into the DHCP server. Otherwise, the PXE will be attempting to talk to a server that doesn&#8217;t exist or doesn&#8217;t have a TFTP service running or worse yet doesn&#8217;t have the image you&#8217;re looking for.</p>
<p style="padding-left: 30px;"><span style="text-decoration: underline;"><strong>WARNING:</strong></span> Editing the DHCP configuration file is platform dependent.  On Ubuntu, the configuration file is named &#8220;dhcpd.conf&#8221; and is located in &#8220;/etc/dhcp3&#8243; while Redhat on the other hand still calls their file name &#8220;dhcpd.conf&#8221; but stores it directly in &#8220;/etc&#8221;.  Your configuration may differ, you will need to find your configuration file and edit manually.</p>
<p>Edit the DHCP configuration file and within your subnet declaration, add two lines:</p>
<pre><code>
next-server 192.168.0.2;
filename "/pxelinux.0";
</code></pre>
<p>Here is a sample subnet declaration from my dhcpd.conf.  Don&#8217;t copy and paste the below text into your configuration as the directives may not match yours.</p>
<pre><code>
subnet 192.168.0.0 netmask 255.255.255.0 {
 range 192.168.0.20 192.168.0.50;
 default-lease-time 86400;
 max-lease-time 86400;
 option routers 192.168.0.1;
 option broadcast-address 192.168.0.255;
 option subnet-mask 255.255.255.0;
 next-server 192.168.0.2;
 filename "/pxelinux.0";
</code></pre>
<p>The <strong>next-server</strong> directive specifies the IP address of the TFTP server and the <strong>filename</strong> directive specifies the path to the image to boot.</p>
<p style="padding-left: 30px;"><strong>NOTE: </strong>All paths are relative according to &#8220;/&#8221; (the root) of the TFTP server.  So even though the file is &#8220;/tftpboot/pxelinux.0&#8243; the filename specified here is just &#8220;/pxelinux.0&#8243; because the &#8220;/&#8221; of the TFTP server is the directory &#8220;/tftpboot&#8221;.  Confused?  Good. :p</p>
<p>Restart your DHCP Server with the command below:</p>
<pre><code>
root@littleblackbox:/# /etc/init.d/dhcp3-server restart
* Stopping DHCP server dhcpd3 [ OK ]
* Starting DHCP server dhcpd3 [ OK ]
root@littleblackbox:/#
</code></pre>
<p>If your server restarted, let&#8217;s test it out!  Get your test rig or VMware installation together and try it out.  If everything is properly in place, you should boot to a blue screen with &#8220;Memtest 86 V3.3&#8243; highlighted.  Hit the &#8220;enter&#8221; key and see if it starts Memtest.  If it does, then congratulations, you&#8217;re up and running.  If it doesn&#8217;t work, scroll down to &#8220;Troubleshooting&#8221; and take a look at possible causes.</p>
<p>Here is a screenshot of PXElinux booting:</p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-35" title="pxelinux boot" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/08/pxelinux-boot.bmp" alt="pxelinux boot" width="576" height="320" /></p>
<p>Here is an image of the PXEboot menu.  You will only have the first option.  I configured my server first then thought this would make a good HOWTO so the other menu entries come up later.</p>
<p style="text-align: left;"><img class="aligncenter size-full wp-image-36" title="pxelinux menu" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/08/pxelinux-menu.bmp" alt="pxelinux menu" width="576" height="320" /></p>
<p style="text-align: left;">Hit enter and launch Memtest.  It should drop you to a screen that looks something like this:</p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-38" title="pxelinux memtest" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/08/pxelinux-memtest.bmp" alt="pxelinux memtest" width="576" height="320" /></p>
<p style="text-align: left;">If you&#8217;ve gotten this far and your test station launched Memtest with no errors, it&#8217;s time to go to the next section and set up VSFTPd so we can actually have stuff to install. As it is, you have a fully capable memory tester on your hands.  All you need now is a computer that boots from TFTP and you no longer need to look for those long lost Memtest floppies! Of course, this is merely scratching the surface of what you can do.  Let&#8217;s go on to the next section where we will start getting a major distribution in place for installation.</p>
<h2 style="text-align: left;">Installation of VSFTPd for Ubuntu</h2>
<p>Well, we have made it this far and we&#8217;re actually closer to completion than you would think.  So far we have accomplished the following tasks:</p>
<ol>
<li>We&#8217;ve set up tftpd-hpa on our Ubuntu server.</li>
<li>We&#8217;ve configured it to stay running in memory and given it a location and files to serve.</li>
<li>We&#8217;ve configured pxelinux so that the client can find all the files necessary to boot the menu system.</li>
<li>We&#8217;ve configured the menu system with a test image to distribute and,</li>
<li>We have successfully TFTPbooted pxelinux, the menu system and the memtest image and know it all works.</li>
</ol>
<p>Now we need to install VSFTPd which is an FTP server for Linux.  &#8220;Why FTP?&#8221;, you ask.  The reason is simple.  FTP is easier to configure than Apache (the Linux Webserver) and is the default network installation method for most linux distributions.  While technically you could install using HTTP, you&#8217;d have to configure Apache on your server and if you&#8217;re using Apache to host files to the public internet, then you&#8217;d have to create a virtual host and all that mess.  FTP is much easier to set up and easier in this case is a good thing.</p>
<p>So, let&#8217;s start off by installing VSFTPd</p>
<pre>root@littleblackbox:/# apt-get install vsftpd</pre>
<p>You&#8217;ll see a lot of text fly by and at the end you will see that the server was started.  Unlike most FTP servers, VSFTPd has it&#8217;s own home directory in &#8220;/home&#8221; and not &#8220;/var/lib/ftp&#8221; or &#8220;/var/ftp&#8221; (as is common on some RedHat systems.  Now that we have the VSFTPd server installed, it&#8217;s time for more directory creating.  Since I use my FTP server for more than just storing images and installation media, I recommend the below hierachy to keep everything making sense.   Remember the note from the file placement section about keeping things clean?  Well now it&#8217;s going to get implemented to the extreme.  Since this is YOUR ftp server, you can do whatever you want, but take these guidelines into advisement:</p>
<ul>
<li>Keep your installation files away from other files by placing them in a different directory</li>
<li>Keep your directory structure simple, but don&#8217;t afraid to use subdirectories.</li>
<li>On the other hand, don&#8217;t use too many subdirectories.  You don&#8217;t want to have to remember a long path like &#8220;/dist/var/ftp/server/os/i386/redhat/Centos/5.2/installer&#8221; but simply copying everything into the FTP server&#8217;s &#8220;/&#8221; is strongly discouraged.</li>
</ul>
<p>With my server, I have chosen this directory heirachy:</p>
<ul>
<li>/bootdisks &#8211; images for boot floppies, should I ever need one, here they are.</li>
<li>/dist &#8211; This tells me that there are complete linux distributions available in this folder.</li>
<li>/dist/iso &#8211; This tells me that the .iso CD images of the distributions available are here.</li>
<li>/dist/installer &#8211; This tells me that the installers I&#8217;m looking for are located here.</li>
<li>/dist/installer/centos5 &#8211; This tells me that the installer distribution for CentOS5 is in this directory.  This is the directory I give to the installer later.</li>
</ul>
<p style="padding-left: 30px;"><strong>Note:</strong> As stated previously, you don&#8217;t HAVE to use this heirachy, you could use /centos5 as your installation directory if you want.  If you are net-installing a bunch of distributions however, your FTP server root could get messy.</p>
<p>Ok, enough talk about orginazation, let&#8217;s get to making files:</p>
<pre><code>
root@littleblackbox:/# cd /home/ftp
root@littleblackbox:/home/ftp# mkdir bootdisks
root@littleblackbox:/home/ftp# mkdir dist
root@littleblackbox:/home/ftp# mkdir dist/iso
root@littleblackbox:/home/ftp# mkdir dist/installer
root@littleblackbox:/home/ftp# mkdir dist/installer/centos5
</code></pre>
<h2>MD5sum, Mounting, Copying and Unmounting the disk images</h2>
<p>If you haven&#8217;t already done so, go ahead and copy the CD images into your Ubuntu server.  You can use any folder, although a temporary empty folder is recommended.  I copied my files into ~/CentOS5. If available, make sure you copy the MD5sum file along with them to your temporary directory on the server.</p>
<p>CD into the directory and we can use MD5 to check these files using the syntax below:</p>
<pre><code>
root@littleblackbox:~/Centos5# md5sum -c md5sum.txt
</code></pre>
<p>This command ‘md5sum’ generates an MD5 hash which should be identical to what is in md5sum.txt. The MD5 hash is like a special checksum validation that you can use to validate that downloaded files match their sources on the server you downloaded them from. Using the above command, I get the below results indicating a valid match. If one of the files had been changed by even so much as a comma in a configuration file on the ISO, the test would have failed.</p>
<pre><code>
root@littleblackbox:~/Centos5# md5sum -c md5sum.txt
CentOS-5.3-i386-bin-1of6.iso: OK
CentOS-5.3-i386-bin-2of6.iso: OK
CentOS-5.3-i386-bin-3of6.iso: OK
CentOS-5.3-i386-bin-4of6.iso: OK
CentOS-5.3-i386-bin-5of6.iso: OK
CentOS-5.3-i386-bin-6of6.iso: OK
root@littleblackbox:~/Centos5#
</code></pre>
<p>If you don’t have the md5sum.txt, you can still use the md5sum application. Use the command below to generate the MD5 checksums of the ISO images:</p>
<pre><code>
root@littleblackbox:~/Centos5# md5sum *.iso
</code></pre>
<p>This command will output the MD5 checksum and the filename for each of the files. You then compare this to what is listed on the server where you got them and compare the numbers. If they do not match, you know you got a corrupted download. Here is the MD5sums of the ISO images I have:</p>
<pre><code>dd93a6da1b900548825159206099603c  CentOS-5.3-i386-bin-1of6.iso
 5441ae0a3c9efd47cd8bfab873fe20c1  CentOS-5.3-i386-bin-2of6.iso
 024ca72da4e14f79522a90bf8f4fdf9f  CentOS-5.3-i386-bin-3of6.iso
 95e5e446754e76b3fa07aaf4946c0aa9  CentOS-5.3-i386-bin-4of6.iso
 0cda242797ded4b6b2ea0469984aca82  CentOS-5.3-i386-bin-5of6.iso
 889ff6389108a85780a06cd38b7375e7  CentOS-5.3-i386-bin-6of6.iso
</code></pre>
<p>We have our FTP server and we have our validated ISO images. Now it’s time to get messy. The next part comes in mounting these CD iso images, then copying their contents to the FTP directory we made earlier. This can be tedious and can be done incorrectly, rendering a good amount of time wasted if you aren’t careful.</p>
<p style="padding-left: 30px;"><strong>NOTE: </strong>The instructions here are specific for CentOS 5.3 but are commonly applied to most CD based distribution  installers. When in doubt, check with your distribution&#8217;s web site about what you need to do to perform a network installation.  Some distribution vendors may require a different file path be created.</p>
<p>We’ll start off by creating a temporary directory within the temporary directory called “source” and another one called “destination” and then mount the first ISO image into the source directory by use of the loopback option. Once mounted, we’re going to copy everything from source and put it in destination, then unmount the ISO image and repeat for the other 5 images. You can see the commands I used below.</p>
<pre><code>
root@littleblackbox:~/Centos5# mkdir source
root@littleblackbox:~/Centos5# mkdir destination
root@littleblackbox:~/Centos5# mount -o loop CentOS-5.3-i386-bin-1of6.iso /source
root@littleblackbox:~/Centos5# cp -R ./source/* ./destination
root@littleblackbox:~/Centos5# umount ./source
root@littleblackbox:~/Centos5# mount -o loop CentOS-5.3-i386-bin-2of6.iso ./source
root@littleblackbox:~/Centos5# cp -R ./source/* ./destination
root@littleblackbox:~/Centos5# umount ./source
root@littleblackbox:~/Centos5# mount -o loop CentOS-5.3-i386-bin-3of6.iso ./source
root@littleblackbox:~/Centos5# cp -R ./source/* ./destination
root@littleblackbox:~/Centos5# umount ./source
root@littleblackbox:~/Centos5# mount -o loop CentOS-5.3-i386-bin-3of6.iso ./source
root@littleblackbox:~/Centos5# cp -R ./source/* ./destination
root@littleblackbox:~/Centos5# umount ./source
root@littleblackbox:~/Centos5# mount -o loop CentOS-5.3-i386-bin-4of6.iso ./source
root@littleblackbox:~/Centos5# cp -R ./source/* ./destination
root@littleblackbox:~/Centos5# umount ./source
root@littleblackbox:~/Centos5# mount -o loop CentOS-5.3-i386-bin-5of6.iso ./source
root@littleblackbox:~/Centos5# cp -R ./source/* ./destination
root@littleblackbox:~/Centos5# umount ./source
root@littleblackbox:~/Centos5# mount -o loop CentOS-5.3-i386-bin-6of6.iso ./source
root@littleblackbox:~/Centos5# cp -R ./source/* ./destination
root@littleblackbox:~/Centos5# umount ./source
</code></pre>
<p>What we’ve done now, is created a directory called “destination” and copied every CD to that directory, overlapping them. What this does is it puts all the CentOS install packages into one directory and adds the necessary additional files to the root of the directory where the installer can find them. Now that we’ve done this, we can move the ISO files to the FTP server’s ISO directory and the “destination” files to the centos5 directory. I also moved the md5sum.txt and renamed it to CentOS5-i386-MD5SUM.txt so that way I know that the md5sum.txt is related to those ISO images.</p>
<pre><code>root@littleblackbox:~/Centos5# mv *.iso /home/ftp/dist/iso
root@littleblackbox:~/Centos5# mv md5sum.txt /home/ftp/dist/iso
root@littleblackbox:~/Centos5# mv /home/ftp/dist/iso/md5sum.txt /home/ftp/dist/iso/CentOS-5.3-i386-MD5.txt
root@littleblackbox:~/Centos5# mv destination/* /home/ftp/dist/installer/centos5/
root@littleblackbox:~/Centos5# cd /home/ftp
root@littleblackbox:/home/ftp# chgrp -R nogroup *
</code></pre>
<p>The last step is key.  This makes sure that all the files in /home/ftp have the same group as the FTP user that VSFTPd runs with. Ok, so that’s the hard part. Now we have our installation files in place, our ISOs are in place (in case we need them again) and we’re ready to get those bootdisk images. Let’s take a look and see what we’re up against:</p>
<p>Every distribution has a directory of boot disks that they make available in case you&#8217;re doing an installation on a machine that doesn&#8217;t support CD booting.  All they do is start the system up with enough resources to start the machine and get it to the point where it can run the installation off of a CD.  Most installations also provide a network booting image that we can place in our TFTP server to netboot the entire installation.</p>
<p>Thankfully, Centos5 has that available.  There is a directory called &#8220;images&#8221; and within that there is a directory called &#8220;pxeboot&#8221;.  <strong>cd</strong> into the directory and let&#8217;s take a look.</p>
<pre><code>
root@littleblackbox:/home/ftp# cd dist/installer/centos5/images/pxeboot
root@littleblackbox:/home/ftp/dist/installer/centos5/images/pxeboot# ls
initrd.img  README  TRANS.TBL  vmlinuz
root@littleblackbox:/home/ftp/dist/installer/centos5/images/pxeboot#
</code></pre>
<p>Of course, it helps to read the README file.  This may contain important information on what we need to get this image to work properly.</p>
<pre><code>
root@littleblackbox:/home/ftp/dist/installer/centos5/images/pxeboot# cat README
The files in this directory are useful for booting a machine via PXE.

The following files are available:
vmlinuz - the kernel used for the installer
initrd.img - an initrd with support for all install methods and
 drivers supported for installation of CentOS
</code></pre>
<p>It doesn&#8217;t get any simpler than that.  The &#8220;vmlinuz&#8221; file is the kernel and &#8220;initrd.img&#8221; is the initial ramdisk for the install kernel.  Pretty simple.  The README did not make any mention of any boot options or parameters so for now we&#8217;ll just keep these two files in mind.  Other distributions may require some additional options be passed to the installer.</p>
<p>Copy the initrd.img and vmlinuz files to &#8220;/tftpboot/images&#8221; and we&#8217;ll <strong>cd</strong> into that directory for a little bit more work. Remember when I told you about keeping your &#8220;/tftpboot&#8221; directory clean?  Well, we&#8217;re vising that once again.  (Getting tired of it yet?) The name &#8220;vmlinuz&#8221; and &#8220;initrd.img&#8221; may make sense for one version of Linux to install, however those are very common names.  Let&#8217;s say you get  a copy of CentOS4 and you want to do network boot/install on that too?  There&#8217;s a pretty darn good chance that CentOS4 uses the same filenames! Since the initrd.img and vmlinuz are compiled for each other, you can&#8217;t go about using CentOS5&#8242;s initrd on CentOS4&#8242;s vmlinuz, they just won&#8217;t work.</p>
<p>So let&#8217;s start off by renaming the two files to something more descriptive.</p>
<pre><code>root@littleblackbox:/tftpboot/images# mv vmlinuz vmlinuz-Centos5-netboot
root@littleblackbox:/tftpboot/images# mv initrd.img initrd-Centos5-netboot
</code></pre>
<p>Now that we have new names for the files, it&#8217;s time for the section that I&#8217;m sure you&#8217;ve been dying to read.</p>
<h2>Configuring boot menus using the menu.c32 from the UBCD</h2>
<p>And to much fanfare, I&#8217;d expect. <img src='http://www.yourwarrantyisvoid.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />   So, let&#8217;s review again:</p>
<ol>
<li>We&#8217;ve set up tftpd-hpa on our Ubuntu server.</li>
<li>We&#8217;ve configured it to stay running in memory and given it a location and files to serve.</li>
<li>We&#8217;ve configured pxelinux so that the client can find all the files necessary to boot the menu system.</li>
<li>We&#8217;ve configured the menu system with a test image to distribute and,</li>
<li>We&#8217;ve successfully TFTPbooted pxelinux, the menu system and the memtest image and know it all works.</li>
<li>We&#8217;ve got our installation media in place on the FTP server with the proper file structure</li>
<li>We&#8217;ve got our boot images in place in &#8220;/tftpboot/images&#8221; and given them descriptive filenames</li>
</ol>
<p>Now we need to build a menu to select a menu and start the installer.  This is almost the last step, I promise.  Remember the main.mnu file from earlier? (Look down, I saved you the scrolling. )</p>
<pre><code>
MENU INCLUDE /menus/defaults.cfg
LABEL memtest
 MENU LABEL Memtest86 V3.3
 KERNEL /images/memtest
</code></pre>
<p>Well here is where we&#8217;re going to go over the options and add another image. Firstly, we are going to review what we have here:</p>
<ul>
<li><strong>MENU INCLUDE</strong><em><strong> /menus/defaults.cfg</strong></em> &#8211; This line should appear first at the top of every menu file. This tells the menu.c32 how to render your menu (colors, etc)</li>
<li><strong>LABEL <em>memtest</em></strong> &#8211; This tells the menu system that we are creating a new entry definition and that it&#8217;s name is &#8220;memtest&#8221;.  All <strong>label</strong> declarations must be unique.</li>
<li><strong>MENU LABEL <em>Memtest86 V3.3</em></strong> &#8211; This tells the menu system that the menu should display &#8220;Memtest86 V3.3&#8243; in it&#8217;s text as the selectable item</li>
<li><strong>KERNEL <em>/images/memtest</em></strong> &#8211; This tells the menu system that if this menu item is selected to boot the &#8220;/images/memtest&#8221; image and execute it.</li>
</ul>
<p>At this point, we could go ahead and declare a new entry definition and copy and paste however this will cause the machine to fail once the image is selected.  Remember, the image we want to make available is comprised of the kernel (vmlinuz) and the initial ramdisk (initrd.img).  The menu system will take an additional parameter called <strong>APPEND</strong> with additional options that are needed to get the kernel to work like installer parameters and <em>initrd statements.</em></p>
<p style="padding-left: 30px;"><strong>NOTE:</strong> Does this look familiar to you?  If you are thinking that it looks similar to the LILO boot menu then you are absoloutely correct.  There are some differences but mostly the same configuration for LILO can be used here.</p>
<p>All we need to do is to add <strong>APPEND</strong> to the menu for our new item and we can save it and test.  Add the following text into your main.mnu and let&#8217;s test it out</p>
<pre><code>
label Centos5
 menu label Install Centos 5
 kernel /images/vmlinuz-Centos5-netboot
 append initrd=/images/initrd-Centos5-netboot
</code></pre>
<p>That&#8217;s all there is to it.  We have our label, our menu label, our kernel statement and our append statement with the initrd in there. Try booting your test PC now.</p>
<p>If you select the &#8220;Install CentOS 5&#8243; option and after a few moments of watching text scroll around, you see the following screen, then congratulations! You have finished making your Ubuntu server network boot a Linux installer.</p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-43" title="pxelinux boot centos5install" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/08/pxelinux-boot-centos5install.bmp" alt="pxelinux boot centos5install" width="576" height="320" /></p>
<p>Go ahead and navigate the menus and when you come to the menu asking for FTP credentials, put the following information in:</p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-44" title="pxelinux centos ftp settings" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/08/pxelinux-centos-ftp-settings.bmp" alt="pxelinux centos ftp settings" width="576" height="320" /></p>
<p style="text-align: left;">When you hit OK to this screen, the installer will be attempting to fetch the information from the FTP server. Remember, until now we have been in the Preboot Execution Environment and are running in the initrd that was loaded when we selected to install CentOS5.  We have not even attempted FTP connectivity at this point.  A few nailbiting secconds later, and you should see this screen:</p>
<p style="text-align: left;"><img class="aligncenter size-full wp-image-45" title="welcometocentos5" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/08/welcometocentos5.bmp" alt="welcometocentos5" width="576" height="320" /></p>
<p style="text-align: left;">Go ahead and finish the installation if you&#8217;d like, or turn off the testing machine.</p>
<p style="text-align: left;">You&#8217;re all done.  I do hope that you enjoyed this HOWTO.  If you have any comments or suggestions, please leave them in the comments section of this article.  If you experienced any issues, please keep reading.</p>
<h2 style="text-align: left;">Troubleshooting</h2>
<p>So you got through the HOWTO but something didn&#8217;t go quite right, Hopefully we can get you running again.</p>
<p><em><strong>My onboard NIC  won&#8217;t boot. My computer shows TFTP followed by a bunch of periods and eventually says &#8220;TFTP OPEN TIMEOUT&#8221; .</strong></em></p>
<p>If you look at the top of the screen, I&#8217;m guessing you&#8217;ll see something that says &#8220;INTEL LANDesk (R) Service Agent, version 0.99b&#8221;.  If so, you will have to use a different NIC.  There was a firmware bug in .99B that resulted in a lot of PXEboot clients not being able to properly connect to a TFTP server.  Unfortunately the only fix was to update the NIC&#8217;s firmware which is a dicey thing to do anyways, especially with an onboard NIC.  I would recommend just going out and getting a different card.</p>
<p><em><strong>When booting my CentOS image, it says &#8220;KERNEL PANIC: No Init Found&#8221;</strong></em></p>
<p>This means that the booted kernel vmlinuz-Centos5-netboot couldn&#8217;t find the initrd to go with it.  I would start by looking at your menu file (main.mnu) and see if the<strong> APPEND <em>initrd=/images/initrd-Centos5-netboot</em></strong> image name is specified correctly.  Try your boot again after editing the file and you should be good to go.</p>
<p><em><strong>My PXE client says &#8220;File Not Found&#8221;</strong></em></p>
<p>Check &#8220;/etc/default/tftpd-hpa&#8221; and make sure that the path specified on the <strong>OPTIONS</strong> line is pointed to &#8220;/tftpboot&#8221; and make sure that the directory has the pxelinux.0 file in it.</p>
<p><em><strong>My PXE client pulls an IP address but times out when trying to download pxelinux.0.</strong></em></p>
<p>This means that either the wrong address was specified on the <strong>next-server</strong> line or that the TFTP server is not responding.  Check it by performing this command: <strong>/etc/init.d/tftpd-hpa restart</strong> and verify it&#8217;s running with <strong>ps auwxf | grep tftpd</strong></p>
<p><em><strong>My menu for CentOS 5 shows &#8220;CentOS5&#8243; instead of &#8220;Install CentOS 5&#8243;.</strong></em></p>
<p>Check your menu file and make sure that you have a <strong>MENU ITEM</strong> specified for this image. If no <strong>MENU ITEM</strong> is present, the menu system will fall back on to<strong> </strong>the name assigned on the <strong>LABEL</strong> line instead.</p>
<p><strong><em>How can I tell if my NIC will network boot?</em></strong></p>
<p>Without sticking it in to a machine and finding out if it works, there&#8217;s no guarantee that the NIC you have will boot.  There are clues that may help you though.  Look at the card and see if there is a chip on there that has the word &#8220;ATMEL&#8221; on it.  If there&#8217;s no ATMEL chip, but there&#8217;s a large socket where a chip should go, then unfortunately that card will not network boot.   If you plug it in to your computer doesn&#8217;t show any text or banner about UNDI, PXE or Etherboot, then you also may be out of luck.  If you have an onboard NIC, take a look in your BIOS and see if there is an option to enable network booting and try again.</p>
<p><em><strong>Will this PXE booting work over USB?  What about Wireless?</strong></em></p>
<ul>
<li>USB &#8211; Unfortunately there is not a PXE boot installation available for USB devices.  They get initialized by the OS far after the PXE hooks in to execute</li>
<li>Wireless &#8211; The same applies for USB, except if you are doing an installation to  a WIRED machine and you use a wireless bridge, you might be able to.  The wireless bridge is transparent to the network and PXE so it should function as if you were directly connected to a switch.</li>
</ul>
<h2>Tips and Tricks</h2>
<p>Ok, so you got the basics down, let&#8217;s examine some of the more advanced aspects of the menu system.</p>
<p style="padding-left: 30px;"><strong>Menu timeout to load a default image</strong> &#8211; Good for the memtest image.  Add &#8220;<strong>timeout <em>30</em></strong>&#8221; and &#8220;<strong>default <em>memtest</em></strong>&#8221; to the main.mnu.  This will tell the menu system  to boot the memtest image if no key is pressed in 30 seconds.</p>
<p style="padding-left: 30px;"><strong>Add a sub-menu</strong> &#8211; Want to add a submenu to the menu system?  This one&#8217;s easy.  Create a new <strong>LABEL</strong> in your main.mnu and add the following</p>
<pre style="padding-left: 30px;"><code>LABEL submenu1
 MENU LABEL Sub Menu 1
 KERNEL menu.c32
 APPEND /menus/submenu1.mnu
</code></pre>
<p style="padding-left: 30px;">Change the <strong>LABEL</strong>, <strong>MENU LABEL</strong> to reflect the new entry and change the <strong>APPEND</strong> line to point to your new submenu.  Copy your main.mnu to your submenu1.mnu file.  Edit it and add the necessary entries to that file.  If you want to have a &#8220;Go Back&#8230;&#8221; option, make your first entry&#8217;s <strong>APPEND</strong> line load &#8220;/menus/main.mnu&#8221;</p>
<p style="padding-left: 30px;"><strong>Change your menu&#8217;s  title.</strong></p>
<p style="padding-left: 30px;">One thing overlooked here was that my defaults.cfg was already edited for my server.  If you copied the one from the UBCD directly, then yours still will say &#8220;Ultimate Boot CD&#8221; at the top which is kind of funny because the machine you&#8217;re installing might not even have a CDROM to boot from.  Edit the defaults.cfg in the &#8220;/tftpboot/menus&#8221; directory and change the <strong>MENU TITLE </strong>directive to whatever you want.  Remember that you can not exceed 76 columns (80 columns &#8211; 4 for the borders) otherwise your menu may not display properly.</p>
<h2>Afterword</h2>
<p>If you would like more information on how to customize your boot menu, check out <a href="http://syslinux.zytor.com/wiki/index.php/Comboot/menu.c32">http://syslinux.zytor.com/wiki/index.php/Comboot/menu.c32</a> They go through the entire exhaustive option set with code examples and explanations of each option.  I have only posted information here that I have used and know works.</p>
<p>I have enjoyed writing this HOWTO and hope that someone out there finds it useful.  If you would like to make any comments about this HOWTO or want to share your netboot experience, please by all means leave me a comment.</p>
<p>Thank you for reading, Happy netbooting!</p>
<p>FIRESTORM_v1</p>
]]></content:encoded>
			<wfw:commentRss>http://www.yourwarrantyisvoid.com/2009/08/17/setting-up-ubuntu-to-tftpboot-with-menu-for-installations/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
