<?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>Eric Mason &#187; ebs</title>
	<atom:link href="http://ericmason.net/tag/ebs/feed/" rel="self" type="application/rss+xml" />
	<link>http://ericmason.net</link>
	<description>From Fort Lauderdale, Ruby, Linux, Photography, and Random Things</description>
	<lastBuildDate>Tue, 15 Nov 2011 20:22:02 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Amazon EBS Snapshot Backups with LVM and XFS</title>
		<link>http://ericmason.net/2008/09/amazon-ebs-snapshot-backups-with-lvm-and-xfs/</link>
		<comments>http://ericmason.net/2008/09/amazon-ebs-snapshot-backups-with-lvm-and-xfs/#comments</comments>
		<pubDate>Mon, 22 Sep 2008 13:53:21 +0000</pubDate>
		<dc:creator>eric</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[amazon aws]]></category>
		<category><![CDATA[ebs]]></category>
		<category><![CDATA[ec2]]></category>
		<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[work]]></category>

		<guid isPermaLink="false">http://ericmason.net/?p=32</guid>
		<description><![CDATA[I&#8217;m working on setting up a server to host email accounts on Amazon EC2 using the newly released Elastic Block Storage.  My benchmarking has shown XFS to be better than ReiserFS for this task &#8211; and presumably EXT3, but I ran &#8230; <a href="http://ericmason.net/2008/09/amazon-ebs-snapshot-backups-with-lvm-and-xfs/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m working on setting up a server to host email accounts on <a href="http://aws.amazon.com/ec2">Amazon EC2</a> using the newly released Elastic Block Storage.  My benchmarking has shown XFS to be better than ReiserFS for this task &#8211; and presumably EXT3, but I ran out of patience.</p>
<p>Since I will need to grow the filesystem in the future, I am using LVM.  This also allows me to break up the logical volume into separate EBS volumes, which should increase random access performance.  <span id="more-32"></span></p>
<p>Right now for testing, I have a single LVM volume group and logical volume comprised of three &#8220;physical&#8221; EBS volumes of 100GB each. </p>
<p>Although EBS&#8217;s snapshot command completes quickly and the snapshots are consistent as of the time the command is run (there is a pause in access to the filesystem while the snapshot starts), the use of multiple EBS volumes complicates matters.  In order to get a consistent snapshot, the whole filesystem needs to be stopped while a snapshot is begun on each of the underlying EBS volumes.  Conveniently XFS has a &#8220;freeze&#8221; command to flush the whole filesystem and prevent writes until it is unfrozen.</p>
<p>Here&#8217;s my current snapshot script:</p>
<pre>#!/bin/bash

SNAP_CMD=/usr/local/ec2/bin/ec2-create-snapshot
MOUNT_POINT=/mail
export JAVA_HOME=/usr/lib/jvm/java-6-sun-1.6.0.06
export EC2_CERT=/mnt/aws-config/cert-XXXX.pem
export EC2_HOME=/usr/local/ec2
export EC2_PRIVATE_KEY=/mnt/aws-config/pk-XXXX.pem

vols=("vol-xxxx" "vol-xxxx" "vol-xxxx")
i=0
xfs_freeze -f $MOUNT_POINT

for vol in ${vols[@]}
do
        $SNAP_CMD $vol &#038;
        pids[i]=$!
        let i+=1
done

for pid in ${pids[@]}
do
        wait $pid
done

xfs_freeze -u $MOUNT_POINT
</pre>
<div><span><br />
</span></div>
<div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://ericmason.net/2008/09/amazon-ebs-snapshot-backups-with-lvm-and-xfs/&via=ericmason&text=Amazon EBS Snapshot Backups with LVM and XFS&related=:&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div>]]></content:encoded>
			<wfw:commentRss>http://ericmason.net/2008/09/amazon-ebs-snapshot-backups-with-lvm-and-xfs/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

