The standard technique is to reserve a big file on the old filesystem for the new filesystem metadata, and then walk all files on the old filesystem and use fiemap() to create new extents that point to the existing data - only writing to the space you reserved.
You only overwrite the superblock at the very end, and you can verify that the old and new filesystems have the same contents before you do.
So best to only mount ro when considering to rollback. Otherwise it's pretty risky.
Even if you disable copy-on-write, as long as the rollback subvolume is there to lay claim to the old data, it's considered immutable and any modification will still have to copy it.
You are right. All of the old files will be in areas btrfs should consider used. So it should correctly restore the state from before the migration. Thanks!
Lesson learned: despite whatever “hard” promises a conversion tool (and its creators) make, just backup, check the backup, then format and create your new filesystem.
Windows used to feature a similar tool to transition from FAT32 to NTFS. I'd have the same reservations about that tool, though. Apple also did something like this with an even weirder conversion step (source and target filesystem didn't have the same handling for case sensitivity!) and I've only read one or two articles about people losing data because of it. It can definitely be done safely, if given enough attention, but I don't think anyone cares enough to write a conversion tool with production grade quality.
I tracked down a couple of nasty bugs at that time playing around with it, hopefully it's more stable now.
The second time I just went “meh” and let it run.
First it goes to the private beta users, then the public beta users, and then it slowly rolls out globally. Presumably they could slow down the roll out even more for a risky change to monitor it.
I still remember the syntax: convert C: /fs:ntfs
"WinBtrfs is a Windows driver for the next-generation Linux filesystem Btrfs. A reimplementation from scratch, it contains no code from the Linux kernel, and should work on any version from Windows XP onwards. It is also included as part of the free operating system ReactOS."
This is from the ntfs2btrfs maintainer's page.
Do Linux NTFS drivers deal with alternate streams?
"Getting and setting of Access Control Lists (ACLs), using the xattr security.NTACL"
"Alternate Data Streams (e.g. :Zone.Identifier is stored as the xattr user.Zone.Identifier)"
Storing Windows ACLs in xattrs is also pretty common (Samba does the same)
Both btrfs and NTFS have snapshot capabilities.