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:44:08 -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=I1hNpK8f7gHUmg+Ty5oIFFyYaYLd2eKPxx6LYY6rmSk=; b=qNH7ZaSKKx0KhiCustNxMbLdnHVY1HBezdSGjU1/PmRIUrmgLwDie1erD0TnwGgRY7 fNF8aK566FsgVEf1vExtkXZwQgi8Gim0FYwiCoXxCMB5NPAdHChqNWafUfPFf/3J24W0 +Y90z9dlsXY+dTHBlY95PBdELrvnscQbgyCMenokuTLBeQC7NfZ0JQpJDeKW6ABxF3Qv 04PT/Ru2h5DAx8axShJoPMa+TRRX1UA8nJWpyBfxXYyb3UYFJeqtjLo4wSBX172I6mji OiKGDMouXpRpm453FHfjJ3lH6+ikHw/MgnjReguCiu7uvFk3PzbUnuRiCKzHPiG1Gv/9 whiA==
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
> 

It worked!

After running your mount command above I get;

mount: you didn't specify a filesystem type for 
/dev/mapper/vg_anette_data-datasnapshot
       I will try type xfs
/dev/mapper/vg_anette_data-datasnapshot on /snapshot type xfs 
(ro,logdev=/dev/loop0,nouuid)
mount: /snapshot does not contain SELinux labels.
       You just mounted an file system that supports labels which does not
       contain labels, onto an SELinux box. It is likely that confined
       applications will generate AVC messages and not be allowed access to
       this file system.  For more details see restorecon(8) and mount(8).

And the contents of the /snapshot dir matched the data volume files, size, 
etc...

Wow, how cool are you man, many thanks!!!!

I'm thinking of disabling selinux on this box at any rate which should remove 
the above message.

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