Forgot your password?
typodupeerror
Data Storage Open Source Linux

A Newly Proposed Linux Filesystem Can Fix Corrupted Data (itsfoss.com) 68

BeamFS creator Aurelien Desbrieres is not calling for a merge, but is requesting feedback on an 18-patch proposal that takes the place of FTRFS, an earlier filesystem he proposed in April.

The Linux/Open Source blog It's FOSS reports: Filesystems that can repair damage, like Btrfs and ZFS, usually do it by falling back on a spare copy of the data. BeamFS skips that and stores Reed-Solomon error-correcting codes inside every block. Every read gets checked against those codes, and small amounts of damage are corrected before the data reaches the application. If the filesystem can tell the damage is beyond repair, the read fails with an error instead of returning the wrong bytes...

In his technical report, ext4 and ext3 returned wrong data without any error, while Btrfs refused to read the file. BeamFS returned the correct file every time except once, when a flip hit a pointer to the file's data and it refused the read.

"Aurelien says he used Anthropic's Claude to write the code, the tool that checks the patches, and the cover letter..."

A Newly Proposed Linux Filesystem Can Fix Corrupted Data

Comments Filter:
  • by NobleNobbler ( 9626406 ) on Sunday October 25, 2026 @06:08PM (#66392858)

    Oh FFS. I hope the linux mailing list doesn't start accepting these claude jargon filled technical discourses.

    "atmospheric neutrons alone upset avionics at altitude (Normand [9]); and the medium is not exempt"

    ??????

    • by MachineShedFred ( 621896 ) on Sunday October 25, 2026 @07:04PM (#66392928) Journal

      Just because you don't understand, doesn't make it not true.

      Cosmic radiation indeed causes higher storage failure rates in avionics systems. However, because we can do things like redundant storage, the problem usually isn't in the file system, but the SSD firmware.

      It's incredibly common to replace an LRU (Line Replaceable Unit), take the SSD out of the replaced LRU and reflash the firmware on it, and reinstall and test to find out that the device works perfectly again because it was a bit-flip in the SSD controller firmware.

      Source: I am an avionics engineer.

      • Comment removed based on user account deletion
      • I understand everything you said, but the quoted line is still phrased pretty awkwardly. I frequently hear people talking about radiation, cosmic rays, etc. (I'm not an aerospace engineer myself, but I work with a lot of them). I don't think I've ever heard anyone talking about atmospheric neutrons though. Being that specific almost never matters to anyone except maybe the engineers working specifically on the radiation hardening.

        And "the medium is not exempt" is just weird.
        • The cited paper uses the phrase "atmospheric neutrons" in the abstract. It's from 1996.

          • Sure, but is the cited paper about file systems, radiation hardening of aerospace hardware, or something else entirely? My point isn't whether or not the phrase is a real scientific term used by physicists, the point is whether or not the phrase is meaningful or relevant to someone reviewing the code for a file system.
            • "Single-event effects in avionics," from the IEEE Transactions on Nuclear Science. https://ieeexplore.ieee.org/do... [ieee.org]

              Abstract:
              The occurrence of single-event upset (SEU) in aircraft electronics has evolved from a series of interesting anecdotal incidents to accepted fact. A study completed in 1992 demonstrated that SEUs are real, that the measured in-flight rates correlate with the atmospheric neutron flux, and that the rates can be calculated using laboratory SEU data. Once avionics SEU was shown to be an ac

              • So that just brings us right back to my question about why someone reviewing code for a file system would care about that level of detail. Like you said, the paper is from 1996; anyone working on file systems 30 years later already knows about bit flips.
                • by allo ( 1728082 )

                  Because Bit-Flips due to atmospheric radiation is a use case of the filesystem. How often do you get bitflips in your desktop PC? Either blocks are dying or they are not, but random flips are rare. In a airplane things are different.

      • by AmiMoJo ( 196126 )

        I'm a little surprised nobody makes an aviation grade SSD that has the firmware burned into a ROM, and with some RS coding to correct errors in the NAND. I guess there is probably some cost issue, as in it's cheaper to just deal with failing SSDs than to develop such a device.

        • by MachineShedFred ( 621896 ) on Monday October 26, 2026 @10:41AM (#66393812) Journal

          That's exactly the calculation. Use redundant storage in-flight, and make LRU swaps very quick on the ground. If you catch a failure in-flight, you have a tech with a replacement LRU waiting for the plane when it lands (for various values of "where" - obviously you don't have techs at every airport).

          It's really not that different from anticipating disk failure in a server by having online redundancy, and a service callout to replace the part. Especially if you can quickly refurbish and recertify the LRU and put it right back into the replacement inventory.

          • by AmiMoJo ( 196126 )

            Thanks, that's interesting.

            • It also depends on the safety certification level. If you're in navigation or fuel management systems (DAL-B certification) and such, the rules are very different from DAL-E certified things like the in-flight entertainment / connectivity systems.

              Much more rigor is applied to DAL-A / -B / -C as you can imagine, because they are safety critical. And thus the price goes far higher, because active operation must be maintained.

    • The cited article is E. Normand, "Single-event effects in avionics," in IEEE Transactions on Nuclear Science, vol. 43, no. 2, pp. 461-474, April 1996, doi: 10.1109/23.490893 https://ieeexplore.ieee.org/do... [ieee.org]

      I don't have access to the full text, just the abstract, but the abstract does use the phrase "atmospheric neutrons".

      The article is from 1996, so think it is unlikely that the phrase is "claude jargon" rather than an actual term of art.

  • Vibe coded huh? (Score:3, Insightful)

    by karmawarrior ( 311177 ) on Sunday October 25, 2026 @06:17PM (#66392864) Journal

    A vibe coded *file system*. Really.

    Gonna stay away from this one.

    • It's also completely the wrong thing to use. RS-coding will deal with small amounts (bits/bytes depending on the layout) of data corruption, not general filesystem corruption. And the overhead is enormous, unless you're streaming data through hardware that can correct and reassemble on the fly it's not practical, and for filesystems even useful.

      This proposal is a bit like the hypothetical "why didn't we use the space shuttle to rescue the Apollo 13 astronauts" question. Yeah, you just go ahead and do that

      • by dargaud ( 518470 )
        I think it is a proposed solution to bit-rot, not to failing device blocks. As such, why not, but it's gonna degrade the writing space by 20% or something, no ?
        • Or if you're really worried about these types of errors you could just use one of the error-recovery-targeted RAID levels and not have to worry about the massive performance hit of RS-encoding and -decoding each data block read...
          • I really don't think most RAID implementations check data as it's read so won't catch random bit flips. It protects against known failed devices, which seem to be the majority of issues we see in practice.

            RAID Z does check checksums if you are on ZFS.

      • RS is well suited to this problem space. The overhead is a fixed percentage of the filespace. Error detection is computationally simple. Error correction uses more compute but it's only invoken when there is an error.

        If you want reliable storage, using forward error correction is an entirely sensible thing to do. I have my own file level FEC using A concatenated Golay & RS with data reordering that I use on stuff I don't want to fall to bit rot. It's neither complicated nor computationally prohibitive.

        • If it's not clear, the data reordering spreads block errors across many blocks, so long runs of errors turn into multiple individual bit errors that are handled efficiently by the code. The Golay part of the concatenated code mops up these. The RS part deals with larger blocks.

        • by AmiMoJo ( 196126 )

          Is there any advantage over RAID5 though? Doesn't ZFS do this at a block level?

          • I'm finding that ZFS is stupid, and I'm thinking about switching to normal dmraid.

            Notably, if you really load it up for a while such that it has a chance to fill up its buffers, it doesn't save any I/O for anything else. The whole system just gets punched right in the fucking balls and becomes completely unusable while the cache empties. Maybe there's some way to tune this tendency out of it, but...SANE DEFAULTS!!! If your project doesn't have them, you're a fuckup! Allowing one process to make a system unu

          • Is there any advantage over RAID5 though? Doesn't ZFS do this at a block level?

            RAID5 is at the disk level. What about files that lay around on USB sticks or cloud drives? Those need some FEC love too.

      • by Jeremi ( 14640 )

        This proposal is a bit like the hypothetical "why didn't we use the space shuttle to rescue the Apollo 13 astronauts" question. Yeah, you just go ahead and do that then.

        Well, dude did go ahead and do that. Whether it's a useful approach is certainly debatable, but since there's a working prototype, anyone can test it and find out.

  • I hear it works using GenAI to rebuild an approximation of the data, so close a human can't distinguish it.

    Unfortunately, this also means Linux will not boot without a gemini api key added to Grub.

  • send it to public school labs for a while. Let them create stress tests and pen tests to teach.
  • That would have been really useful for some mag tape systems I used to use. They had too many errors for their error correction system.

    OTOH, this kind of thing is very likely to have bugs. Test it THOROUGLY before folks start depending on it. Perhaps, after it passes initial tests, make it an optional choice in the installer, and require extra steps to do the install (with warnings: CAUTION: BETA FILE SYSTEM HAS BEEN CHOSEN).

    File systems need more thorough testing that most software choices.

    • It's a very reasonable approach, so reasonable that the drives already store ECC data. Why do you think it reports "corrected" and "uncorrected" errors separately in SMART data?

      Is there really a need to store multiple copies of ECC codes? At some point, why not just rely on backups. Checksumming is good, wasting diskspace because of a neutrino from space is not.

    • by tlhIngan ( 30335 )

      That would have been really useful for some mag tape systems I used to use. They had too many errors for their error correction system.

      You should do it for backup systems. It's why PAR2 exists. You run it over your data and it creates the Reed-Solomon parity files. Each file contains a checksum of every file in the set, and you need only enough parity file to fix the corruption. E.g., if you have a 1MB block that's corrupted, you just need a 1MB parity file. The files often come in varying sizes so you just

      • There's lots of programs able to handle the PAR2 format and it's been around for decades.

        Used to use this way back to fix incomplete binary downloads from newsgroups.

      • by HiThere ( 15173 )

        The tapes I was talking about were 800 bpi reels even parity. (The odd parity ones had better error recovery.)

  • by Anonymous Coward

    In fact, ZFS checksums every block, and then checksums those checksums so it knows which copy of the data is correct one (in the case of a 1:1 mirror, for instance).

    • Plus, in the case of ZFS, it stores 2 copies of standard Metadata, by default. (Also covered by checksums...) Even without any Mirroring or RAIDing. (Standard Metadata is things like directory entries, access control lists and extended attributes. There is even 3 copies of more critical Metadata.)

      To be clear for those that don't know, with the defaults and a simple 2 way Mirror, ZFS will have 4 copies of standard Metadata. 2 per Mirror, and 2 way Mirror is 4 copies, (of standard Metadata).

      So that case o
      • " it stores 2 copies of standard Metadata"

        That's the problem. 2x data is larger than data + error correction for no benefit.

        • nah, a RS code can correct a tiny bit of loss but two metadata copies can correct a bad sector or even track if you're lucky.

          Different requirement spaces.

          The idea this guy has might make embedded devices slightly more long-lasting.

          They usually have quantity one of a cheap storage part and a bad block in the wrong place could brick the whole thing.

          It would only be useful in the case where maybe the build is 12MB and the chip is 16.

          Most vendors won't ever pay extra for this.

    • by allo ( 1728082 )

      why do you need this? If you have RAID1 and one file gets corrupted you have a file with correct checksum and a file with incorrect one. ZFS checksums are not just parity like RAID5, but true file hashes.

  • by ByTor-2112 ( 313205 ) on Sunday October 25, 2026 @07:05PM (#66392930)

    Seems like you would want to store the error correction data somewhere besides right at the data, if it is your recovery plan - like an off site backup. Use a fast checksum for the initial validation and only read the error correction when necessary.

    • by CAIMLAS ( 41445 )

      No, that's when you want a RAID system with multiple disks.

      This is only for small corruption, like a failing drive might cause, or due to cosmic rays/bitflips.

      This is just EC for a non-redundant drive.

    • No, you're confusing backups, redundancy and error correction. The latter, ECC, is *always* stored locally and exists to address single unit errors. It's usually stored in a way that can be read as part of a sequential read operation as every read needs to be checked so having ECC information non-locally would lead to a huge performance cost.

      The scenario here is bit flip or bad block or some in flight data corruption. Not a failure of a storage medium.

  • Why ? (Score:5, Interesting)

    by Bomazi ( 1875554 ) on Sunday October 25, 2026 @07:49PM (#66392980)
    Linux already has dm-integrity, a layer that emulates a block device with per-sector tags that store integrity information. If you insert it between a block device and any filesystem, you get the same result, including a read error if the data cannot be corrected.

    I don't see an explanation of why you would need a whole new filesystem.
    • by ffkom ( 3519199 )
      Indeed. Also, with no knowledge of the physical and logical layout of the underlying storage devices, error-correction coding inside a filesystem will be inefficient at best, or more like even be ineffective: If, for example, the underlying storage device itself is some NAND-flash that happens to read entire 128kB blocks and has an internal error correction coding mechanism for those, then if that device's error correction attempt fails and you get a read-error on that level, than your file-system may well
    • by allo ( 1728082 )

      Why do you need BTRFS subvolumes (or even RAID) when there are LVM / device-mapper solutions to this? Because some things are better handled on file basis than on block basis. With BTRFS you can put a 4 TB disk, 2 1TB disks and a 2 TB disk into a RAID and be sure every file is stored on two disks, even though a block-layer mapping between this disks would be a nightmare to maintain. Why does it work? Because BTRFS knows what a file is and the device mapper only knows block positions.

    • One of the more subtle dangers of vibe coding is that the genAI system will generally drown you in praise and at no point tell you that it's already been done or that there are already ways to achieve what you're doing.

      That's why this project got to the coding stage.

  • by evanh ( 627108 ) on Sunday October 25, 2026 @07:58PM (#66392998)

    Any descent storage hardware will already do this, in hardware. How do they think HDDs and SSDs keep track of the number of corrected and uncorrected errors?

    • No not quite. The HDD / SSD writing checksums onto the platter only cover the write operation itself. It will only confirm what bits were written to the platter along with its immediate ECC codes are correct, and it does not confirm any failure outside the immediate write operation. An example of corruption that it would miss is a power failure mid-write. The in flight bits would be written along with the ECC code before the power goes out (thanks to capacitors, especially true for SSDs which need to then n

      • by evanh ( 627108 )

        Are you trying to argue that HDDs and SSDs don't use full ECC? You do realise even the humble, no criticality, audio CDs used full blown ECC, right?

        • No not at all, but I was arguing for a point of confusion. I was talking about a file system level checking can be larger in scope but the summary does say this is block level so it is actually completely redundant.

          My main point was on scope. Something like ZFS is still necessary because the HDD doesn't know what a file is, it only knows what a short sequence of bits are, and while those bits may be correct a file may be corrupt if they are part of a missing sequence. So filesystem level error correction is

      • by evanh ( 627108 )

        ECC is heavily used everywhere in telcos. We have quality long distance data links because of hardware ECC. It's just a basic part of modern digital fabric.

        • ECC is heavily used everywhere in telcos. We have quality long distance data links because of hardware ECC. It's just a basic part of modern digital fabric.

          Indeed, and I'm not refuting the importance of ECC. I'm refuting the importance of ECC doing it twice (once in hardware, and again in the filesystem). It's a question of scope.

          If a sector on a disc has ECC let that deal with it. The error may be frequent and correction of an individual bit is important.
          A file system on the other hand doesn't suffer from individual bit flips, that's already handled by the disc's ECC. ECC isn't important here, checksumming of the entire file to ensure all the data is intact i

  • by backslashdot ( 95548 ) on Sunday October 25, 2026 @10:45PM (#66393178)

    I refuse to adopt any Linux filesystem without proof of life evidence from the founder's wife.

  • What about the scenario with large localized corruption? Also, BeamFS is naturally more sensitive to structural corruption, if that's the scenario, because there is no multi-device capability to regenerate trees. It's a no free lunch situation and it is understood that BeamFS will outperform anything in a properly contrived read-path fault injection.
  • That's such a dumb, smoothbrained description I doubted the capabilities of the person who wrote it - at first.

    Then I realized he was right. There isn't a filesystem that does RS or, really, any sort of single-device EC. This is a genuinely good idea, at least for spinning disks, where sector corruption is more likely.

    This may be personal anecdote only, but I've only seen 1 SSD get any sort of data corruption as a failure mode, and it was a very early iteration - maybe a 8 or 16GB one. SSDs seem to simply f

    • There isn't a filesystem that does RS or, really, any sort of single-device EC.

      There's a reason for this:
      a) the ATA spec has error correction to maintain data in flight.
      b) single-devices (e.g. your HDD) has error correction as part of its normal operation.

      You can see how well this works by looking up the SMART attributes for any HDD and reading:
      195 - Hardware ECC Recovered
      184 - End-to-End error / IOEDC (not all drives report this one)
      and
      204 - Soft ECC Correction

      and when shit hits the fan you get:
      187 - Reported Uncorrectable Errors

  • "Reed-Solomon error-correcting codes"

    So you literally re-invented RAID-6? UUuuuhhhh, congrats, I guess?

    • You don't need RAID anything. Reed-Solomon error-correcting codes are used on every drive compliant with the ATA specification. There's not a 1-1 relationship between bits on the platter, and storage capacity of a drive.

      So yeah RAID-6 re-invented RAID-5, which reinvented the HDD that already existed, which reinvented the CD, which reinvented the mechanical tape... do you see how stupid the "literally re-invented" part of what you said actually is?

  • by Lady Galadriel ( 4942909 ) on Monday October 26, 2026 @03:58AM (#66393350)
    Years ago I built a miniature PC to act as a media server and store master copies of scripts, help files and act as a print server. A year or so after I built it, I moved all the file systems to ZFS. However, with only an 1TB mSATA SSD and 2TB laptop HDD I could not Mirror everything. So I Mirrored the OS only. Then used ZFS to concat / stripe the remaining space for my media.

    This worked reasonably well. A few times a year, I got a corrupted file in the media. Pretty straight forward to restore from backups. Not really a problem. Mostly video files because they are large, and would statistically be higher percentage of used space.

    However, whence I implemented ZFS scrubs every 2 weeks, the corruption stopped, COLD. I have not had to restore any file, (due to on disk corruption), in over 6 years!!! And yes, I really mean that non-redundant media pool that has 2.1TBs used. My conclusion is that reading the used storage blocks caused the mSATA SSD & laptop HDD to find any marginal blocks. Then apply their internal ECC, before bad data could be supplied to ZFS.

    Eventually I wrote about this here:
    Arwen Star's blog - Self correcting storage [wordpress.com]

    Now do I believe this is a workable solution for production data?
    Of course not. Any serious data need should have some form of Mirroring or RAID.

    Nor do I believe this is something others should do...
    • Then apply their internal ECC, before bad data could be supplied to ZFS.

      Can you expand on how you think this is supposed to work? ECC is ECC. When it is read is irrelevant especially in the case of HDDs. An unrecoverable error is not blindly passed anywhere, it will be logged by the kernel which would throw an error, and logged in SMART attributes (and is virtually always a precursor to a drive failure). Recoverable errors are just logged in SMART, but do not get passed to the kernel. Critically reading from a HDD does not in any way give you info about its marginal status, nor

    • However, whence I implemented ZFS scrubs every 2 weeks, the corruption stopped, COLD. I have not had to restore any file, (due to on disk corruption), in over 6 years!!! And yes, I really mean that non-redundant media pool that has 2.1TBs used. My conclusion is that reading the used storage blocks caused the mSATA SSD & laptop HDD to find any marginal blocks. Then apply their internal ECC, before bad data could be supplied to ZFS.

      This is strange. SSDs are supposed to have scrubbers that periodically scan for this and rewrite leaky blocks internally.

  • by Slartibartfast ( 3395 ) * <ken@jots . o rg> on Monday October 26, 2026 @07:20AM (#66393474) Homepage Journal

    As a PoC, I'm all over this. But BeamFS supports neither CoW nor journaling, both of which I consider essential for a modern FS. So... yeah. "Heck, no." Maybe someday it will acquire those features, or its "one neat trick" will be merged into another FS.

  • I think it best to let the hardware deal with error correction. It is way better positioned in the stack to judge and handle these sorts of failures at least cost. At best all you need are simple checksums to alert the operator to hardware failure.

  • AFAICT, this is explicitly for fixing flips in transmission between the disk and the page cache. On the storage medium, data is almost certainly already encoded using Reed-Solomon codes or Hamming codes or something of that nature, so you won't receive a block with embedded errors, you will receive a failure to read the block. And you can get ECC for you rmemory. But there may not be end-to-end ECC for every step of transmission. So instead of imagining an entirely new hardware ecosystem (which will ne

All your files have been destroyed (sorry). Paul.

Working...