<?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>My Scripts and Tips &#187; CommVault</title>
	<atom:link href="http://www.tipsandscripts.net/archives/category/commvault/feed" rel="self" type="application/rss+xml" />
	<link>http://www.tipsandscripts.net</link>
	<description>Various things I&#039;ve found useful in my travels</description>
	<lastBuildDate>Mon, 22 Aug 2011 07:28:57 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Recovering a Linux System using CommVault</title>
		<link>http://www.tipsandscripts.net/archives/13</link>
		<comments>http://www.tipsandscripts.net/archives/13#comments</comments>
		<pubDate>Fri, 09 Nov 2007 08:29:25 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CommVault]]></category>
		<category><![CDATA[Linux and Unix]]></category>

		<guid isPermaLink="false">http://www.tipsandscripts.net/archives/13</guid>
		<description><![CDATA[Scope Linux is not Windows. You should not need to reinstall the operating system to restore it. This document describes a way to boot a Linux system from the Red Hat install CD so it can then be restored from a CommVault backup. It does not document how to do the actual restore within CommVault. [...]]]></description>
			<content:encoded><![CDATA[<p class="MsoNormal"><strong><span lang="EN-AU">Scope<o:p></o:p></span></strong></p>
<p class="MsoNormal"><span lang="EN-AU">Linux is not Windows. You should not need to reinstall the operating system to restore it. This document describes a way to boot a Linux system from the Red Hat install CD so it can then be restored from a CommVault backup.<span>  </span>It does not document how to do the actual restore within CommVault. It was tested on a system running Red Hat Enterprise Linux AS 3 Update 9 and CommVault 7 with Service Pack 1.</span></p>
<p class="MsoNormal"><span lang="EN-AU">This document only examines how to recover the operating system residing on local disks. It does not consider devices that might need additional kernel modules to be loaded. Nor does it consider external file systems such as those mounted via NFS or from a SAN. However, in the latter case that should not be an obstacle â€“ it should be possible to restore the OS and then, using that, restore everything else.</span></p>
<p class="MsoNormal"><strong><span lang="EN-AU">Assumptions<o:p></o:p></span></strong></p>
<ul>
<li>The system to be restored is completely gone â€“ itâ€™s OK to overwrite the old disks</li>
<li>The hardware is identical</li>
<li>The server is using Grub</li>
<li>The local disks can be accessed using a Red Hat install CD without additional kernel modules being needed</li>
</ul>
<p><span></span></p>
<p class="MsoNormal"><strong><span lang="EN-AU">Prerequisites<o:p></o:p></span></strong></p>
<p class="MsoNormal">You need the following:</p>
<ul>
<li>Details of all partitions, volume groups, logical volumes and file systems. Also keep a copy of /etc/fstab
<ul>
<li>Use the commands:
<ul>
<li>fdisk â€“l /dev/sda</li>
<li>vgdisplay â€“v</li>
<li>pvdisplay /dev/sda5</li>
</ul>
</li>
</ul>
</li>
</ul>
<ul>
<li> Network details including hostname, IP addresses, default gateway, contents of /etc/hosts and /etc/resolv.conf.
<ul>
<li>Use the commands:
<ul>
<li>ifconfig â€“a</li>
<li>cat /etc/hosts</li>
<li>cat /etc/resolv.conf</li>
<li>netstat â€“rn</li>
<li>hostname</li>
</ul>
</li>
</ul>
</li>
</ul>
<ul>
<li>A backup of the CommVault client
<ul>
<li>I included the following in my backup of the CommVault client:
<ul>
<li>/etc/CommVaultRegistry</li>
<li>/etc/rc.d/rc3.d/S99Galaxy</li>
<li>/etc/rc.d/rc3.d/K99Galaxy</li>
<li>/var/log/galaxy</li>
<li>/opt/galaxy</li>
</ul>
</li>
<li>If you donâ€™t have a copy of the client but itâ€™s backed up in CommVault try restoring it to a different location and then copying it across.</li>
<li>I was unable to install the CommVault client on to a machine that booted from the Red Hat CD. If you donâ€™t have a backup of the client then youâ€™re on your own.</li>
</ul>
</li>
</ul>
<ul>
<li>A copy of awk</li>
<li>Somewhere on the local server to copy the CommVault client to. I normally set up a separate /tmp file system. So, in the example below I used that space for the CommVault client. Iâ€™m sure you could use NFS or smbmount to mount a remote file system as an alternative. Another option might be to use the partition reserved for swap. Initially set it up with ext3. Once the restore is completed unmount it and convert it to swap.</li>
<li>And of course a CommVault backup of the server</li>
</ul>
<p><strong><span lang="EN-AU">Recovering the System<o:p></o:p></span></strong></p>
<p class="MsoNormal"><span lang="EN-AU">Boot up off the Red Hat install CD</span></p>
<p class="MsoNormal"><span lang="EN-AU">At the â€œboot:â€ prompt type:</span></p>
<p><pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;linux rescue</pre></p>
<p class="MsoNormal"><span lang="EN-AU">When prompted select the language to use and then the keyboard type. </span></p>
<p class="MsoNormal"><span lang="EN-AU">Select â€œYesâ€ to start the network interfaces on the system.</span></p>
<p class="MsoNormal"><span lang="EN-AU">Enter the network configuration recorded above.</span></p>
<p class="MsoNormal"><span lang="EN-AU">Skip searching for and mounting the file systems.</span></p>
<p class="MsoNormal">Configure the remaining network settings that will be needed:</p>
<ul>
<li>Set the hostname using the hostname command. For example:</li>
</ul>
<p><pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;hostname srvlnx05</pre></p>
<ul>
<li>Put the correct entries in /etc/hosts. For example:</li>
</ul>
<p><pre><pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;127.0.0.1&nbsp;&nbsp; localhost localhost.localdomain
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;192.168.1.5 srvlnx05.mycompany.com srvlnx05</pre></pre></p>
<ul>
<li>Put the DNS search path on /etc/resolv.conf. For example:</li>
</ul>
<p><pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;search mycompany.com</pre></p>
<ul>
<li>Set any required routes</li>
</ul>
<p class="MsoNormal"><span lang="EN-AU"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-AU">At the command prompt recreate the partitions using the information recorded above.</span></p>
<p class="MsoNormal"><span lang="EN-AU">Recreate any logical volumes. First do a vgscan, then create the physical volume, then the logical volumes. For example:</span></p>
<p><pre><pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;vgscan
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pvcreate /dev/sda5
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;vgcreate LocalVG /dev/sda5
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;lvcreate â€“l 64 --name tmpLV LocalVG
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;lvcreate -l 32 --name varLV LocalVG
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;lvcreate -l 14 --name testLV LocalVG</pre></pre></p>
<p class="MsoNormal"><span lang="EN-AU"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-AU">Once the partitions are created, recreate the file systems. Note that if labels were used in /etc/fstab you will need to create the file systems with the appropriate labels.</span></p>
<p class="MsoNormal"><span lang="EN-AU">For example:</span></p>
<p><pre><pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mkfs.ext3 â€“L /boot /dev/sda1
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mkfs.ext3 â€“L / /dev/sda2
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mkfs.ext3 /dev/LocalVG/tmpLV
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mkfs.ext3 /dev/LocalVG/varLV
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mkfs.ext3 /dev/LocalVG/testLV</pre></pre></p>
<p class="MsoNormal"><span lang="EN-AU">Format any swap partitions. For example:</span></p>
<p><pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mkswap /dev/sda3</pre></p>
<p class="MsoNormal"><span lang="EN-AU">In the example below I will be using the file system reserved for /tmp to store the CommVault client. As an alternative you could use space reserved for swap. Just convert it to a partition type of 83 and add a file system to it.</span></p>
<p class="MsoNormal"><span lang="EN-AU">Mount the file system. For example:</span></p>
<p><pre><pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mkdir /tmp/cv-client
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mount /dev/LocalVG/tmpLV /tmp/cv-client</pre></pre></p>
<p class="MsoNormal"><span lang="EN-AU">Copy the CommVault client. I had a tar archive on another server. For example:</span></p>
<p><pre><pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cd /tmp/cv-client
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ssh user@srvlnx02 â€œcat commvault.tar.gzâ€ | tar -zxf -</pre></pre></p>
<p class="MsoNormal"><span lang="EN-AU">Create symbolic links so that the CommVault client will be accessible from the correct paths. For example:</span></p>
<p><pre><pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ln -s /tmp/cv-client/opt /opt
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ln -s /tmp/cv-client/etc/rc.d /etc/rc.d
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ln -s /tmp/cv-client/etc/CommVaultRegistry /etc/CommVaultRegistry
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ln -s /tmp/cv-client/var/log /var/log/</pre></pre></p>
<p class="MsoNormal"><span lang="EN-AU">The CommVault start up script needs awk. Copy awk to /bin. For example:</span></p>
<p><pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;scp user@srvlnx02:/bin/awk /bin/.</pre></p>
<p class="MsoNormal"><span lang="EN-AU">Start CommVault. For example:</span></p>
<p><pre><pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cd /
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/etc/rc.d/rc3.d/S99Galaxy start</pre></pre></p>
<p class="MsoNormal"><span lang="EN-AU">Mount the file systems. For example:</span></p>
<p><pre><pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mkdir/tmp/cv-restore/
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mount /dev/sda2 /tmp/cv-restore
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mkdir /tmp/cv-restore/boot
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mount /dev/sda1 /tmp/cv-restore/boot
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mkdir /tmp/cv-restore/var
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mount /dev/LocalVG/varLV /tmp/cv-restore/var
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mkdir /tmp/cv-restore/test
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mount /dev/LocalVG/testLV /tmp/cv-restore/test</pre></pre></p>
<p class="MsoNormal">Restore the files using the CommVault management server. Specify the alternate location that you have mounted the file systems on (e.g. /tmp/cv-restore). You might want to exclude from the restore the following:</p>
<ul>
<li>If youâ€™re using a file system on the local disk to temporarily hold the CommVault client you might want to exclude it. In the example Iâ€™m using that would be /tmp.</li>
<li>Any file systems that you need to load kernel modules to access. For example, if you have file systems residing on SAN you might want to exclude them from the restore. Once you have the system up you can then restore them if need be.</li>
</ul>
<p><span lang="EN-AU">Once the restore has finished we need to make the system bootable. On my test system Iâ€™m using Grub. I used <a href="http://www.whoopis.com/howtos/howto_restore_mbr_grub.php">http://www.whoopis.com/howtos/howto_restore_mbr_grub.php</a> to guide me in this. I did a chroot to the root of the local disk before doing this step. You need to determine the root device. I looked in the restored grub.conf (boot/grub/grub.conf) for this information. In my case it was (hd0,0). Next run grub, specify the root device and then setup. For example:</span><br />
<pre><pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;chroot /tmp/cv-restore
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;grub
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;root (hd0,0)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;setup (hd0)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;quit
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;exit</pre></pre></p>
<p class="MsoNormal"><span lang="EN-AU">You will also need to make sure thereâ€™s a /proc file system on the local disk â€“ the system wonâ€™t boot correctly without it. For example:</span></p>
<p><pre><pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mkdir /tmp/cv-restore/proc
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;chmod 555 /tmp/cv-restore/proc</pre></pre></p>
<p class="MsoNormal"><span lang="EN-AU">Stop the CommVault client. For example:</span></p>
<p><pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/etc/rc.d/rc3.d/K99Galaxy stop</pre></p>
<p class="MsoNormal"><span lang="EN-AU">Unmount the file systems. For example:</span></p>
<p><pre><pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cd /
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;umount /tmp/cv-restore/boot
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;umount /tmp/cv-restore/var
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;umount /tmp/cv-restore/test
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;umount /tmp/cv-restore</pre></pre></p>
<p class="MsoNormal"><span lang="EN-AU">Unmount the file system that held the CommVault client:</span></p>
<p><pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;umount /tmp/cv-client</pre></p>
<p class="MsoNormal"><span lang="EN-AU">If you used a swap partition for your temporary file system then convert it to swap and format it. For example:</span></p>
<p><pre><pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sfdisk â€“change-id /dev/sda 3 82
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mkswap /dev/sda3</pre></pre></p>
<p class="MsoNormal"><span lang="EN-AU">Restart the server. </span></p>
<p class="MsoNormal">&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tipsandscripts.net/archives/13/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

