<?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/"
	xmlns:series="http://unfoldingneurons.com/"
	>

<channel>
	<title>Shane Sveller &#187; backup</title>
	<atom:link href="http://shanesveller.com/tag/backup/feed/" rel="self" type="application/rss+xml" />
	<link>http://shanesveller.com</link>
	<description>Somewhere between happy and total f**king wreck</description>
	<lastBuildDate>Thu, 07 Jan 2010 18:31:09 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=abc</generator>
		<item>
		<title>Live backups using LVM and dump</title>
		<link>http://shanesveller.com/2008/05/27/live-backups-using-lvm-and-dump/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=live-backups-using-lvm-and-dump</link>
		<comments>http://shanesveller.com/2008/05/27/live-backups-using-lvm-and-dump/#comments</comments>
		<pubDate>Tue, 27 May 2008 19:15:09 +0000</pubDate>
		<dc:creator>Shane</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[lvm]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://shanesveller.com/?p=42</guid>
		<description><![CDATA[If, like me, you&#8217;ve built your Ubuntu machine using LVM for all partitions except /boot, you can do a live backup of your system using LVM snapshots and the dump tool. # lvdisplay --- Logical volume --- LV Name /dev/odin/root_1 VG Name odin ... LV Size 30.00 GB ... Since my root partition is on]]></description>
			<content:encoded><![CDATA[<p>If, like me, you&#8217;ve built your Ubuntu machine using LVM for all partitions except <code>/boot</code>, you can do a live backup of your system using LVM snapshots and the <a href="http://surf.ap.seikei.ac.jp/~nakano/dump-restore/dump-restore-mini-HOWTO.en.html">dump tool</a>.<span id="more-27"></span></p>
<pre># lvdisplay
  --- Logical volume ---
  LV Name                /dev/odin/root_1
  VG Name                odin
  ...
  LV Size                30.00 GB
  ...</pre>
<p>Since my root partition is on LVM, I can do a snapshot to get a point-in-time view of the root partition even as the system is running and software is making changes to the filesystem. To create the snapshot:</p>
<pre>lvcreate -L 30G -s -n root_1_snap /dev/odin/root_1</pre>
<p>The arguments are: <code>lvcreate -L {size} -n {snapshot name} {lvm device path}</code></p>
<p>Then, you do a <code>dump</code> backup:</p>
<pre># dump 0uf odin.0.img /dev/mapper/odin-root_1_snap
  DUMP: Date of this level 0 dump: Mon Apr 28 10:52:39 2008
  DUMP: Dumping /dev/mapper/odin-root_1_snap (an unlisted file system) to odin.0.img
  DUMP: Label: none
  DUMP: Writing 10 Kilobyte records
  DUMP: mapping (Pass I) [regular files]
  DUMP: mapping (Pass II) [directories]
  DUMP: estimated 3130770 blocks.
  DUMP: Volume 1 started with block 1 at: Mon Apr 28 10:52:46 2008
  DUMP: dumping (Pass III) [directories]
  DUMP: dumping (Pass IV) [regular files]
  DUMP: Closing odin.0.img
  DUMP: Volume 1 completed at: Mon Apr 28 10:55:49 2008
  DUMP: Volume 1 3120540 blocks (3047.40MB)
  DUMP: Volume 1 took 0:03:03
  DUMP: Volume 1 transfer rate: 17052 kB/s
  DUMP: 3120540 blocks (3047.40MB) on 1 volume(s)
  DUMP: finished in 182 seconds, throughput 17145 kBytes/sec
  DUMP: Date of this level 0 dump: Mon Apr 28 10:52:39 2008
  DUMP: Date this dump completed:  Mon Apr 28 10:55:49 2008
  DUMP: Average transfer rate: 17052 kB/s
  DUMP: DUMP IS DONE</pre>
<p>The arguments are: <code>dump {level}uf {output file} {source device path}</code></p>
<p>Next, remove the snapshot to keep from hogging LVM space:</p>
<pre>  lvremove /dev/odin/root_1_snap
Do you really want to remove active logical volume "root_1_snap"? [y/n]: y
  Logical volume "root_1_snap" successfully removed</pre>
<p>Optionally, compress the backup image for safekeeping.</p>
<pre>gzip /backup/odin.0.img &amp;</pre>
<p>The ampersand (&amp;) will make the process run in the background. By doing this, I saved 71.2% of the size, down to an image that was 878MB from 3050MB!</p>
<p>To restore from said backup, assuming you have a ready ext3 partition of the appropriate size: Uncompress it if need be:</p>
<pre>gunzip /backup/odin.0.img.gz</pre>
<p>Then:</p>
<pre>cd / &amp;&amp; rrestore rf /backup/odin.0.img</pre>
]]></content:encoded>
			<wfw:commentRss>http://shanesveller.com/2008/05/27/live-backups-using-lvm-and-dump/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
