News for hackers. Stuff that matters.
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