<?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>Liquid Salt &#187; tech support</title>
	<atom:link href="http://blog.tagfl.com/tag/tech-support/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.tagfl.com</link>
	<description>One man's journey to follow Man One</description>
	<lastBuildDate>Sat, 26 Jul 2008 00:32:53 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=9106</generator>
		<item>
		<title>Backing up your MBR</title>
		<link>http://blog.tagfl.com/2006/08/23/backing-up-your-mbr/</link>
		<comments>http://blog.tagfl.com/2006/08/23/backing-up-your-mbr/#comments</comments>
		<pubDate>Wed, 23 Aug 2006 20:57:45 +0000</pubDate>
		<dc:creator>jon</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[shell scripting]]></category>
		<category><![CDATA[tech support]]></category>

		<guid isPermaLink="false">http://blog.tagfl.com/?p=16</guid>
		<description><![CDATA[MBR stands for Master Boot Record. It is the part of your hard drive that tells where the partitions on that drive are located. It is also the part of your drive that becomes worthless if you try to install Windows on your hard drive after Linux. Of course, i have never done this &#8230; [...]]]></description>
			<content:encoded><![CDATA[<p>MBR stands for <strong>M</strong>aster <strong>B</strong>oot <strong>R</strong>ecord. It is the part of your hard drive that tells where the partitions on that drive are located. It is also the part of your drive that becomes worthless if you try to install Windows on your hard drive <em>after</em> Linux. Of course, i have never done this &#8230; more than twice.</p>
<p>So i came across a poor soul that had done this and wished he had kept a backup of his MBR and it got me thinking &#8220;i could automate that,&#8221; because I hate to do something like this more than once. So I wrote a quick bash script to handle the issue.</p>
<blockquote><p>#!/bin/sh</p>
<p>SAVETO=&#8221;/etc&#8221;</p>
<p># Do ATA drives<br />
for DRIVE in `ls -l /dev/hd* 2&gt;/dev/null | grep -v [0-9]$ | grep disk | cut -d&#8221;/&#8221; -f3`<br />
do<br />
dd if=/dev/$DRIVE of=$SAVETO/mbr-$DRIVE bs=512 count=1<br />
done</p>
<p># Do SCSI drives<br />
for DRIVE in `ls -l /dev/sd* 2&gt;/dev/null | grep -v [0-9]$ | grep disk | cut -d&#8221;/&#8221; -f3`<br />
do<br />
dd if=/dev/$DRIVE of=$SAVETO/mbr-$DRIVE bs=512 count=1<br />
done</p></blockquote>
<p>Obviously, there is a whole lot that could be done to improve the script (error checking, user notification, overkill), but if you aren&#8217;t already backing up your MBR, start here. Throw it into a cronjob and forget it &#8211; <em>cron.monthly</em> not <em>cron.hourly.</em></p>
<p><a href="http://files.tagfl.com/backup-mbr">Download it here.</a></p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fblog.tagfl.com%2F2006%2F08%2F23%2Fbacking-up-your-mbr%2F&amp;linkname=Backing%20up%20your%20MBR"><img src="http://blog.tagfl.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://blog.tagfl.com/2006/08/23/backing-up-your-mbr/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
