<?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>Spind.net Blog &#187; Reinstall</title>
	<atom:link href="http://blog.spind.net/tag/reinstall/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.spind.net</link>
	<description>Stories from the trenches of System Administration</description>
	<lastBuildDate>Mon, 19 Dec 2011 09:21:50 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>CentOS 5 Remote Reinstall over VNC</title>
		<link>http://blog.spind.net/2010/01/14/centos-5-remote-reinstall-over-vnc/</link>
		<comments>http://blog.spind.net/2010/01/14/centos-5-remote-reinstall-over-vnc/#comments</comments>
		<pubDate>Thu, 14 Jan 2010 21:26:57 +0000</pubDate>
		<dc:creator>hc</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[Installation]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Reinstall]]></category>
		<category><![CDATA[Remote]]></category>
		<category><![CDATA[VNC]]></category>

		<guid isPermaLink="false">http://blog.spind.net/?p=169</guid>
		<description><![CDATA[So you want to live your life on the edge, and do a remote reinstall of your server? The reasons can be many &#8211; maybe the server was compromised, or &#8211; like me &#8211; you just received a freshly installed new system with a horrible disk partitioning or maybe even the wrong choice of architecture. [...]]]></description>
			<content:encoded><![CDATA[<p>So you want to live your life on the edge, and do a remote reinstall of your server? The reasons can be many &#8211; maybe the server was compromised, or &#8211; like me &#8211; you just received a freshly installed new system with a horrible disk partitioning or maybe even the wrong choice of architecture. I&#8217;ll show you how! <img src='http://blog.spind.net/wp/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>I just received my dedicated server at bulk price, but unfortunately also with a bulk installation of CentOS. It&#8217;s fitted with two 250G disks, yet there is no mirroring or anything installed. On top of this, this delicious 64-bit system was running a 32-bit operating system. I was not amused. Asking for a special reinstall would probably cost me a fortune in support, and even then I probably wouldn&#8217;t get it exactly like I wanted it.</p>
<p>Luckily most new Linux distributions feature remote installation via VNC. If the system is already running Linux &#8211; like this one &#8211; its both easy and safe to play around with this method. In this example, we&#8217;ll be installing CentOS 5.4 x86_64.</p>
<p>Step 1: Get a hold of the bootstrap files. This includes the Linux kernel image and the ramdisk image. Put these on your /boot partition:</p>
<div class="codebox">
$ cd /boot<br />
$ mkdir centos5-x86_64<br />
$ cd centos5-x86_64<br />
$ wget http://mirror.leaseweb.com/centos/5.4/os/x86_64/isolinux/vmlinuz<br />
$ wget http://mirror.leaseweb.com/centos/5.4/os/x86_64/isolinux/initrd.img
</div>
<p>Step 2: Add an entry to the Grub boot loader. Adjust values for network (ip, netmask, dns, gateway) and pick a better VNC password than me. Copy the &#8220;root (&#8230;)&#8221; line from a working entry:</p>
<div class="codebox">
title CentOS 5 VNC Install<br />
        root (hd0,0)<br />
        kernel /centos5-x86_64/vmlinuz vnc vncpassword=foobar headless ip=1.2.3.4 netmask=255.255.255.0 gateway=1.2.3.1 dns=2.3.4.5 ksdevice=eth0 method=http://mirror.leaseweb.com/centos/5.4/os/x86_64/ lang=en_US keymap=us<br />
        initrd /centos5-x86_64/initrd.img
</div>
<p>Step 3: Ask the Grub boot loader to boot your new entry next time, and only next time. This makes a lot of sense if your hosting facility allows you to power cycle the server remote &#8211; and they should. Really. If you can&#8217;t do this yourself, at least you can have some support drone push the reset button if the server doesn&#8217;t come up. Note what number your new entry in the Grub configuration file has. First one is 0, second is 1 etc. I had two entries already, so that made my new entry number 2:</p>
<div class="codebox">
$ echo &#8220;savedefault &#8211;stage2=/boot/grub/stage2 &#8211;default=2 &#8211;once&#8221; | grub &#8211;batch
</div>
<p>Step 4: Reboot and be patient. Some servers take up to five minutes to come back up &#8211; probably because of a BIOS misconfiguration. Anyway, reboot it:</p>
<div class="codebox">
$ reboot
</div>
<p>Step 5: Connect to your server with your favorite VNC client. Mine&#8217;s <a href="http://sourceforge.net/projects/cotvnc/">Chicken of the VNC</a> <img src='http://blog.spind.net/wp/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  You&#8217;ll need to connect to port 5901, which in VNC-terms often is referred to as &#8220;Display 1&#8243;. Use the password you specified:</p>
<p><a href="/uploads/2010/01/vnc.png"><img src="/uploads/2010/01/vnc.png" alt="vnc" title="vnc" width="509" height="314" class="alignnone size-full wp-image-173" /></a></p>
<p>Step 6: Run the install <img src='http://blog.spind.net/wp/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />  After this, your neat remote installation will be wiped, so double check all your network settings.</p>
<p><a href="/uploads/2010/01/install.png"><img src="/uploads/2010/01/install-600x466.png" alt="install" title="install" width="600" height="466" class="alignnone size-medium wp-image-174" /></a></p>
<p>Good luck! <img src='http://blog.spind.net/wp/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.spind.net/2010/01/14/centos-5-remote-reinstall-over-vnc/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

