<?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>seigafuse.com &#187; Linux</title>
	<atom:link href="http://seigafuse.com/category/technology/systems-administration/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://seigafuse.com</link>
	<description>Mike Seigafuse&#039;s Technology and IT Security Blog</description>
	<lastBuildDate>Fri, 19 Mar 2010 14:54:59 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=abc</generator>
		<item>
		<title>Recovering a Linux server on different disk partitions</title>
		<link>http://seigafuse.com/2007/02/06/recovering-a-linux-server-on-different-disk-partitions/</link>
		<comments>http://seigafuse.com/2007/02/06/recovering-a-linux-server-on-different-disk-partitions/#comments</comments>
		<pubDate>Wed, 07 Feb 2007 03:54:50 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://seigafuse.com/?p=27</guid>
		<description><![CDATA[We lost a disk in the RAID 5 array on one our Dell 2550 Linux servers today. Usually this is no big deal, just replace the disk and the array rebuilds right? Not quite &#8211; for some unexplained reason the array was &#8220;inconsistent&#8221; and we had to destroy and rebuild the container. No big deal, [...]]]></description>
			<content:encoded><![CDATA[<p>We lost a disk in the RAID 5 array on one our Dell 2550 Linux servers today.  Usually this is no big deal, just replace the disk and the array rebuilds right?  Not quite &#8211; for some unexplained reason the array was &#8220;inconsistent&#8221; and we had to destroy and rebuild the container.  No big deal, we have backups so it should just be a matter of reinstalling the OS, installing our backup client software (NetWorker) and doing a restore allowing the restore to overwrite files.  This should be a no-brainer.  But, what if the disk was not partitioned on the new install the same as the original system?  Once the restore completed we have now overwritten /boot/grub/grub.conf with the file that matches the original install &#8211; what if the boot partition is no longer at the same location?</p>
<p>After the restore the system administrator attempted to reboot, and was informed that the system could not find the boot file.  Now what?  No worries, simply do the following:</p>
<ul>
<li>Insert the install CD and boot from it</li>
<li>Hit F5, and then enter Linux rescue</li>
<li>Select OK to search for Linux installs</li>
<li>Select continue to mount the install disk found</li>
</ul>
<p>Once you get to the command prompt do the following:</p>
<ul>
<li>cd /mnt/sysimage/boot/grub</li>
<li>TERM=VT100;export TERM</li>
<li>vi grub.conf</li>
</ul>
<p>You should see a file that looks like this:</p>
<blockquote><p># grub.conf generated by anaconda<br />
#<br />
# Note that you do not have to rerun grub after making changes to this file<br />
# NOTICE:  You do not have a /boot partition.  This means that<br />
#          all kernel and initrd paths are relative to /, eg.<br />
#          root (hd0,1)<br />
#          kernel /boot/vmlinuz-version ro root=/dev/sda2<br />
#          initrd /boot/initrd-version.img<br />
#boot=/dev/sda<br />
default=0<br />
timeout=10<br />
splashimage=(hd0,0)/boot/grub/splash.xpm.gz<br />
title Red Hat Enterprise Linux ES (2.4.21-40.EL)<br />
root <strong>(hd0,0)<br />
</strong> kernel /boot/vmlinuz-2.4.21-40.EL ro root=LABEL=/<br />
initrd /boot/initrd-2.4.21-40.EL.img<br />
title Red Hat Enterprise Linux ES (2.4.21-20.EL)<br />
root <strong>(hd0,0)<br />
</strong> kernel /boot/vmlinuz-2.4.21-20.EL ro root=LABEL=/<br />
initrd /boot/initrd-2.4.21-20.EL.img</p></blockquote>
<p>The bolded entries above are the ones of interest.  hd0 is obviously the first hard drive, and the 0 after the comma is the partition on that disk.  In our case the original system had the boot partition located on partition 1 but after the rebuild I changed it as indicated here to what you see 0.  If you aren&#8217;t sure which partition is which you should be able to enter command line mode in grub after your boot fails by entering &#8220;c&#8221;.  Then by entering &#8220;geometry (hd0)&#8221; which should display something like this:</p>
<blockquote><p>grub> geometry (hd0)<br />
drive 0&#215;80: C/H/S = 6637/255/63, The number of sectors = 106633728, /dev/sda<br />
Partition num: 0,  Filesystem type is ext2fs, partition type 0&#215;83<br />
Partition num: 1,  Filesystem type is ext2fs, partition type 0&#215;83<br />
Partition num: 2,  Filesystem type is ext2fs, partition type 0&#215;83<br />
Partition num: 4,  Filesystem type is ext2fs, partition type 0&#215;83<br />
Partition num: 5,  Filesystem type is ext2fs, partition type 0&#215;83<br />
Partition num: 6,  Filesystem type unknown, partition type 0&#215;82<br />
Partition num: 7,  Filesystem type is ext2fs, partition type 0&#215;83  grub></p></blockquote>
<p>Good information, but which one is /boot?  Try entering the below and you will get your answer:</p>
<blockquote><p>grub> find /boot/grub/grub.conf<br />
(hd0,0)</p></blockquote>
<p>Partition 0 is /boot on this system &#8211; your mileage may vary <img src='http://seigafuse.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://seigafuse.com/2007/02/06/recovering-a-linux-server-on-different-disk-partitions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
