xfs
[Top] [All Lists]

Re: LVM + XFS + external log + snapshots

To: Eric Sandeen <sandeen@xxxxxxxxxxx>
Subject: Re: LVM + XFS + external log + snapshots
From: aurfalien <aurfalien@xxxxxxxxx>
Date: Sun, 23 Jun 2013 17:33:18 -0700
Cc: Dave Chinner <david@xxxxxxxxxxxxx>, xfs@xxxxxxxxxxx
Delivered-to: xfs@xxxxxxxxxxx
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer; bh=kgW8OIR7t3YgPpReZpE3rtMK9BRZDOuTh1KY8B3AxKQ=; b=bJZ9202SQouhE+xIFLr54L2YZdTw5mok0z9fZaCBNYwJom11p8de1WV76bc+mASr8/ iBzGCSl4vcwn+z75hiAILUUOeYCpROHTpp9LU0L1JwPnGN/o/GNoIxpQ6UOMU9Vv5FnX 8IOf1oW2pJ+sTY3Uj5fGN0UUED1Xkkl4KCiyAIAWApNl7ApQ+IRRGDUY/KBid7Hkxez6 XXPF0IXboTu/jsmm5UZyFscmc5gchTs1XtzuPEkuZzydfQrIx7kgHp+IjteFenNZDs7t F/9/R9PIOamza0kump/7MMpVtudqfaHnx2g6PFD9yid9YugYHb45HU1PA0LMj2e7g6TC Lefg==
In-reply-to: <51C783B7.2040502@xxxxxxxxxxx>
References: <022467CC-8EB2-41E9-8AF6-46F781882F6B@xxxxxxxxx> <20130623225546.GB29376@dastard> <51C783B7.2040502@xxxxxxxxxxx>
On Jun 23, 2013, at 4:24 PM, Eric Sandeen wrote:

> On 6/23/13 5:55 PM, Dave Chinner wrote:
>> On Fri, Jun 21, 2013 at 10:30:31PM -0700, aurfalien wrote:
>>> Hi all,
>>> 
>>> So I have an XFS file system within LVM  which has an external log.
>>> 
>>> My mount option in FSTAB is;
>>> 
>>> /dev/vg_spock_data/lv_data  /data   xfs     
>>> logdev=/dev/sdc1,nobarrier,logbufs=8,noatime,nodiratime 1 1
>>> 
>>> All is well no issues and very fast.
>>> 
>>> Now I'd like to snapshot this bad boy and then run rsnapshot to create a 
>>> few days backup.
>> 
>> You need to snapshot the log device as well.
>> 
>> But that is problematic in that you need to snapshot it at the same
>> time you snapshot the data volume. Hence yo'd have to do:
>> 
>> # xfs_freeze -f <filesystem>
>> # <snapshot data volume>
>> # <snapshot log volume>
>> # xfs_freeze -u <filesystem>
>> 
>> And now you can mount the snapshot with:
>> 
>> # mount /dev/vg_spock_data/datasnapshot /snapshot -o 
>> nouuid,ro,logdev=/dev/vg_spock_log/logsnapshot
>> 
>> If you can't snapshot the log device, then you can't snapshot the
>> filesystem. Yet another reason for using internal logs...
> 
> Hm, given that freezing the fs makes the log (almost) completely clean, I 
> wonder
> if he could mount with /dev/zero (or a loopback 0-filled file) to get at the 
> snapshot,
> especially since it's being mounted RO.
> 
> Should be safe & consistent, no?
> 
> i.e.
> 
> truncate --size=2g logfile (or however big it needs to be)
> losetup /dev/loop0 logfile
> mount /dev/vg_anette_data/datasnapshot /snapshot -o 
> logdev=/dev/loop0,nouuid,ro
> 
> -Eric

I'll try it and let you know.

Should be interesting.

- aurf
<Prev in Thread] Current Thread [Next in Thread>