<?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>Brandon W. King&#039;s Blog &#187; mount</title>
	<atom:link href="http://www.brandonking.net/blog/tag/mount/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.brandonking.net/blog</link>
	<description>Blogging about Python, Bioinformatics, Programming, System Administration, Cognitive Science, Philosophy and Life</description>
	<lastBuildDate>Wed, 09 Dec 2009 01:24:43 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Rescuing a Linux installation</title>
		<link>http://www.brandonking.net/blog/2007/01/30/rescuing-a-linux-installation/</link>
		<comments>http://www.brandonking.net/blog/2007/01/30/rescuing-a-linux-installation/#comments</comments>
		<pubDate>Wed, 31 Jan 2007 00:35:00 +0000</pubDate>
		<dc:creator>Brandon W. King</dc:creator>
				<category><![CDATA[Computers/IT]]></category>
		<category><![CDATA[Error Fixes]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Systems Administration]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[debootstrap]]></category>
		<category><![CDATA[fdisk]]></category>
		<category><![CDATA[mount]]></category>
		<category><![CDATA[rsync]]></category>
		<category><![CDATA[system adminstration]]></category>

		<guid isPermaLink="false">http://blog.brandonking.net/?p=24</guid>
		<description><![CDATA[In an attempt to save a system without doing a fresh reinstall by copying the contents from dying hard drive to new hard drive using external hard drive enclosure. This method seems to have worked well for me. I&#8217;m posting it as reference so others have a guide to work from and improve upon. I [...]]]></description>
			<content:encoded><![CDATA[<p>In an attempt to save a system without doing a fresh reinstall by copying the contents from dying hard drive to new hard drive using external hard drive enclosure. This method seems to have worked well for me. I&#8217;m posting it as reference so others have a guide to work from and improve upon. I have only used this method once so make sure you know what you are doing if you follow the guide.</p>
<p>WARNING: Use the following formation at your own risk. Make sure you make proper backups. The following information may have errors or may not work properly<span style="font-weight: bold;"> and could possibly <span style="font-style: italic;">damage your system</span> or <span style="font-style: italic;">cause the loss of data</span>. Once again, <span style="font-style: italic;">use the following at your own risk</span>. Research how to use each individual command so you know what you are doing.</span></p>
<p><span style="font-weight: bold;">Guide to moving a Debian or Ubuntu Linux installation from an old hard drive to a new hard drive without re-installing.</span></p>
<ol>
<li>Attach external hard drive</li>
<li>Reboot computer into single user mode (i.e. rescue mode)</li>
<li>Find the new device of the external hard drive (probably sda or sdb) dmesg | grep hd; dmesg | grep sd</li>
<li>create new partions on new drive: fdisk /dev/sd(a,b, etc.)
<ol>
<li>create swap partition</li>
<li>create linux partition(s)</li>
</ol>
</li>
<li>initialize swap: mkswap</li>
<li>create filesystem (I&#8217;m using ext3): mkfs.ext3</li>
<li>Mount the new hard drive (referred to as /dev/sda2 from now on): mount -t ext3 /dev/sda2 /mnt</li>
<li>Use debootstrap to get base install (ubuntu edgy example): debootstrap edgy /mnt http://us.archive.ubuntu.com/ubuntu</li>
<li>Now the copy command: rsync -av &#8211;exclude=/dev &#8211;exclude=/sys &#8211;exclude=/mnt &#8211;exclude=/proc &#8211;exclude=/media / /mnt</li>
<li>Make partition bootable: fdisk /dev/sda2  # use the &#8216;a&#8217; option</li>
<li>Shutdown system and put in the new drive.</li>
<li>Get Grub working again:
<ol>
<li>Insert Ubuntu or other Debian based live CD (Knoppix is a good choice too).</li>
<li>Mount the new drive: mount -t ext3 /dev/hda2 /mnt</li>
<li>Install grub: install-grub &#8211;root-directory=/mnt /dev/hda2</li>
<li>chroot into new drive: chroot /mnt</li>
<li>edit /boot/grub/menu.lst
<ol>
<li>Update groot(hd0,)  #if bootable partition changed (i.e. Was /dev/hda5 is now /dev/hda2&#8230; Old: <span style="font-weight: bold;">groot(hd0,4)</span> New: <span style="font-weight: bold;">groot(hd0,1)</span></li>
<li>Update kopt=root #if bootable partition changed (i.e. Was /dev/hda5 is now /dev/hda2&#8230;  Old: <span style="font-weight: bold;">kopt=root=UUID=</span> or <span style="font-weight: bold;">kopt=root=/dev/hda5</span> New:  <span style="font-weight: bold;">kopt=root=/dev/hda2</span> (NOTE: There is probably a way of getting the new UUID of the new partition, in which case you can just update the UUID option, but I don&#8217;t know enough about this yet to offer advice&#8230; Feel free to post a comment if you know more.)</li>
</ol>
</li>
<li>type: update-grub</li>
</ol>
</li>
<li>Reboot and hope everything works properly.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.brandonking.net/blog/2007/01/30/rescuing-a-linux-installation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
