Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: sri <toyours_sridhar@yahoo.co.in>
To: linux-btrfs@vger.kernel.org
Subject: Re: btrfs freeze/thaw when using with LVM2
Date: Mon, 27 Apr 2015 14:41:41 +0000 (UTC)	[thread overview]
Message-ID: <loom.20150427T163556-13@post.gmane.org> (raw)
In-Reply-To: 20150427121521.GB18187@carfax.org.uk

Hugo Mills <hugo <at> carfax.org.uk> writes:

> 
> On Mon, Apr 27, 2015 at 12:05:28PM +0000, sri wrote:
> > Hi,
> > 
> > I would like to know if btrfs file system is created on LVM2 logical 
> > volumes, does freeze and thaw operations takes place for btrfs to 
make 
> > file system consistent??
> 
>    No, because the filesystem is *always* consistent, because of the
> way that the CoW update mechanism works.
> 
> > If not is there a way (ioctl etc..) to run btrfs freeze/thaw before 
and 
> > after creating LVM2 snapshot of a btrfs file system?
> 
>    As I said above, none is needed.
> 
>    HOWEVER, you shouldn't take LVM snapshots of a btrfs filesystem AT
> ALL, if you have the original FS mounted on that system, or if you
> plan on mounting the FS or its snapshots on that system. It's fine if
> the only things mounting it are independent of the base system, and
> don't see the snapshots (e.g. you're exporting LVs as block devices to
> a VM host, and the snapshot is never seen by the VM; or you're
> exporting LVs via NBD, and the remote system never sees the
> snapshot).
> 
>    If, on the other hand, you're expecting to have /dev/mapper/foo
> mounted, and then take a snapshot of it on the same system, you can
> expect massive filesystem corruption, because the kernel can't
> distinguish between the original block device and the snapshot, and
> may try using the wrong one (or possibly both).
> 
>    Hugo.
> 

:) Thank you for your input. Past couple of hours, i am unable to figure 
it out what is happening with snapshot.

I am experiencing similar what you have explained.
taken a lvm snapshot using lvcreate of /dev/mapper/foo name 
/dev/mapper/foo-snap.

/dev/mapper/foo is mounted on /b1
and I have mounted /dev/mapper/foo-snap on /b2

after running mount command, i have seen there is a change in the mount 
entries. i.e. for both /b1 , /b2 mount point is changed to 
/dev/mapper/foo-snap.

And any write to original or to snap shot are reflecting on both.

This is strange considering that I wanted a consistent snapshot of 
entire btrfs filesystem at volume level.

Is there a way to achive this? or btrfs just cannot provide?

I am looking for a way make entire btrfs (which includes subvolumes in 
it) consistent so that I can take backup of the file system.




  reply	other threads:[~2015-04-27 14:42 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-27 12:05 btrfs freeze/thaw when using with LVM2 sri
2015-04-27 12:15 ` Hugo Mills
2015-04-27 14:41   ` sri [this message]
2015-04-27 14:55     ` Hugo Mills
2015-04-27 17:34       ` Roman Mamedov
2015-04-27 17:37         ` Hugo Mills
2015-04-27 17:56           ` sri
2015-04-27 15:58   ` Piotr Pawłow

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=loom.20150427T163556-13@post.gmane.org \
    --to=toyours_sridhar@yahoo.co.in \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox