<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Nov 28, 2016 at 3:34 PM, Will Dormann <span dir="ltr"><<a href="mailto:wdormann@gmail.com" target="_blank">wdormann@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 11/27/16 8:26 PM, Will Dormann wrote:<br><br>
Just a follow-up after some discussions with the XFS folks:<br>
<br>
TL;DR: Don't rely on xfsdump to back up everything.<br>
<br>
<br>
There are things that can prevent xfsdump from successfully backing up a<br>
file on a live filesystem. For example, changes to the file that happen<br>
during the backup *may* cause said file to not properly be stored in the<br>
xfsdump backup. The unfortunate situation there is that you can have a<br>
backup where all of the files *seem* to be there, at least according to<br>
the file inventory in the dump, but when you go to restore them they<br>
won't actually be there. Which IMO is the most catastrophic way that a<br>
backup can fail (silently on both backup and restore).<br>
<br>...<br>
<br>
I guess I've gotten spoiled with ZFS...<br></blockquote><div><br></div><div>You can do a very similar, and (if I'm right, logically the exact same thing) if your XFS filesystem resides on LVM, if you have (in this example, more than 2GB) free space in the LVM volume group to create the snapshot COW space. </div><div><br></div><span style="font-family:monospace"><span style="color:rgb(0,0,0)">lvm lvcreate --size 2g --snapshot --name /dev/volumegroup/backupthis_snapshot yourvg/your_root # creates point in time snapshot</span></span></div><div class="gmail_quote"><span style="font-family:monospace"><font color="#000000">xfsdump [options] /dev/volumegroup/backupthis_snapshot </font></span></div><div class="gmail_quote"><span style="font-family:monospace"><font color="#000000">lvm lvremove -f yourvg/backupthis_snapshot # removes the snapshot, and merges all changes back into the live fs.</font></span></div><div class="gmail_quote"><br></div><div class="gmail_quote"><div>Your dev names may be different; this is how they show up on a current Sabayon system. </div><div>I've used this in practice to dump filesystems for backup purposes, both with xfsdump as well as dd. A good script would call a mysql FLUSH TABLES and then FLUSH TABLES WITH READ LOCK to quiesce the database before snapshotting, and after the snapshot finishes, allow mysql to write again. </div><div><br></div><div>Mike</div><div><br></div></div></div></div>