[kwlug-disc] Bitrot and atomic COWs: Inside ???next-gen??? filesystems | Ars Technica

unsolicited unsolicited at swiz.ca
Wed Jan 22 16:31:42 EST 2014


On 14-01-22 01:55 PM, Bob Jonkman wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Jason wrote:
>>> That article was the impetus for me to try it out for the first
>>> time while rebuilding a home micro-server
>
> Did you backup, reformat, then restore, or is there a conversion tool
> to go from ext* to btrfs?
>
> - - --Bob.

In that same link (https://en.wikipedia.org/wiki/Btrfs):

Features:
- In-place conversion (with rollback) from ext3/4 to Btrfs[31]
[31] https://btrfs.wiki.kernel.org/index.php/Conversion_from_Ext3

Send/receive[edit]
Given any pair of subvolumes (or snapshots), Btrfs can generate a binary 
diff between them (by using the btrfs send command) that can be replayed 
later (by using btrfs receive), possibly on a different Btrfs file 
system. The send/receive feature effectively creates (and applies) a set 
of data modifications required for converting one subvolume into 
another.[33][51]
The send/receive feature can be used with regularly scheduled snapshots 
for implementing a simple form of file system master/slave replication, 
or for the purpose of performing incremental backups.[33][51]


In-place ext2/3/4 conversion[edit]
As the result of having very little metadata anchored in fixed 
locations, Btrfs can warp to fit unusual spatial layouts of the backend 
storage devices. The btrfs-convert tool exploits this ability to do an 
in-place conversion of any ext2/3/4 file system, by nesting the 
equivalent Btrfs metadata in its unallocated space — while preserving an 
unmodified copy of the original file system.[31]
The conversion involves creating a copy of the whole ext2/3/4 metadata, 
while the Btrfs files simply point to the same blocks used by the 
ext2/3/4 files. This makes the bulk of the blocks shared between the two 
filesystems before the conversion becomes permanent. Thanks to the 
copy-on-write nature of Btrfs, the original versions of the file data 
blocks are preserved during all file modifications. Until the conversion 
becomes permanent, only the blocks that were marked as free in ext2/3/4 
are used to hold new Btrfs modifications, meaning that the conversion 
can be undone at any time.[31]
All converted files are available and writable in the default subvolume 
of the Btrfs. A sparse file holding all of the references to the 
original ext2/3/4 filesystem is created in a separate subvolume, which 
is mountable on its own as a read-only disk image, allowing both 
original and converted file systems to be accessed at the same time. 
Deleting this sparse file frees up the space and makes the conversion 
permanent.[31]





More information about the kwlug-disc mailing list