Thread (2 messages) 2 messages, 2 authors, 2016-05-26

Re: btrfs on disk consistency

From: Hugo Mills <hidden>
Date: 2016-05-26 09:00:48

On Thu, May 26, 2016 at 08:47:39AM +0000, sri wrote:
In traditional file systems such as ext3/ext4 when a snapshot (say with 
LVM2) is taken, all I/O are frozen and entire file system including meta 
dta is part of snapshot. 

Btrfs snapshot also managed by file system itself and btrfs snapshot is 
actually does a sub volume snapshot which makes a portion of logical 
entity can be made read only so that no I/Os happen to that tree.

Since snapshot is at sub volume level, other metadata such as extent tree, 
chunk tree, super block etc.. will still in active state and I/Os can go 
on them will not get flushed to disk (which is not required for btrfs sub 
volume snapshot).


Since btrfs is always consistent (With COW and check-sum), does it holds 
good if I copy blocks at disk level to another disk starting form 0 to end 
of disk ?
My guess is NO.
   Correct.
Or is there a way to freeze I/Os at btrfs level so that entire metadata is 
flushed to the disk ( all trees such as extent tree, chunk tree or what 
ever metadata of btrfs file system used at VFS layer) so that  disk to 
disk copy can be triggered so that I will be having all sub volumes are 
copied to an alternate disk which I should be able to use on another 
machine or if the original disk is gone for toss. 
   Naïvely, doing that within btrfs would effectively hang the FS for
the lifetime of the suspension, so it would be a really bad idea.

   In general, this would be the use-case for LVM. However, that's a
dangerous operation with btrfs, because the snapshot ends up being
included in the original FS (because it has the same UUID), and thus
causes the kernel to get very confused, leading to probable FS
corruption.

   Hugo.

-- 
Hugo Mills             | "No! My collection of rare, incurable diseases!
hugo@... carfax.org.uk | Violated!"
http://carfax.org.uk/  |
PGP: E2AB1DE4          |                Stimpson J. Cat, The Ren & Stimpy Show

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help