<?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>thinking sysadmin &#187; backup</title>
	<atom:link href="http://andyleonard.com/tag/backup/feed/" rel="self" type="application/rss+xml" />
	<link>http://andyleonard.com</link>
	<description>qstat -u aleonard -s z</description>
	<lastBuildDate>Fri, 30 Jul 2010 17:47:40 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>VMware/NFS/NetApp SnapRestore/Linux LVM Single File Recovery Notes</title>
		<link>http://andyleonard.com/2009/06/01/vmwarenfsnetapp-snaprestorelinux-lvm-single-file-recovery-notes/</link>
		<comments>http://andyleonard.com/2009/06/01/vmwarenfsnetapp-snaprestorelinux-lvm-single-file-recovery-notes/#comments</comments>
		<pubDate>Mon, 01 Jun 2009 21:55:54 +0000</pubDate>
		<dc:creator>Andy</dc:creator>
				<category><![CDATA[virtualization]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[netapp]]></category>
		<category><![CDATA[nfs]]></category>
		<category><![CDATA[snaprestore]]></category>
		<category><![CDATA[vmware]]></category>
		<category><![CDATA[vmware esx]]></category>

		<guid isPermaLink="false">http://andyleonard.com/?p=241</guid>
		<description><![CDATA[There have been a few posts elsewhere discussing file-level recovery for Linux VMs on NetApp NFS datastores, but none that have dealt specifically with Linux LVM-encapsulated partitions.
Here&#8217;s our in-house procedure for recovery; note that we do not have FlexClone licensed on our filers.

Prerequisites

An existing VMware ESX infrastructure, connected to a NetApp filer NFS datastore; SnapRestore [...]]]></description>
			<content:encoded><![CDATA[<p>There have been a few posts <a href="http://storagefoo.blogspot.com/2007/10/vmware-over-nfs-backup-trickscontinued.html">elsewhere</a> discussing file-level recovery for Linux VMs on NetApp NFS datastores, but none that have dealt specifically with Linux LVM-encapsulated partitions.</p>
<p>Here&#8217;s our in-house procedure for recovery; note that we do not have FlexClone licensed on our filers.<br />
<span id="more-241"></span><br />
<strong>Prerequisites</strong></p>
<ul>
<li>An existing VMware ESX infrastructure, connected to a NetApp filer NFS datastore; SnapRestore speeds the recovery process but is not mandatory &#8211; see discussion below.</li>
<li>A backup script or system which coordinates VMware snapshots with NetApp snapshots &#8211; perhaps something along the lines of <a href="http://vmwaretips.com/wp/2008/12/05/netapp-snapshots-in-esx-take-2/">Rick Scherer&#8217;s script</a>.</li>
<li>A dedicated Linux restore VM, at a similar version level to the rest of your Linux VM infrastructure.  This VM should have LVM support, but <em>should not have any volume groups (VGs) or logical volumes (LVs) configured</em> &#8211; volume group and logical volume names on the VMDK you are restoring from must not conflict with VGs and LVs already in use on the restore system; the simplest way to guarantee this is to simply not have any VGs or LVs.</li>
</ul>
<p><strong>Restore Procedure</strong></p>
<ul>
<li>Restore the VMDK file from the appropriate snapshot to a <em>new location</em> in the datastore.  With SnapRestore, this can be done as follows (one line in the filer CLI, restoring from snapshot sv_daily.0 to a new file &#8211; again, <strong>be extremely careful not to overwrite the current version of the VMDK in your datastore</strong>, consider restoring to an entirely different directory in the FlexVol):
<p><code>snap restore -t file -s sv_daily.0<br />
-r /vol/vmware04_sis/system.example.com/system.example.com-restore.vmdk<br />
/vol/vmware04_sis/system.example.com/system.example.com.vmdk</code></p>
<p>Follow the prompts, verifying the restore path is correct and is not the path to your existing VMDK.  Do the same for the flat VMDK file (again, one line, and, as before, <strong>use caution to make sure you do not clobber an existing file</strong>):</p>
<p><code>snap restore -t file -s sv_daily.0<br />
-r /vol/vmware04_sis/system.example.com/system.example.com-restore-flat.vmdk<br />
/vol/vmware04_sis/system.example.com/system.example.com-flat.vmdk</code></p>
<p>Without SnapRestore, you can simply mount the NFS export of the datastore on a Linux machine and use &#8220;cp&#8221; to copy the files out of the snapshot.  For flat VMDK files, expect this copy to run for a substantial amount of time compared the nearly-instant recovery SnapRestore offers.</li>
<li>Manually edit the line below &#8220;# Extent description&#8221; in the recovered .vmdk file to match the path to the recovered flat VMDK.  In this case, it would look something like this:<br />
<code># Extent description<br />
RW 20971520 VMFS "system.example.com-restore-flat.vmdk"</code></li>
<li>Attach the recovered VMDK to your powered-off restore host.  Boot the restore host.</li>
<li>Once your restore host is up, use &#8220;pvscan&#8221;, &#8220;vgscan&#8221; and &#8220;lvscan&#8221; (each without arguments) as root to examine available LVM components.  Then, use the &#8220;lvchange&#8221; command to activate the necessary volume group (in this case, &#8220;VolGroup00&#8243;):<br />
<code># lvchange -ay VolGroup00</code></li>
<li>Mount the appropriate logical volume &#8211; for example, LogVol00 in VolGroup00:<br />
<code>mount -o ro /dev/VolGroup00/LogVol00 /mnt</code><br />
Restore files by copying them out of /mnt.</li>
</ul>
<p><strong>Cleanup</strong></p>
<ul>
<li>Shut down the Linux restore host.</li>
<li>Remove the recovery VMDK &#8211; the files restored with SnapRestore or by &#8220;cp&#8221; above &#8211; from the restore host in the VMware Infrastructure Client.</li>
<li>Delete the recovery .vmdk and -flat.vmdk files in the NFS datastore.  <strong>Don&#8217;t screw up here: Be sure to delete the recovery files only, not the working VMDK.</strong></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://andyleonard.com/2009/06/01/vmwarenfsnetapp-snaprestorelinux-lvm-single-file-recovery-notes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Duplicity to Amazon S3 on FreeBSD: Building on the work of others</title>
		<link>http://andyleonard.com/2009/03/02/duplicity-to-amazon-s3-on-freebsd-building-on-the-work-of-others/</link>
		<comments>http://andyleonard.com/2009/03/02/duplicity-to-amazon-s3-on-freebsd-building-on-the-work-of-others/#comments</comments>
		<pubDate>Mon, 02 Mar 2009 19:47:53 +0000</pubDate>
		<dc:creator>Andy</dc:creator>
				<category><![CDATA[freebsd]]></category>
		<category><![CDATA[storage]]></category>
		<category><![CDATA[aws]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[duplicity]]></category>
		<category><![CDATA[s3]]></category>

		<guid isPermaLink="false">http://andyleonard.com/?p=226</guid>
		<description><![CDATA[(This post adds only a couple small details to work described at randys.org and cenolan.com &#8211; go there for background on this post and useful scripts for automated Duplicity backup to S3.)
First off, if you want to use Duplicity installed from FreeBSD Ports to backup to Amazon S3, be sure to also install the devel/py-boto [...]]]></description>
			<content:encoded><![CDATA[<p>(This post adds only a couple small details to work described at <a href="http://www.randys.org/2007/11/16/how-to-automated-backups-to-amazon-s-s3-with-duplicity/">randys.org</a> and <a href="http://www.cenolan.com/2008/12/how-to-incremental-daily-backups-amazon-s3-duplicity/">cenolan.com</a> &#8211; go there for background on this post and useful scripts for automated Duplicity backup to S3.)</p>
<p>First off, if you want to use Duplicity installed from FreeBSD Ports to backup to Amazon S3, be sure to also install the <code>devel/py-boto</code> and <code>security/pinentry-curses</code> ports.</p>
<p>If you attempt to run the backup script described at randys.org or cenolan.com from cron, you may run into an error similar to the following:<br />
<span id="more-226"></span></p>
<pre>2009-03-01_01:05:05: ... backing up filesystem
Cleanup of temporary directory /tmp/duplicity-gM4CN9-tempdir failed - this
is probably a bug.
Cleanup of temporary directory /tmp/duplicity-gM4CN9-tempdir failed - this
is probably a bug.
Traceback (most recent call last):
File "/usr/local/bin/duplicity", line 583, in &lt;module&gt;
with_tempdir(main)
File "/usr/local/bin/duplicity", line 577, in with_tempdir
fn()
File "/usr/local/bin/duplicity", line 558, in main
full_backup(col_stats)
File "/usr/local/bin/duplicity", line 234, in full_backup
bytes_written = write_multivol("full", tarblock_iter, globals.backend)
File "/usr/local/bin/duplicity", line 148, in write_multivol
globals.gpg_profile, globals.volsize)
File "/usr/local/lib/python2.5/site-packages/duplicity/gpg.py", line 240,
in GPGWriteFile
bytes_to_go = data_size - get_current_size()
File "/usr/local/lib/python2.5/site-packages/duplicity/gpg.py", line 232,
in get_current_size
return os.stat(filename).st_size
OSError: [Errno 2] No such file or directory:
'/tmp/duplicity-gM4CN9-tempdir/mktemp-iZknw0-2'

Traceback (most recent call last):
File "/usr/local/bin/duplicity", line 583, in &lt;module&gt;
with_tempdir(main)
File "/usr/local/bin/duplicity", line 577, in with_tempdir
fn()
File "/usr/local/bin/duplicity", line 558, in main
full_backup(col_stats)
File "/usr/local/bin/duplicity", line 232, in full_backup
sig_outfp = get_sig_fileobj("full-sig")
File "/usr/local/bin/duplicity", line 210, in get_sig_fileobj
fh = globals.backend.get_fileobj_write(sig_filename)
File "/usr/local/lib/python2.5/site-packages/duplicity/backend.py", line
354, in get_fileobj_write
fh = dup_temp.FileobjHooked(tdp.filtered_open("wb"))
File "/usr/local/lib/python2.5/site-packages/duplicity/path.py", line 716,
return gpg.GPGFile(1, self, gpg_profile)
File "/usr/local/lib/python2.5/site-packages/duplicity/gpg.py", line 112,
in __init__
'logger': self.logger_fp})
File "/usr/local/lib/python2.5/site-packages/GnuPGInterface.py", line 357,
in run
create_fhs, attach_fhs)
File "/usr/local/lib/python2.5/site-packages/GnuPGInterface.py", line 401,
in _attach_fork_exec
if process.pid == 0: self._as_child(process, gnupg_commands, args)
File "/usr/local/lib/python2.5/site-packages/GnuPGInterface.py", line 442,
in _as_child
os.execvp( command[0], command )
File "/usr/local/lib/python2.5/os.py", line 354, in execvp
_execvpe(file, args)
File "/usr/local/lib/python2.5/os.py", line 390, in _execvpe
func(fullname, *argrest)
OSError: [Errno 2] No such file or directory

Traceback (most recent call last):
File "/usr/local/bin/duplicity", line 583, in &lt;module&gt;
with_tempdir(main)
File "/usr/local/bin/duplicity", line 577, in with_tempdir
fn()
File "/usr/local/bin/duplicity", line 558, in main
full_backup(col_stats)
File "/usr/local/bin/duplicity", line 234, in full_backup
bytes_written = write_multivol("full", tarblock_iter, globals.backend)
File "/usr/local/bin/duplicity", line 148, in write_multivol
globals.gpg_profile, globals.volsize)
File "/usr/local/lib/python2.5/site-packages/duplicity/gpg.py", line 237,
in GPGWriteFile
file = GPGFile(True, path.Path(filename), profile)
File "/usr/local/lib/python2.5/site-packages/duplicity/gpg.py", line 112,
in __init__
'logger': self.logger_fp})
File "/usr/local/lib/python2.5/site-packages/GnuPGInterface.py", line 357,
in run
create_fhs, attach_fhs)
File "/usr/local/lib/python2.5/site-packages/GnuPGInterface.py", line 401,
in _attach_fork_exec
if process.pid == 0: self._as_child(process, gnupg_commands, args)
File "/usr/local/lib/python2.5/site-packages/GnuPGInterface.py", line 442,
in _as_child
os.execvp( command[0], command )
File "/usr/local/lib/python2.5/os.py", line 354, in execvp
_execvpe(file, args)
File "/usr/local/lib/python2.5/os.py", line 390, in _execvpe
func(fullname, *argrest)
OSError: [Errno 2] No such file or directory</pre>
<p>The solution to the above is simple &#8211; make sure the path includes <code>/usr/local/bin</code>, perhaps by including this at the start of the backup script:</p>
<pre>export PATH=${PATH}:/usr/local/bin</pre>
<p>Finally, when running an incremental backup, you may get this error:</p>
<pre>Fatal Error: Neither remote nor local manifest is readable.</pre>
<p>This can be solved by setting the <code>HOME</code> environment variable to <code>/root</code> assuming you&#8217;re running the backup as root (instead of the default <code>/var/log</code> for cron jobs):</p>
<pre>export HOME=/root</pre>
]]></content:encoded>
			<wfw:commentRss>http://andyleonard.com/2009/03/02/duplicity-to-amazon-s3-on-freebsd-building-on-the-work-of-others/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>7/25/2008 Links: VMDK File Level Recovery</title>
		<link>http://andyleonard.com/2008/07/25/7252008-links-vmdk-file-level-recovery/</link>
		<comments>http://andyleonard.com/2008/07/25/7252008-links-vmdk-file-level-recovery/#comments</comments>
		<pubDate>Fri, 25 Jul 2008 18:50:43 +0000</pubDate>
		<dc:creator>Andy</dc:creator>
				<category><![CDATA[link dump]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[nfs]]></category>
		<category><![CDATA[vmware]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://andyleonard.com/?p=53</guid>
		<description><![CDATA[
File Level Recovery from within a VMDK backup &#8211; Nick Triantos of NetApp covers file-level recovery from VMware (Windows) VMDK files again, in more depth than he has before.  Nick notes that it can be a &#8220;a point-and-click process.&#8221;

]]></description>
			<content:encoded><![CDATA[<ul>
<li><a href="http://blogs.netapp.com/storage_nuts_n_bolts/2008/07/file-level-reco.html">File Level Recovery from within a VMDK backup</a> &#8211; Nick Triantos of NetApp covers file-level recovery from VMware (Windows) VMDK files again, in more depth than he has before.  Nick notes that it can be a &#8220;a point-and-click process.&#8221;</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://andyleonard.com/2008/07/25/7252008-links-vmdk-file-level-recovery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
