News for hackers. Stuff that matters.
Re:ntfs2btrfs: In-place conversion of NTFS filesystem to Btrfs by basilgohar on Monday March 07, 2022 @11:28AM (#30589749)
I used to be in the "why BTRFS" camp and religiously would only install ext4 without LVM on Fedora for my laptops, desktops, and servers. When I saw so many subsequent releases persist in offering BTRFS by default, I decided to try it for a recent laptop install, because honestly, the appeal of deduplication, checksumming, snapshotting, and so many other features that modern FSes generally come with (e.g., ZFS), I just decided to jump the gun and went ahead and installed it.

I can safely say it has not presented any problem with me thus far, and I am at the stage of my life where I realize that I don't have the time to fiddle as much with settings. If the distributions are willing to take that maintenance on their shoulders, I'm willing to trust them and deal with the consequences – at least I know I'm not alone.

Re:ntfs2btrfs: In-place conversion of NTFS filesystem to Btrfs by pkulak on Monday March 07, 2022 @11:46AM (#30590056)
It's obviously not there as a NAS filesystem, ZFS drop-in replacement, etc. But if what you take away from that is that BTRFS is no good as a filesystem on a single drive system, you're missing out. Just a few weeks ago I used a snapshot to get myself out of some horrible rebase issue that lost half my changes. Could I have gone to the reflog and done other magic? Probably. But browsing my .snapshots directory was infinitely easier!
Re:ntfs2btrfs: In-place conversion of NTFS filesystem to Btrfs by chris37879 on Monday March 07, 2022 @03:36PM (#30592992)
Snapshots are the best thing in the world for me on Arch. I'm specifically using it cause I like to tinker with exotic hardware and it has the most sane defaults for most of the things I care about. Pacman is great, but the AUR can be a bit a sketchy sometimes on choices that package authors make. Having snapshots every time package changes happen that I can roll back to from my boot loader is _awesome_. If you've ever used a distro that does kernel backups in your boot loader, it's like that, except it's whole packages at a time! And being able to use subvolumes to control which parts of a snapshot to restore is awesome. I can roll back my system without touching my home directory, even on a single drive setup!
Re:ntfs2btrfs: In-place conversion of NTFS filesystem to Btrfs by LinuxBender on Monday March 07, 2022 @12:11PM (#30590389)
But browsing my .snapshots directory was infinitely easier!

I second this however I don't use the filesystem to get this functionality. I most often use XFS and have a cronjob that calls an old perl script called "rsnapshot" [1] that makes use of hardlinks to deal with duplicate content and save space. One can create both local and remote snapshots. Similar to your situation I have used this to fix corrupted git repos which I could have done within git itself but rsnapshot was many times easier and I am lazy.

[1] - https://wiki.archlinux.org/title/rsnapshot

Re:ntfs2btrfs: In-place conversion of NTFS filesystem to Btrfs by amelius on Monday March 07, 2022 @05:10PM (#30594007)
Let me guess: you use XFS because of the large number of hardlinks it allows out of the box (as opposed to the small number allowed by ext4)?
Re:ntfs2btrfs: In-place conversion of NTFS filesystem to Btrfs by LinuxBender on Monday March 07, 2022 @08:11PM (#30595366)
For me personally it was a matter of benchmarks. In the past I have seen higher performance numbers especially when dealing with directories that contain a very large number of files creating / deleting vs ext4. I've not tested since the 5.11 kernel time-frame however. But to your point it would be nice to see XFS have an option to grow inode limits dynamically like brtfs instead of having to manually adjust it. I've honestly never even tried out brtfs but it looks like I should.
Re:ntfs2btrfs: In-place conversion of NTFS filesystem to Btrfs by ahartmetz on Monday March 07, 2022 @12:17PM (#30590479)
By the way, "git reflog" can usually get you out of horribly botched rebases without using special filesystem features: git reset --hard <sha1 of last good state from reflog>
Re:ntfs2btrfs: In-place conversion of NTFS filesystem to Btrfs by vlovich123 on Monday March 07, 2022 @01:18PM (#30591330)
The reflog can be a PITA to walk through. A less well known thing is that you can spelunk through the reflog by saying `<ref>@{N}` which means whatever commit `<ref>` was pointing at N changes to the ref ago. Super handy to double-check that the rebase squashing commits didn't screw things up if there were merge conflicts in the fixups.
Re:ntfs2btrfs: In-place conversion of NTFS filesystem to Btrfs by azinman2 on Monday March 07, 2022 @12:06PM (#30590316)
Synology ships it for their NAS
Re:ntfs2btrfs: In-place conversion of NTFS filesystem to Btrfs by doublepg23 on Monday March 07, 2022 @12:58PM (#30591075)
Sort of. They use it on top of dm-raid and use dm-integrity for the checksum features. They claim BTRFS RAID is unstable.

https://kb.synology.com/en-us/DSM/tutorial/What_was_the_RAID...

Re:ntfs2btrfs: In-place conversion of NTFS filesystem to Btrfs by vetinari on Monday March 07, 2022 @02:25PM (#30592210)
Synology is running on top of mdraid, but does not use dm-integrity. Since it can be enabled per-share, and share creates a btrfs subvolume, that would be kind of difficult.

For scrubbing, plain-old btrfs-scrub is being used.

Re:ntfs2btrfs: In-place conversion of NTFS filesystem to Btrfs by blibble on Monday March 07, 2022 @02:40PM (#30592394)
> They claim BTRFS RAID is unstable.

and they'd be correct

Re:ntfs2btrfs: In-place conversion of NTFS filesystem to Btrfs by ziml77 on Monday March 07, 2022 @01:09PM (#30591227)
Does BTRFS actually need to be augmented like that? I've been afraid of using it for a NAS because it doesn't sound like it's as trustworthy as ZFS when it comes to handling bitrot. But I don't know if that's actually true. When I tried to find info on it a couple weeks ago, a lot of people were trying to claim that bitrot isn't a thing if you have ECC RAM.
Re:ntfs2btrfs: In-place conversion of NTFS filesystem to Btrfs by chasil on Monday March 07, 2022 @03:56PM (#30593219)
BtrFS was previously restricted to crc32c checksums. This was enhanced to allow several more, including sha256. The crc32c checksum has also been improved as xxhash, which promises fewer collisions for safer deduplication. When configured for sha256, BtrFS uses a checksum that is as strong as ZFS.

However, the checksum must be chosen at the time of filesystem creation. I don't know of any way to upgrade an existing BtrFS filesystem.

Contrast this to ZFS, which allows the checksum to be modified on a file-by-file basis.

Re:ntfs2btrfs: In-place conversion of NTFS filesystem to Btrfs by ziml77 on Monday March 07, 2022 @07:48PM (#30595241)
Hmm well that's good to know. I like the idea of being able to have mismatched drive capacities and easy expandability which is why I had been looking at Btrfs. I will have to look more into the checksum options.
Re:ntfs2btrfs: In-place conversion of NTFS filesystem to Btrfs by namibj on Tuesday March 08, 2022 @12:38AM (#30596797)
send/receive should allow for checksum rotation; however this isn't in-place.
Re:ntfs2btrfs: In-place conversion of NTFS filesystem to Btrfs by chasil on Tuesday March 08, 2022 @02:38PM (#30605407)
I didn't think of that as a migration path.
Re:ntfs2btrfs: In-place conversion of NTFS filesystem to Btrfs by namibj on Wednesday March 09, 2022 @01:05PM (#30617903)
Breadth/creativity in the search of technical solutions is my specialty. Hope it helped!
Re:ntfs2btrfs: In-place conversion of NTFS filesystem to Btrfs by michaelmrose on Monday March 07, 2022 @01:54PM (#30591786)
It's raid 5/6 comes with a warning from the developers not to use it and RAID 1 is a weird arrangement that actually keeps 2 copies on however many disks and can lose data if a disk comes and goes for example with a bad cable.

Bitrot still happens with ECC.

Re:ntfs2btrfs: In-place conversion of NTFS filesystem to Btrfs by StillBored on Monday March 07, 2022 @04:52PM (#30593780)
Bitrot is a thing, getting random bit flips/etc past all the ECC and data integrity checks in the storage path is much harder.

Having filesystem level protection is good, but it its like going from 80% to 85% protected. That is because the most critical part remaining unprotected in a traditional RAID/etc system is actually the application to filesystem interface. Posix and linux are largly to blame here because the default IO model should be async interface where the completion only fires when the data is persisted and things like read()/write()/close() should be fully serialized with the persistence layer. Otherwise, even with btrfs the easiest way to lose data is simply write it to disk, close the file, and pull the power plug.

Re:ntfs2btrfs: In-place conversion of NTFS filesystem to Btrfs by theamk on Tuesday March 08, 2022 @08:49PM (#30610069)
This heavily depends on your usage model.

For example if your use case is a file archive (think raw photo or video), then fiesysytem interface does not matter - if the computer crashes soon after copy, you re-copy from original media. But bit flips are very real and can ruin your day.

Re:ntfs2btrfs: In-place conversion of NTFS filesystem to Btrfs by StillBored on Wednesday March 09, 2022 @12:26PM (#30617320)
I'm really curious, what your storage stack is that your getting undetected bit flips. This stuff was my day job for ~10 years. I've seen every kind of error you can imagine, and I can't actually remember "bit flips" showing up in end user data, that wasn't eventually attributable to something stupid like lack of ECC ram, or software bugs. Random bit flips tend to show up two ways, the interface/storage mechanism gets "slow" (due to retries/etc) or flat out read errors. This isn't the 1980's where you could actually read data back from your storage mechanism and get flipped bits, there are too many layers of ECC on the storage media for it to go undetected. Combined with media scrubbing failures tend to be all or nothing, the drive goes from working to 100% dead, or the raid kicks it when the relocated sector counts start trending up, or the device goes in a read only mode. What most people don't understand is that IO interfaces these days aren't designed to be 100% electrically perfect. The interface performance/capacity is pushed until the bit error rate (BER) is not insignificant, and then error correction is applied to assure that the end result is basically perfect.

But as I mentioned these days I'm pretty sure nearly all the storage loss that isn't physical damage is actually software bugs. Just a couple months ago I uploaded a multiple GB file (on my ECC protected workstation) to a major hyperscaler's cloud storage/sharing option. Sent the link to a colleague half way around the globe and they reported an unusual crash. So I asked them to md5sum the file and they got a different result from what I got, so I downloaded the file myself and diffed it against the original and right in the middle there was a ~50k block of garbage. Uploaded it again, and it was fine. Blame it on my browser, or whatever if you will, but the end result was quite disturbing because I'm fairly certain my local storage stack was fine. These days i'm really quite skeptical of "advanced" filesystem/etc. What I want is a dumb one where the number 1 priority is data consistency. I'm not sure that is an accurate reflection of many of them, where winning the storage perf benchmark, or feature wars seems to be a higher priority.

Re:ntfs2btrfs: In-place conversion of NTFS filesystem to Btrfs by theamk on Wednesday March 09, 2022 @04:19PM (#30620110)
Last time I have seen data damage was about 2005, this was multiple SATA drives connected to a regular consumer motherboard running Linux (sorry, don't remember the brands). If I remember right, I think there was an 8-byte block damaged every few gigabyte transferred or so? So a very high number of damaged files given I had a few terabytes of data.

I never found the cause, because I just switched to a completely different system to copy data. I know it was not disk-specific because this was happening on multiple hard drives, nor it was physical damage, as SMART/syslog were silent, and reading the disk again was giving correct data. Memory was fine -- not ECC, but I did run a lot of memtest's on it.

Later on, I found some blog posts which mentioned the similar problem and claim it was result of bad SATA card, or bad cable, or even bad power supply. I remember there was original one made by Jeff Bonwick on his ZFS blog, but I cannot find it anymore. Here is a more modern link instead: https://changelog.complete.org/archives/9769-silent-data-cor...

I now have the homegrown checksumming solution which I use after each major file transfer, and I have not seen any data corruption yet (*known on the wood().

Re:ntfs2btrfs: In-place conversion of NTFS filesystem to Btrfs by kevin_thibedeau on Monday March 07, 2022 @04:02PM (#30593280)
ECC can't protect the interface to your storage device. Bit flips can happen at any point in that chain.
Re:ntfs2btrfs: In-place conversion of NTFS filesystem to Btrfs by StillBored on Monday March 07, 2022 @04:48PM (#30593743)
Which part of the chain isn't protected by at least a packet CRC?

I think the answer is its all covered.

Re:ntfs2btrfs: In-place conversion of NTFS filesystem to Btrfs by nybble41 on Monday March 07, 2022 @06:03PM (#30594520)
Link-level CRCs don't protect against bit flips that happen during processing or while transitioning between links with different CRCs. For maximum end-to-end integrity you want to calculate the check value over the data in (ECC) RAM before writing it and the check value to storage, and verify the check value after reading all the data back in—this ensures that a bit-flip will be detected no matter where it occurs in the pipeline.
Re:ntfs2btrfs: In-place conversion of NTFS filesystem to Btrfs by kevin_thibedeau on Monday March 07, 2022 @10:04PM (#30595976)
No it isn't. At some point data is in transit in an IC without any error handling. CRCs aren't 100% reliable. Bit flips are guaranteed to happen with non-zero probability in all digital electronics. Bad data eventually makes it to persistent storage.
Re:ntfs2btrfs: In-place conversion of NTFS filesystem to Btrfs by StillBored on Monday March 07, 2022 @10:49PM (#30596230)
I don't know what parts of the storage stack you guys are working on, but I worked on enterprise storage systems we had 100% coverage in one form or another from the moment it left the RAM, via the intel interconnects, PCIe, the FC adapters which were either ECC or were using some form of data protection wrapping the entire transaction. So random bit flips in serdes/etc didn't cause problems because the higher level link protocols protected the data between the onboard ram and the endpoint, then there were the higher level protocol also providing their own data integrity.

Looking at even SATA 1, if it is implemented _CORRECTLY_ you get the packet CRC protecting the link data from the point its formed to the point the endpoint verifies the result. So like ethernet sometimes it doesn't matter if some random piece of junk in the process doesn't do its own ECC validation, because its covered under a higher level of the stack.

If your adapters are "desktop" grade then I might consider seeking another vendor if you care about data integrity, some vendors are definitely shipping crap, but there are vendors I can assure you will detect link/etc failures.

And as a side, note, I've seen a lot of bad data, a huge percentage of it, were kernel/etc filesystem errors. We added a bunch of out of band extra metrics to track when/where writes were going and our own metadata layers/etc, and it uncovered a whole bunch of software errors.

Re:ntfs2btrfs: In-place conversion of NTFS filesystem to Btrfs by nix23 on Tuesday March 08, 2022 @05:43AM (#30598504)
ZFS can easily protect you from that:

>>it is designed with a focus on data integrity by protecting the user's data on disk against silent data corruption caused by data degradation, power surges (voltage spikes), bugs in disk firmware, phantom writes (the previous write did not make it to disk), misdirected reads/writes (the disk accesses the wrong block), DMA parity errors between the array and server memory or from the driver (since the checksum validates data inside the array), driver errors (data winds up in the wrong buffer inside the kernel), accidental overwrites (such as swapping to a live file system), etc.

https://en.wikipedia.org/wiki/ZFS#Data_integrity

Re:ntfs2btrfs: In-place conversion of NTFS filesystem to Btrfs by bb88 on Monday March 07, 2022 @12:34PM (#30590762)
You can typically make a branch and push it up to the server, and I usually do this before any rebase. In future development scenarios (mac, windows) will you be able to do this reliably in the future?
Re:ntfs2btrfs: In-place conversion of NTFS filesystem to Btrfs by oauea on Monday March 07, 2022 @01:32PM (#30591508)
Or just write down the commit hash. Or just learn your tools and stop worrying because git reflog got you covered.
Re:ntfs2btrfs: In-place conversion of NTFS filesystem to Btrfs by bb88 on Monday March 07, 2022 @04:51PM (#30593770)
I've had issues with reflog that were not easily solved in the past, and wasn't clear what the fix was.

Also tagging is better than writing it down. Like initials+date.

Re:ntfs2btrfs: In-place conversion of NTFS filesystem to Btrfs by oauea on Tuesday March 08, 2022 @07:46AM (#30599275)
That sounds extremely unlikely. Did you look into what the reflog actually is? And a tag is literally just a pointer to a commit hash. Sure, you can tag it, but don't embarrass yourself by pushing it to a remote.
Re:ntfs2btrfs: In-place conversion of NTFS filesystem to Btrfs by bb88 on Tuesday March 08, 2022 @08:44PM (#30610034)
So you do realize you're on a website with a bunch of smart people, right? Telling them they have no idea what they're talking about is kinda dumb.
Re:ntfs2btrfs: In-place conversion of NTFS filesystem to Btrfs by oauea on Tuesday March 08, 2022 @08:50PM (#30610075)
Go ahead and give some examples of cases where the reflog won't help but tagging will?
Re:ntfs2btrfs: In-place conversion of NTFS filesystem to Btrfs by bb88 on Wednesday March 09, 2022 @01:21AM (#30611480)
No.
Re:ntfs2btrfs: In-place conversion of NTFS filesystem to Btrfs by oauea on Wednesday March 09, 2022 @10:00AM (#30615105)
So you're admitting you were completely wrong?
Re:ntfs2btrfs: In-place conversion of NTFS filesystem to Btrfs by bb88 on Thursday March 10, 2022 @10:28AM (#30627954)
No.
Re:ntfs2btrfs: In-place conversion of NTFS filesystem to Btrfs by oauea on Thursday March 10, 2022 @07:28PM (#30634581)
Well, you are.
Re:ntfs2btrfs: In-place conversion of NTFS filesystem to Btrfs by bb88 on Thursday March 10, 2022 @07:56PM (#30634825)
No.
Re:ntfs2btrfs: In-place conversion of NTFS filesystem to Btrfs by oauea on Sunday March 13, 2022 @02:22PM (#30664209)
Guess you never matured past the 8 year old's level of arguing: No no no nananana i'm right sticks fingers in ears
Re:ntfs2btrfs: In-place conversion of NTFS filesystem to Btrfs by bb88 on Monday March 14, 2022 @01:53AM (#30668946)
Pro Tip:

Don't insult people's intelligence then command them to spend hours to prove that you're wrong.

Just start with the assumption that you may be wrong next time.

Re:ntfs2btrfs: In-place conversion of NTFS filesystem to Btrfs by oauea on Monday March 14, 2022 @02:09PM (#30675838)
Pro tip: Don't pretend to know better than everyone else, then go "no no no" like an 8 year old when someone asks for info ;) It's ok to admit you're wrong.
Re:ntfs2btrfs: In-place conversion of NTFS filesystem to Btrfs by bb88 on Monday March 21, 2022 @02:19AM (#30750857)
No.
Re:ntfs2btrfs: In-place conversion of NTFS filesystem to Btrfs by Teknoman117 on Monday March 07, 2022 @04:25PM (#30593516)
Incremental snapshots as a backup tool and being able to chroot into a new snapshot of root to do updates is so useful.
Re:ntfs2btrfs: In-place conversion of NTFS filesystem to Btrfs by alerighi on Monday March 07, 2022 @01:49PM (#30591726)
BTRFS works fine. I use it on my everyday laptop without problems. Compression can help on devices with not a lot of disk, and also copy on write. However, BTRFS has its drawbacks, for example it's tricky to have a swapfile on it (now it's possible with some special attributes).

Also I wouldn't trust BTRFS for the purpose of data archiving, for the fact that ext4 is a proven (and simpler) filesystem, thus it's less likely to became corrupt, and it's more likely to being able to recover data from it if it will become corrupt (or the disk has some bad sectors and that sort of stuff).

Re:ntfs2btrfs: In-place conversion of NTFS filesystem to Btrfs by vetinari on Monday March 07, 2022 @02:17PM (#30592106)
> Also I wouldn't trust BTRFS for the purpose of data archiving, for the fact that ext4 is a proven (and simpler) filesystem, thus it's less likely to became corrupt, and it's more likely to being able to recover data from it if it will become corrupt (or the disk has some bad sectors and that sort of stuff).

On the contrary; I'm using btrfs and not ext4 on NAS (Synology) specifically, because the former does checksumming and bitrot detection and the latter does not.

Re:ntfs2btrfs: In-place conversion of NTFS filesystem to Btrfs by rinron on Monday March 07, 2022 @03:58PM (#30593244)
I was using urbackup with ext4 and was having issues that caused corruption and couldn't figure out why, seen a recommendation to use urbackup with BTRFS and have had no corruption since. I have used ext4 in every other use case and had no issue so im not saying ext4 is at fault but so far BTRFS has worked great for me.
Re:ntfs2btrfs: In-place conversion of NTFS filesystem to Btrfs by alerighi on Monday March 07, 2022 @07:40PM (#30595200)
A NAS it's not a backup, it's something you use to store data on it.

The backup I was referring to is the offline one. If I need to backup data, something that unfortunately I don't do as often as I should, I need a filesystem that is reliable, that is proven (ext4 is around since more than a decade, and if we count the previous version even more, so in 20 years I'm confident that I would be able to mount an ext4 hard drive that I forgot in the garage in a modern system, with BTRFS, who knows), and that for it they exist a lot of tools in case something goes wrong (there are ton of tools to recover data from damaged ext4 drives, are we sure that with BTRFS is as easy? If I have a filesystem with compression recovering data I don't think is a simple as running photorec...)

Also, the filesystem of a backup drive is not something you can change easily. I still have an old 1Tb drive that I formatted long long time ago in NTFS, and I never changed the filesystem since having to backup all the data to another drive (find it another 1Tb drive), format the drive, and copy back the data will take 1 day. Not that there are things super important on that drive, mostly is stuff I downloaded from the internet years ago, still it's an example why for a backup drive I don't want to have the cutting edge choice that then creates problems in the future.

Ext4 is ubiquitous, so it's my filesystem of choice for all the purpose that have the requirement that the data must be archived for more than 2 years.

Re:ntfs2btrfs: In-place conversion of NTFS filesystem to Btrfs by cmurf on Monday March 07, 2022 @02:26PM (#30592219)
I'm not sure how you prove that ext4 is less likely to become corrupt. But it is easily shown that it's less likely to inform you that there's corruption.

Quite a lot of the assumptions of earlier file systems is the hardware either returns correctness, or reports a problem e.g. uncorrectable read error or media error. That's been shown to be untrue even with enterprise class hardware, largely by the ZFS developers, hence why it exists. And also why ZFS has had quite a lot less "bad press" where Btrfs wasn't developed in a kind of skunkworks, it was developed out in the open where quite a lot of early users were using it with ordinary every day hardware.

And as it turns out, we see most hardware by make/model doing mostly the right things, a small number of make/models, making up a significant minority of usage volume, don't do the right things. Hence, Btrfs has always had full checksumming of data and metadata. Both XFS and ext4 were running into the same kinds of problems Btrfs (and ZFS before it) revealed - torn writes, misdirected writes, bit rot, memory bit flips, and even SSD's exhibit prefail behavior by returning either zeros or garbage instead of data (or metadata). XFS and ext4 subsequently added metadata checksums, which further reinforced the understanding that devices sometimes do the wrong thing and also lie about it.

It is true that overwriting filesystems have a better chance of repairing metadata inconsistencies. A big reason why is locality. They have fixed locations on disk for different kinds of metadata, thus a lot of correct assumptions can be made about what should be in that location. Btrfs doesn't have that at all, it has very few fixed locations for metadata (pretty much just the super blocks). Since no assumptions can be made about what's been found in metadata areas, it's harder to fix.

So the strategy is different with Btrfs (and probably ZFS too since it has a fairly nascent fsck even compared to Btrfs's) - cheap and fast replication of data via snapshots and send/receive, which requires no deep traversal of either the source or destination. And equally cheap and fast restore (backwards replication) using the same method. Conversely, conventional backup and restore are meaningfully different when reversing, so you have to test both the backup and restore to really understand if your backup method is reliable. That's going to be your disaster go to rather than trying to fix them. Fixing is almost certainly going to take much longer than restoring. If you don't have current backups, at least Btrfs now has various rescue mount options to make the file system more tolerant of broken file systems, but as a consequence you also have to mount read-only. Pretty good chance you can still get your data out, even if it's inconvenient to have to wipe the file system and create a new one. It'll still be faster than mucking with repair.

Also, Btrfs since kernel 5.3 has both read time and write time tree checkers, that verify certain trees for consistency, not just blindly accepting checksums. Various problems are exposed and stopped before they can cause worse problems, and even helps find memory bitflips and btrfs bugs. Btrfs doesn't just complain about hardware related issues, it'll rat itself out if it's to blame for the problem - which at this point isn't happening any more often than ext4 or XFS in very large deployments (millions of instances).

Re:ntfs2btrfs: In-place conversion of NTFS filesystem to Btrfs by alerighi on Monday March 07, 2022 @07:32PM (#30595136)
> I'm not sure how you prove that ext4 is less likely to become corrupt. But it is easily shown that it's less likely to inform you that there's corruption.

I didn't talk only about corruption of the filesystem itself (I don't know if it's more or less likely with BTRFS, someone says that BTRFS is more likely to become corrupt with power failures, I don't know if it's true), but also from hardware failures. In case of a disk with damaged sectors (I know that we should have 3 backups with one offsite, but you always have that one disk with important data on it that it's a year that you are promising to backup next day till it breaks) I think that a filesystem with a simpler structure will lead to an higher probability of recovering the data, while I think that with BTRFS, or any filesystem that is COW, uses compression, volumes, etc that is more difficult, because files are not stored as plain blocks on the disk, but have a more complex structure that must need to be decoded.

Also BTRFS is kind of a new filesystem, that has two disadvantages, there are not all the tools that were developed over the years for ext4, and also BTRFS driver is continuing evolving. Why I can be pretty confident that if I format an hard disk today with an ext4 filesystem in 20 years I will find a driver for a modern Linux (or whatever OS will replace it in 20 years) to mount it, can we have the same assurance with BTRFS? I don't know.

So for the purpose of making backups and archiving data, I think that I will stick with ext4 for a while. While on my laptop, and systems that I use, I use BTRFS without any problems.

Re:ntfs2btrfs: In-place conversion of NTFS filesystem to Btrfs by cmurf on Monday March 07, 2022 @08:54PM (#30595624)
>someone says that BTRFS is more likely to become corrupt with power failures

No. If the drive honors flush/FUA, Btrfs is less likely to corrupt data or metadata than overwriting file systems because the interruption won't result in incomplete overwrites. So this would hold true for any copy-on-write vs overwriting file system (and probably also log based file systems). The trouble is if the drive is transiently lying about flush/FUA success, and then there's an ill timed crash. There's the chance the super blocks written point to trees that don't exist yet because the write order hasn't been honored due to flush/FUA being ignored. There are backup trees, so it might be possible to work around this defect with the `rescue=usebackuproot` mount option, but sometimes the defect is so bad that you get all kinds of write reordering such that Btrfs only finds trees with the wrong generation, and it fails to mount. Often it's still possible to get your data out with the offline scrape tool, `btrfs restore`. But it's a difficult problem to deal with. In theory it's similar on ZFS but I know nothing about its on-disk format so maybe its metadata has some locality in which case certain assumptions could be made to allow it to better work around such a drive firmware defect? I'm not sure. On a power fail, it is possible Btrfs loses the most recently written data if the writes that were in-progress and thus not yet fully committed to stable media. How much data really depends on the application doing the writes.

>In case of a disk with damaged sectors

Btrfs by default keeps two copies of metadata and it automatically deals with this problem, while also self-healing when such problems are encountered.

>a filesystem with a simpler structure will lead to an higher probability of recovering the data, while I think that with BTRFS, or any filesystem that is COW, uses compression, volumes, etc that is more difficult, because files are not stored as plain blocks on the disk, but have a more complex structure that must need to be decoded.

The ondisk format is fairly simple and extendible. Metadata isn't subject to compression. In the case of bad sectors with compressed (user) data, you'll certainly lose more data than if it weren't compressed. There's an expected trade off here, it's not really a Btrfs issue but just the way all compression algorithms work. You get some small corruption and it'll have a bigger effect.

>So for the purpose of making backups and archiving data, I think that I will stick with ext4 for a while.

I used to hedge my bets by having multiple copies of data on different file systems (including ZFS) but haven't done that in years. I've seen too many cases of (hardware induced) data corruption being replicated into backups and archives without any warning it was happening until it was too late - and only corrupt copies remained.

Re:ntfs2btrfs: In-place conversion of NTFS filesystem to Btrfs by nine_k on Monday March 07, 2022 @02:19PM (#30592132)
With this, I wonder why ext4 and not XFS.
Re:ntfs2btrfs: In-place conversion of NTFS filesystem to Btrfs by chris37879 on Monday March 07, 2022 @03:44PM (#30593105)
I didn't know about the swapfile thing... but TIL. I had been wondering how to to make a non-snapshotted volume for some other reasons, though, so that's a 2 birds with one stone thing, thank you!
Re:ntfs2btrfs: In-place conversion of NTFS filesystem to Btrfs by bgorman on Monday March 07, 2022 @11:56AM (#30590191)
I have not used BTRFS for years, but I remember at some point a BTRFS regression prevented me from booting my system. It is hard to regain trust after such a meltdown from such a fundamental component. That said, I believe my Synology NAS uses btrfs and it has never had an issue.
Re:ntfs2btrfs: In-place conversion of NTFS filesystem to Btrfs by F00Fbug on Monday March 07, 2022 @12:08PM (#30590344)
I've been in the same boat. Around 2012 or 2013 I put BTRFS on my DIY NAS/media server. For some reason, totally unprovoked the array just went belly up with no warning or logs. I tried and tried without success and couldn't recover it. Fortunately I had good, recent backups and restored to ext4+LVM and I'm still there 10 years later.

BTRFS sounded cool with all it's new features, but the reality is that ext4+LVM does absolutely everything I need and it's never given me any issues.

I'm sure BTRFS is much more robust these days, but I'm still gun shy!

Re:ntfs2btrfs: In-place conversion of NTFS filesystem to Btrfs by danudey on Monday March 07, 2022 @03:55PM (#30593209)
In 2019 I was setting up my new computer at my new job, and the Ubuntu installer had btrfs as an option. Figuring that it had been ages since the last time I'd heard about btrfs issues, I opted for that.

A week later, the power failed in the office, and my filesystem got corrupted. In the middle of repairing, the power dipped again, and my entire fs was unrecoverable after that. I managed to get the data off by booting off a separate drive and running a command to extract everything, but it would never mount no matter what I did.

I've never had an issue with ext4, xfs, or zfs no matter how much I've abused them over the past 10+ years, but if losing power twice can wipe out my filesystem then no thanks, I'm out.

(Plus: non-recursive snapshots? No thanks.)

Re:ntfs2btrfs: In-place conversion of NTFS filesystem to Btrfs by viraptor on Monday March 07, 2022 @09:17PM (#30595732)
Are you sure you never had an issue, or did you just not notice? Ext4 and xfs can mangle your files and never let you know because they don't checksum. This comes up often in comparisons and I wish people paid attention to the difference.
Re:ntfs2btrfs: In-place conversion of NTFS filesystem to Btrfs by silisili on Monday March 07, 2022 @04:55PM (#30593811)
Yeah...I used to live in an old neighborhood with above ground lines and huuuge trees. Every strong windblow would flip the power out for a second. Some days a few times a day, some days never.

EXT4 has never once failed me, and I personally battle tested it by working while losing power probably a total of 200 times. I probably should have bought a UPS come to think of it.

Re:ntfs2btrfs: In-place conversion of NTFS filesystem to Btrfs by Dylan16807 on Monday March 07, 2022 @05:18PM (#30594098)
Was it RAID5/6? If not that's worrying. I've had one BTRFS system eat itself to the point that it could only be mounted read-only, but no data loss.
Re:ntfs2btrfs: In-place conversion of NTFS filesystem to Btrfs by codys on Monday March 07, 2022 @08:54PM (#30595626)
Not the OP, but I deployed btrfs on tens of embedded systems that had their power consistently cut on a daily basis. Ended up with unmountable filesystems repeatedly. Switched to ext4 and never had an unmountable filesystem again.

These were single disk systems, no raid at all.

Re:ntfs2btrfs: In-place conversion of NTFS filesystem to Btrfs by nearlyepic on Tuesday March 08, 2022 @01:04PM (#30603313)
Gonna pitch in my anecdata:

Around the timeframe you mentioned, I lost a BTRFS filesystem when I filled it up. Probably could have recovered it if I had known more, but oh well. I definitely feel the gun-shyness!

However, I'd want to add that at a previous job, I had a ext4 fs go belly-up in a similar way. One day, just died without warning. Maybe could have recovered it, but like others have mentioned we'd have no guarantees about the data.

Moral of the story is, of course, always have backups :)

Re:ntfs2btrfs: In-place conversion of NTFS filesystem to Btrfs by stjohnswarts on Monday March 07, 2022 @03:00PM (#30592625)
I sort of had the same experience, dropped it for a decade, and came back around. It's a lot more robust these days. Also the btfsmaintenance tools take a lot of the load off of an admin. I just use the default settings and don't have any issues.
Re:ntfs2btrfs: In-place conversion of NTFS filesystem to Btrfs by regularfry on Monday March 07, 2022 @12:09PM (#30590354)
It certainly used to be the case that BTRFS had some nasty behaviour patterns when it started to run low on space. It could well be that it has not presented any problem for you yet.

On the other hand, those days might be behind it. I haven't kept track.

Re:ntfs2btrfs: In-place conversion of NTFS filesystem to Btrfs by cmurf on Monday March 07, 2022 @02:40PM (#30592389)
There are still edge cases but I can count on one hand the number of users who have run into it since Fedora switched to Btrfs by default (on desktops) two years ago (and Cloud edition in the most recent Fedora release late last year).

The upstream maintainer of btrfs-progs also maintains btrfs maintenance https://github.com/kdave/btrfsmaintenance which is a set of scripts for doing various tasks, one of which is a periodic filtered balance focusing on data block groups. I don't run it myself, because well (a) I haven't run into such a bug in years myself (b) I want to run into such a bug so I can report it and get it fixed. The maintenance script basically papers over any remaining issues, for those folks who are more interested in avoiding issues than bug reporting (a completely reasonable position).

There's been a metric ton of work on ENOSPC bugs over the years, but a large pile were set free with the ticketed ENOSPC system quite a few years ago now (circa 2015? 2016?)

Re:ntfs2btrfs: In-place conversion of NTFS filesystem to Btrfs by badsectoracula on Monday March 07, 2022 @12:03PM (#30590287)
> deduplication, checksumming, snapshotting, and so many other features that modern FSes generally come with (e.g., ZFS)

Does any other FS on Linux provide those?

Re:ntfs2btrfs: In-place conversion of NTFS filesystem to Btrfs by coder543 on Monday March 07, 2022 @12:54PM (#30591029)
bcachefs is probably the other big name here, but since distros still seem to pick btrfs, I don't think it's considered "production ready" yet. The bcachefs website still labels it as "beta" quality.
Re:ntfs2btrfs: In-place conversion of NTFS filesystem to Btrfs by doublepg23 on Monday March 07, 2022 @01:00PM (#30591109)
The best way to stay up-to-date on bcachefs is the Patreon, Kent writes great updates there.

https://www.patreon.com/bcachefs

Re:ntfs2btrfs: In-place conversion of NTFS filesystem to Btrfs by londons_explore on Monday March 07, 2022 @01:09PM (#30591229)
bcachefs is written by the same person who wrote bcache... And that has a lot of subtle eat-your-data pitfalls.[1] I don't really trust bcachefs not to do the same.

[1]: https://omattos.com/2020/01/02/bcache.html

Re:ntfs2btrfs: In-place conversion of NTFS filesystem to Btrfs by assbuttbuttass on Monday March 07, 2022 @04:22PM (#30593489)
bcachefs isn't even mainlined yet. You'd have to build your own kernel to test it out (or I think NixOS packages it)
Re:ntfs2btrfs: In-place conversion of NTFS filesystem to Btrfs by throwawaylinux on Monday March 07, 2022 @12:14PM (#30590437)
That's traditionally the domain of logical volume managers.
Re:ntfs2btrfs: In-place conversion of NTFS filesystem to Btrfs by coder543 on Monday March 07, 2022 @12:51PM (#30590997)
Snapshots, sure.

But... any of the other stuff? Checksums, deduplication, compression, etc. Citations, please.

LVM VDO wasn't really a thing until a couple of years ago, and I've never actually heard anyone recommend using it. Definitely not within its "traditional domain".

Perhaps you mean on other operating systems... when this discussion is all about a Linux filesystem and whether other Linux filesystems provided these features, including the comment you replied to?

Re:ntfs2btrfs: In-place conversion of NTFS filesystem to Btrfs by throwawaylinux on Monday March 07, 2022 @01:40PM (#30591596)
> But... any of the other stuff? Checksums, deduplication, compression, etc. Citations, please.

Yes. The Linux LVM logical volume manager for example can do those things.

Traditional domain meaning this kind of data management traditionally came under the purview of LVMs. Not that an implementation has had particular features for a length of time, but that you might (also) look there rather than the filesystem for those features.

Re:ntfs2btrfs: In-place conversion of NTFS filesystem to Btrfs by hnlmorg on Tuesday March 08, 2022 @03:51AM (#30597935)
Deduplication and compression have traditionally been file system features not volume management features:

As fair as I know the only solution for deduplication in LVM is VDO and that was created after ZFS and isn't technically part of LVM (it's a kernel module that sits between the filesystem and LVM).

Same is true for compression except in the case of compression that's been a file system feature since the days of NTFS on NT 3.5 (released 1995) -- I can't recall when UNIX file systems first saw compression but I'd wager it was before ZFS, which we've already acknowledge predates VDO.

I also thing it makes sense that the above should be part of the file system domain because it's an integral part to how the file system organizes the data (much like how we don't argue that the journal isn't part of the file system domain).

As for checksums, they have existed in all parts of the stack, from the application level (for example rsync), to the volume level (RAID controller cards) to the file system. I wouldn't say that's something that has ever had a "traditional domain".

The things I'd say ZFS and its ilk do that isn't part of its traditional domain is RAIDing (ie management of the physical devices) and cache control. Both make a lot of sense being managed by the file system in modern file systems but I can also sympathize with those who think that's a step too far. In the case of RAIDing, you can still run ZFS on LVM or a hardware controller if you wish -- I wouldn't suggest you do so because it gives you additional complications for zero benefit but the option is still there if you want it. But with regards to cache, the only way to opt out of ZFS managing it's own cache is not to use ZFS.

Re:ntfs2btrfs: In-place conversion of NTFS filesystem to Btrfs by throwawaylinux on Tuesday March 08, 2022 @07:02AM (#30598987)
Data plane management sure has traditionally been done with logical volume managers on unix particularly which introduced logical volume managers around late 80s. Not sure when deduplication exactly was available for Linux, probably around the same time as it was for ZFS on Solaris with VxVM. Various other vendors had their own LVM based dedup (NetApp comes to mind).

Anyway it wasn't really a statement about what was there first or not, but rather that because something may not exist for a filesystem does not mean it does not exist, i.e., look at other layers for such functionality.

Re:ntfs2btrfs: In-place conversion of NTFS filesystem to Btrfs by LeoPanthera on Monday March 07, 2022 @01:20PM (#30591348)
VDO provides a compression and duplication layer for any traditional filesystem.

https://www.redhat.com/en/blog/look-vdo-new-linux-compressio...

Re:ntfs2btrfs: In-place conversion of NTFS filesystem to Btrfs by cmurf on Monday March 07, 2022 @02:34PM (#30592313)
VDO isn't in the mainline kernel still.
Re:ntfs2btrfs: In-place conversion of NTFS filesystem to Btrfs by chasil on Monday March 07, 2022 @07:14PM (#30595023)
Modern Ubuntu has both BtrFS and ZFS install options in the GUI installation tool.
Re:ntfs2btrfs: In-place conversion of NTFS filesystem to Btrfs by coder543 on Monday March 07, 2022 @08:21PM (#30595425)
Are they going to add zfs to the TUI installer for Ubuntu Server? I've tried several times over the last year, and I have yet to find a good method for getting Ubuntu Server running on zfs root.
Re:ntfs2btrfs: In-place conversion of NTFS filesystem to Btrfs by hda111 on Tuesday March 08, 2022 @02:57PM (#30605874)
It isn’t in 22.04, so for servers we probably see it not before 24.04. Only way is the official guide from openzfs: https://openzfs.github.io/openzfs-docs/Getting%20Started/Ubu...

One can also try convert a desktop installation into a server installation (not sure if it’s possible)

Re:ntfs2btrfs: In-place conversion of NTFS filesystem to Btrfs by coder543 on Tuesday March 08, 2022 @10:11PM (#30610494)
Step 1 ("Prepare the Install Environment") starts by assuming you have a Live CD, which implies the desktop distro. I've been to that guide several times while searching fruitlessly for a method to install Ubuntu server onto a zfs root. I think you would basically have to spin your own ISO at this point.
Re:ntfs2btrfs: In-place conversion of NTFS filesystem to Btrfs by chasil on Tuesday March 08, 2022 @11:01PM (#30610792)
whisper... FreeBSD ...whisper
Re:ntfs2btrfs: In-place conversion of NTFS filesystem to Btrfs by deknos on Monday March 07, 2022 @01:56PM (#30591811)
i also wonder, if there are parts of features of zfs/btrfs in other parts of fs systems... someone should build a comparison matrix :D
Re:ntfs2btrfs: In-place conversion of NTFS filesystem to Btrfs by chasil on Monday March 07, 2022 @07:15PM (#30595032)
Oracle had published a blog post on XFS checksums and dedupe, but it appears to have been taken down.
Re:ntfs2btrfs: In-place conversion of NTFS filesystem to Btrfs by dotancohen on Monday March 07, 2022 @12:05PM (#30590302)
Are you using a UPS on the desktop? A recent HN thread highlighted BTRFS issues, especially with regards to dataloss on power loss. Also, there's a "write hole issue" on some RAID configurations, RAID 4 or 6 I think.

That said, I'm thinking about leaving a BTRFS partition unmounted and mounting it only to perform backups, taking advantage of the snapshotting features.

Re:ntfs2btrfs: In-place conversion of NTFS filesystem to Btrfs by waffleiron on Monday March 07, 2022 @12:20PM (#30590542)
It's RAID 5/6, there is a great status page:

https://btrfs.wiki.kernel.org/index.php/Status

Re:ntfs2btrfs: In-place conversion of NTFS filesystem to Btrfs by michaelmrose on Monday March 07, 2022 @02:24PM (#30592207)
This would seem to suggest that ANY raid configuration is unacceptable.

Device replace

--------------

>Device replace and device delete insist on being able to read or reconstruct all data. If any read fails due to an IO error, the delete/replace operation is aborted and the administrator must remove or replace the damaged data before trying again.

Device replace isn't something where "mostly ok" is a good enough status.

Re:ntfs2btrfs: In-place conversion of NTFS filesystem to Btrfs by wtallis on Monday March 07, 2022 @06:05PM (#30594533)
This doesn't sound like a bug to me. It sounds like a refusal to fail silently.
Re:ntfs2btrfs: In-place conversion of NTFS filesystem to Btrfs by withinboredom on Monday March 07, 2022 @08:41PM (#30595533)
If you’re removing a device, it shouldn’t matter if the data is unreadable (that’s probably why it’s being removed, no?)
Re:ntfs2btrfs: In-place conversion of NTFS filesystem to Btrfs by wtallis on Monday March 07, 2022 @11:25PM (#30596432)
I interpreted "being able to read or reconstruct all data" as meaning that there must exist a good valid copy of each chunk of data somewhere in the array, but not necessarily on the device that you're trying to remove or replace. That interpretation matches my experience, which is that btrfs can correctly handle replacing a drive that is dead or dying. You should certainly expect errors if eg. both copies of a chunk in a RAID1 are lost/corrupted.
Re:ntfs2btrfs: In-place conversion of NTFS filesystem to Btrfs by michaelmrose on Tuesday March 08, 2022 @02:57AM (#30597572)
If you have a read error can you expect to recover the rest of the data?
Re:ntfs2btrfs: In-place conversion of NTFS filesystem to Btrfs by withinboredom on Tuesday March 08, 2022 @07:40AM (#30599231)
I’d hope so. Just because one bit is missing from a file, doesn’t mean the rest of the files are gone.
Re:ntfs2btrfs: In-place conversion of NTFS filesystem to Btrfs by amelius on Monday March 07, 2022 @05:16PM (#30594074)
Are they testing BTRFS with power interruptions (or simulated equivalents thereof?)
Re:ntfs2btrfs: In-place conversion of NTFS filesystem to Btrfs by stjohnswarts on Monday March 07, 2022 @02:55PM (#30592562)
I was an early adopter and some bad experiences early on made it a bitter pill. I swore it off for a decade, and about year and half came back around. It's MUCH MUCH better now. With automated "sensible" settings for btrfsmaintenance tools it's actually just fine now.
Re:ntfs2btrfs: In-place conversion of NTFS filesystem to Btrfs by hnlmorg on Tuesday March 08, 2022 @03:57AM (#30597971)
I honestly don't see the point of Btrfs. ZFS is more mature, more stable, better defaults, etc. The only reason Btrfs existed was because ZFS wasn't GPL. But now we have a way of running ZFS on Linux Btrfs seems utterly redundant.

I mean I'm all for choice on Linux but when it comes to file systems I'd rather have fewer choices but those choices be absolutely rock solid. Btrfs might have gotten to that stage now however it's eaten enough peoples data (including mine) over the years that I can't help wondering why people bothered to persist with using it when a better option was available.

Re:ntfs2btrfs: In-place conversion of NTFS filesystem to Btrfs by pronik on Tuesday March 08, 2022 @01:52PM (#30604248)
Anecdata: Once upon a time I installed a SuSE with their default choice of ReiserFS (v3) as root partition. Couple of months later that filesystem was dead beyond repair. I don't know whether I did something wrong, but I've been very wary of "defaults" ever since. That said, that was a different time and I tend to see a ZFS or a BTRFS in my near future.
Re:ntfs2btrfs: In-place conversion of NTFS filesystem to Btrfs by atoav on Tuesday March 08, 2022 @02:27AM (#30597338)
One of the a little weird things about btrfs is that some Software (e.g. OBS) seems to have a hard time to get the free space on disk. Maybe because they assume the usual ways of getting free space works (which doesn't on btrfs)
Re:ntfs2btrfs: In-place conversion of NTFS filesystem to Btrfs by nix23 on Tuesday March 08, 2022 @05:27AM (#30598427)
DONT DO THAT:

Try to fill your root-filesystem with dd, then remove the file and sync, reboot and enjoy a non booting OS ;) It's like they don't test it at all.

Re:ntfs2btrfs: In-place conversion of NTFS filesystem to Btrfs by 0xbadcafebee on Monday March 07, 2022 @12:58PM (#30591088)
> If the distributions are willing to take that maintenance on their shoulders, I'm willing to trust them and deal with the consequences – at least I know I'm not alone.

But then they make changes that add an insane amount of complexity, and suddenly you're running into random errors and googling all the time to try to find the magical fixes to all the problems you didn't have before.