• Fixing errors on a BTRFS partition?

    From Nate Bargmann@21:1/5 to All on Thu Jan 12 14:50:01 2023
    I have a Freedom Box Pioneer (hardware is an Olimex A20-OLinuXino-LIME2
    unit with a Samsung 128 GB micro-SD card. The micro-SD is partitioned
    into 2GB boot ext2 and the remainder as the root partition as BTRFS.

    The thing has been crashing for months and now it started giving GPG
    signature errors when trying to run 'apt update'. I copied the entire
    micro-SD card to an image file with dd so I have a backup. Running
    'btrfs check' resulted in a lot of errors so I ran the check and
    directed the output to a file which is over 2MB in size! The following
    is a small snippet of what it in the file:

    [1/7] checking root items
    [2/7] checking extents
    checksum verify failed on 2337062912 found 00000098 wanted 00000025
    checksum verify failed on 2337062912 found 00000098 wanted 00000025
    Csum didn't match
    owner ref check failed [2337062912 16384]
    ERROR: errors found in extent allocation tree or chunk allocation
    [3/7] checking free space cache
    [4/7] checking fs roots
    checksum verify failed on 2337062912 found 00000098 wanted 00000025
    checksum verify failed on 2337062912 found 00000098 wanted 00000025
    Csum didn't match
    root 11670 inode 1109704 errors 200, dir isize wrong
    root 11670 inode 1109705 errors 2001, no inode item, link count wrong
    unresolved ref dir 1109704 index 2 namelen 4 name json filetype 1 errors 4, no inode ref
    root 11670 inode 1109706 errors 2001, no inode item, link count wrong
    unresolved ref dir 1095383 index 2 namelen 11 name 20-json.ini filetype 7 errors 4, no inode ref
    root 11670 inode 1109707 errors 2001, no inode item, link count wrong
    unresolved ref dir 978863 index 4 namelen 7 name apache2 filetype 2 errors 4, no inode ref
    root 11670 inode 1109710 errors 2001, no inode item, link count wrong
    unresolved ref dir 1095409 index 2 namelen 11 name 20-json.ini filetype 7 errors 4, no inode ref
    root 11670 inode 1109711 errors 2001, no inode item, link count wrong
    unresolved ref dir 978863 index 5 namelen 3 name fpm filetype 2 errors 4, no inode ref
    root 11670 inode 1109714 errors 2001, no inode item, link count wrong
    unresolved ref dir 978864 index 30 namelen 4 name json filetype 1 errors 4, no inode ref
    root 11670 inode 1109734 errors 2001, no inode item, link count wrong
    unresolved ref dir 45938 index 176 namelen 17 name gschemas.compiled filetype 1 errors 4, no inode ref
    root 11670 inode 1109735 errors 2001, no inode item, link count wrong
    unresolved ref dir 6679 index 36 namelen 15 name giomodule.cache filetype 1 errors 4, no inode ref
    root 11670 inode 1109771 errors 2001, no inode item, link count wrong
    unresolved ref dir 295871 index 242 namelen 24 name rsyslog.service.dsh-also filetype 1 errors 4, no inode ref
    root 11670 inode 1109784 errors 2001, no inode item, link count wrong
    unresolved ref dir 978742 index 31 namelen 12 name readline.ini filetype 1 errors 4, no inode ref
    .
    .
    .
    ERROR: errors found in fs roots
    Opening filesystem to check...
    Checking filesystem on /dev/mmcblk0p2
    UUID: ea375ed2-d6e7-49d4-9b19-a624ba09b96c
    The following tree block(s) is corrupted in tree 11670:
    tree block bytenr: 6562955264, level: 1, node key: (1109704, 96, 3) found 19331854402 bytes used, error(s) found
    total csum bytes: 14201108
    total tree bytes: 1242775552
    total fs tree bytes: 1160757248
    total extent tree bytes: 61292544
    btree space waste bytes: 327420862
    file data blocks allocated: 182356692992
    referenced 113920880640


    Everything online hints that attempting repair is particularly
    dangerous, but what else am I to do? At the moment the system is pretty
    much useless.

    All insights appreciated.

    - Nate

    --
    "The optimist proclaims that we live in the best of all
    possible worlds. The pessimist fears this is true."
    Web: https://www.n0nb.us
    Projects: https://github.com/N0NB
    GPG fingerprint: 82D6 4F6B 0E67 CD41 F689 BBA6 FB2C 5130 D55A 8819


    -----BEGIN PGP SIGNATURE-----

    iF0EABECAB0WIQSC1k9rDmfNQfaJu6b7LFEw1VqIGQUCY8AOYwAKCRD7LFEw1VqI GULAAJ9lVyRN+CDGB/2yjxRxZ2ShDaRgqwCfVxC+AT/DuvOFHqm/XsaBkxUaPwA=
    =SzXt
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Dan Ritter@21:1/5 to Nate Bargmann on Thu Jan 12 15:20:01 2023
    Nate Bargmann wrote:
    I have a Freedom Box Pioneer (hardware is an Olimex A20-OLinuXino-LIME2
    unit with a Samsung 128 GB micro-SD card. The micro-SD is partitioned
    into 2GB boot ext2 and the remainder as the root partition as BTRFS.

    The thing has been crashing for months

    For the future: don't let things go this long. I know it's
    tempting to say "maybe it won't happen again", but the second
    time should be the last time before you take action.



    and now it started giving GPG
    signature errors when trying to run 'apt update'. I copied the entire micro-SD card to an image file with dd so I have a backup. Running
    'btrfs check' resulted in a lot of errors so I ran the check and
    directed the output to a file which is over 2MB in size! The following
    is a small snippet of what it in the file:

    ...

    Everything online hints that attempting repair is particularly
    dangerous, but what else am I to do? At the moment the system is pretty
    much useless.


    1: get a new card, or, much better, replace with a SATA
    SSD. (I see the Olimex has a SATA port. Use it!) Here's a https://www.newegg.com/adata-ultimate-su800-128gb/p/N82E16820215015?Item=9SIAJNUBMB4508
    $29 128GB SSD from a reputable manufacturer.

    2: Reinstall Debian on the new disk. Don't use btrfs on a
    single-drive system; only use btrfs on a mirrored system. In most cases,
    use ext4.

    3: copy all the data you can from the image file.

    -dsr-

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From piorunz@21:1/5 to Nate Bargmann on Thu Jan 12 15:20:01 2023
    On 12/01/2023 13:42, Nate Bargmann wrote:
    I have a Freedom Box Pioneer (hardware is an Olimex A20-OLinuXino-LIME2
    unit with a Samsung 128 GB micro-SD card. The micro-SD is partitioned
    into 2GB boot ext2 and the remainder as the root partition as BTRFS.

    The thing has been crashing for months and now it started giving GPG signature errors when trying to run 'apt update'. I copied the entire micro-SD card to an image file with dd so I have a backup. Running
    'btrfs check' resulted in a lot of errors so I ran the check and
    directed the output to a file which is over 2MB in size! The following
    is a small snippet of what it in the file:

    [1/7] checking root items
    [2/7] checking extents (...)

    Everything online hints that attempting repair is particularly
    dangerous, but what else am I to do? At the moment the system is pretty
    much useless.

    Hi Nate, your hardware has failed and corrupted files were detected by excellent checksumming functionality of Btrfs. Checksums stored does not
    match the file read, and error is shown. Additionally, access may be
    denied to a corrupted file, creating more problems. Its good that you
    created backup of the card, so you can recover things later if you
    really need to.

    You don't have any redundancy on that single card, therefore recovering
    100% of damaged files is impossible, your data is lost. Also, repairing filesystem to usable state (like deleting corrupted files and so on)
    will not fix underlying hardware issue. I suggest obtaining another card
    and installing system to it from the scratch.

    To satiate your curiosity, you can find out what files are corrupted,
    some of the errors are giving filenames. If not, this is my saved
    command to obtain filename from inode numbers:
    sudo btrfs inspect-internal inode-resolve 50845 /

    And obtain filename from logical error:
    sudo btrfs inspect-internal logical-resolve -v 540115857408 /

    As far as I know, Btrfs may refuse to read file with wrong checksum,
    there may be another command to do that.

    --
    With kindest regards, Piotr.

    ⢀⣴⠾⠻⢶⣦⠀
    ⣾⠁⢠⠒⠀⣿⡁ Debian - The universal operating system ⢿⡄⠘⠷⠚⠋⠀ https://www.debian.org/
    ⠈⠳⣄⠀⠀⠀⠀

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Joseph Loo@21:1/5 to n0nb@n0nb.us on Thu Jan 12 16:40:01 2023
    Try this article
    https://en.opensuse.org/SDB:BTRFS

    On Thu, Jan 12, 2023, 5:43 AM Nate Bargmann <n0nb@n0nb.us> wrote:

    I have a Freedom Box Pioneer (hardware is an Olimex A20-OLinuXino-LIME2
    unit with a Samsung 128 GB micro-SD card. The micro-SD is partitioned
    into 2GB boot ext2 and the remainder as the root partition as BTRFS.

    The thing has been crashing for months and now it started giving GPG signature errors when trying to run 'apt update'. I copied the entire micro-SD card to an image file with dd so I have a backup. Running
    'btrfs check' resulted in a lot of errors so I ran the check and
    directed the output to a file which is over 2MB in size! The following
    is a small snippet of what it in the file:

    [1/7] checking root items
    [2/7] checking extents
    checksum verify failed on 2337062912 found 00000098 wanted 00000025
    checksum verify failed on 2337062912 found 00000098 wanted 00000025
    Csum didn't match
    owner ref check failed [2337062912 16384]
    ERROR: errors found in extent allocation tree or chunk allocation
    [3/7] checking free space cache
    [4/7] checking fs roots
    checksum verify failed on 2337062912 found 00000098 wanted 00000025
    checksum verify failed on 2337062912 found 00000098 wanted 00000025
    Csum didn't match
    root 11670 inode 1109704 errors 200, dir isize wrong
    root 11670 inode 1109705 errors 2001, no inode item, link count wrong
    unresolved ref dir 1109704 index 2 namelen 4 name json filetype 1 errors 4, no inode ref
    root 11670 inode 1109706 errors 2001, no inode item, link count wrong
    unresolved ref dir 1095383 index 2 namelen 11 name 20-json.ini filetype 7 errors 4, no inode ref
    root 11670 inode 1109707 errors 2001, no inode item, link count wrong
    unresolved ref dir 978863 index 4 namelen 7 name apache2 filetype
    2 errors 4, no inode ref
    root 11670 inode 1109710 errors 2001, no inode item, link count wrong
    unresolved ref dir 1095409 index 2 namelen 11 name 20-json.ini filetype 7 errors 4, no inode ref
    root 11670 inode 1109711 errors 2001, no inode item, link count wrong
    unresolved ref dir 978863 index 5 namelen 3 name fpm filetype 2 errors 4, no inode ref
    root 11670 inode 1109714 errors 2001, no inode item, link count wrong
    unresolved ref dir 978864 index 30 namelen 4 name json filetype 1 errors 4, no inode ref
    root 11670 inode 1109734 errors 2001, no inode item, link count wrong
    unresolved ref dir 45938 index 176 namelen 17 name
    gschemas.compiled filetype 1 errors 4, no inode ref
    root 11670 inode 1109735 errors 2001, no inode item, link count wrong
    unresolved ref dir 6679 index 36 namelen 15 name giomodule.cache filetype 1 errors 4, no inode ref
    root 11670 inode 1109771 errors 2001, no inode item, link count wrong
    unresolved ref dir 295871 index 242 namelen 24 name rsyslog.service.dsh-also filetype 1 errors 4, no inode ref
    root 11670 inode 1109784 errors 2001, no inode item, link count wrong
    unresolved ref dir 978742 index 31 namelen 12 name readline.ini filetype 1 errors 4, no inode ref
    .
    .
    .
    ERROR: errors found in fs roots
    Opening filesystem to check...
    Checking filesystem on /dev/mmcblk0p2
    UUID: ea375ed2-d6e7-49d4-9b19-a624ba09b96c
    The following tree block(s) is corrupted in tree 11670:
    tree block bytenr: 6562955264, level: 1, node key: (1109704, 96, 3) found 19331854402 bytes used, error(s) found
    total csum bytes: 14201108
    total tree bytes: 1242775552
    total fs tree bytes: 1160757248
    total extent tree bytes: 61292544
    btree space waste bytes: 327420862
    file data blocks allocated: 182356692992
    referenced 113920880640


    Everything online hints that attempting repair is particularly
    dangerous, but what else am I to do? At the moment the system is pretty
    much useless.

    All insights appreciated.

    - Nate

    --
    "The optimist proclaims that we live in the best of all
    possible worlds. The pessimist fears this is true."
    Web: https://www.n0nb.us
    Projects: https://github.com/N0NB
    GPG fingerprint: 82D6 4F6B 0E67 CD41 F689 BBA6 FB2C 5130 D55A 8819



    <div dir="auto">Try this article<div dir="auto"><a href="https://en.opensuse.org/SDB:BTRFS">https://en.opensuse.org/SDB:BTRFS</a><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Jan 12, 2023, 5:43 AM Nate Bargmann &
    lt;<a href="mailto:n0nb@n0nb.us">n0nb@n0nb.us</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I have a Freedom Box Pioneer (hardware is an Olimex A20-OLinuXino-LIME2<br>
    unit with a Samsung 128 GB micro-SD card.  The micro-SD is partitioned<br> into 2GB boot ext2 and the remainder as the root partition as BTRFS.<br>

    The thing has been crashing for months and now it started giving GPG<br> signature errors when trying to run &#39;apt update&#39;.  I copied the entire<br>
    micro-SD card to an image file with dd so I have a backup.  Running<br> &#39;btrfs check&#39; resulted in a lot of errors so I ran the check and<br> directed the output to a file which is over 2MB in size!  The following<br>
    is a small snippet of what it in the file:<br>

    [1/7] checking root items<br>
    [2/7] checking extents<br>
    checksum verify failed on 2337062912 found 00000098 wanted 00000025<br> checksum verify failed on 2337062912 found 00000098 wanted 00000025<br>
    Csum didn&#39;t match<br>
    owner ref check failed [2337062912 16384]<br>
    ERROR: errors found in extent allocation tree or chunk allocation<br>
    [3/7] checking free space cache<br>
    [4/7] checking fs roots<br>
    checksum verify failed on 2337062912 found 00000098 wanted 00000025<br> checksum verify failed on 2337062912 found 00000098 wanted 00000025<br>
    Csum didn&#39;t match<br>
    root 11670 inode 1109704 errors 200, dir isize wrong<br>
    root 11670 inode 1109705 errors 2001, no inode item, link count wrong<br>
            unresolved ref dir 1109704 index 2 namelen 4 name json filetype 1 errors 4, no inode ref<br>
    root 11670 inode 1109706 errors 2001, no inode item, link count wrong<br>
            unresolved ref dir 1095383 index 2 namelen 11 name 20-json.ini filetype 7 errors 4, no inode ref<br>
    root 11670 inode 1109707 errors 2001, no inode item, link count wrong<br>
            unresolved ref dir 978863 index 4 namelen 7 name apache2 filetype 2 errors 4, no inode ref<br>
    root 11670 inode 1109710 errors 2001, no inode item, link count wrong<br>
            unresolved ref dir 1095409 index 2 namelen 11 name 20-json.ini filetype 7 errors 4, no inode ref<br>
    root 11670 inode 1109711 errors 2001, no inode item, link count wrong<br>
            unresolved ref dir 978863 index 5 namelen 3 name fpm filetype 2 errors 4, no inode ref<br>
    root 11670 inode 1109714 errors 2001, no inode item, link count wrong<br>
            unresolved ref dir 978864 index 30 namelen 4 name json filetype 1 errors 4, no inode ref<br>
    root 11670 inode 1109734 errors 2001, no inode item, link count wrong<br>
            unresolved ref dir 45938 index 176 namelen 17 name gschemas.compiled filetype 1 errors 4, no inode ref<br>
    root 11670 inode 1109735 errors 2001, no inode item, link count wrong<br>
            unresolved ref dir 6679 index 36 namelen 15 name giomodule.cache filetype 1 errors 4, no inode ref<br>
    root 11670 inode 1109771 errors 2001, no inode item, link count wrong<br>
            unresolved ref dir 295871 index 242 namelen 24 name rsyslog.service.dsh-also filetype 1 errors 4, no inode ref<br>
    root 11670 inode 1109784 errors 2001, no inode item, link count wrong<br>
            unresolved ref dir 978742 index 31 namelen 12 name readline.ini filetype 1 errors 4, no inode ref<br>
    .<br>
    .<br>
    .<br>
    ERROR: errors found in fs roots<br>
    Opening filesystem to check...<br>
    Checking filesystem on /dev/mmcblk0p2<br>
    UUID: ea375ed2-d6e7-49d4-9b19-a624ba09b96c<br>
    The following tree block(s) is corrupted in tree 11670:<br>
            tree block bytenr: 6562955264, level: 1, node key: (1109704, 96, 3)<br>
    found 19331854402 bytes used, error(s) found<br>
    total csum bytes: 14201108<br>
    total tree bytes: 1242775552<br>
    total fs tree bytes: 1160757248<br>
    total extent tree bytes: 61292544<br>
    btree space waste bytes: 327420862<br>
    file data blocks allocated: 182356692992<br>
     referenced 113920880640<br>


    Everything online hints that attempting repair is particularly<br>
    dangerous, but what else am I to do?  At the moment the system is pretty<br> much useless.<br>

    All insights appreciated.<br>

    - Nate<br>

    -- <br>
    &quot;The optimist proclaims that we live in the best of all<br>
    possible worlds.  The pessimist fears this is true.&quot;<br>
    Web: <a href="https://www.n0nb.us" rel="noreferrer noreferrer" target="_blank">https://www.n0nb.us</a><br>
    Projects: <a href="https://github.com/N0NB" rel="noreferrer noreferrer" target="_blank">https://github.com/N0NB</a><br>
    GPG fingerprint: 82D6 4F6B 0E67 CD41 F689 BBA6 FB2C 5130 D55A 8819<br>

    </blockquote></div>

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Nito@21:1/5 to piorunz on Thu Jan 12 18:20:02 2023
    On Thu, Jan 12, 2023 at 14:10:22 +0000, piorunz wrote:
    To satiate your curiosity, you can find out what files are corrupted, some
    of the errors are giving filenames. If not, this is my saved command to obtain filename from inode numbers:
    sudo btrfs inspect-internal inode-resolve 50845 /

    And obtain filename from logical error:
    sudo btrfs inspect-internal logical-resolve -v 540115857408 /

    As far as I know, Btrfs may refuse to read file with wrong checksum, there may be another command to do that.

    I believe mounting with -o rescue=all will allow to read corrupted files,
    so the remaining parts of non-replaceable files can be salvaged; though I fortunately never had to put this to test myself. Specifically the ignoredatacsums setting, see
    https://btrfs.readthedocs.io/en/stable/Administration.html#mount-options

    Note that this requires a sufficiently new kernel.


    On Thu, Jan 12, 2023 at 08:58:52 -0500, Dan Ritter wrote:
    For the future: don't let things go this long. I know it's
    tempting to say "maybe it won't happen again", but the second
    time should be the last time before you take action.

    To add to this: usually it is recommended to regularly run `btrfs scrub`
    to detect (and in case of redunancy repair) data degradation. Running also `btrfs check` regularly to verify the fs structure also isn't a bad idea.
    This makes it more likely you'll notice a failing device before it gets
    as bad as it is now.

    2: Reinstall Debian on the new disk. Don't use btrfs on a
    single-drive system; only use btrfs on a mirrored system. In most cases,
    use ext4.

    For the record, I don't agree with BTRFS only being useful with RAID.
    BTRFS’ scrub and check can detect corruption early, rather then bitrot silently continuing until it starts crashing and there might be other
    features like e.g. transparent compression which might make it worthwhile
    for one’s single-device usecases.
    (In theory redunancy can also be used with a single device by creating the
    FS with the "dup" data profile, but this of course offers les protection
    than separate devices.)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Intense Red@21:1/5 to All on Fri Jan 13 00:00:01 2023
    Everything online hints that attempting repair is particularly
    dangerous, but what else am I to do?

    You sum up my experience with BTRFS. I too was "scared" off from it and reformatted my BTRFS partitions and went back to ext4 -- it's a known
    quantity fit for humans with tons of advice of how to handle problems/errors.


    --
    "The US has never had a 'foreign policy' but a fanatical domestic policy
    which, once it had bled through to the Pacific, sought new hosts on which to feed." -- Patrick Wilkinson.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Nate Bargmann@21:1/5 to Dan Ritter on Fri Jan 13 03:20:01 2023
    * On 2023 12 Jan 08:15 -0600, Dan Ritter wrote:
    Nate Bargmann wrote:
    I have a Freedom Box Pioneer (hardware is an Olimex A20-OLinuXino-LIME2 unit with a Samsung 128 GB micro-SD card. The micro-SD is partitioned
    into 2GB boot ext2 and the remainder as the root partition as BTRFS.

    The thing has been crashing for months

    For the future: don't let things go this long. I know it's
    tempting to say "maybe it won't happen again", but the second
    time should be the last time before you take action.

    At one point I replaced another piece of hardware that was on the same
    Ethernet switch as this unit and the crashes cleared up for a while.
    Then I suspected a flaky power adapted but haven't addressed it and then
    I suspected RF from my amateur radio operations and put the power cord
    in a ferrite core with no positive results. It wasn't until the 'apt
    update' GPG failure this morning (the Freedom box image is setup to auto update) in a manual update attempt that the light bulb lit up.

    and now it started giving GPG
    signature errors when trying to run 'apt update'. I copied the entire micro-SD card to an image file with dd so I have a backup. Running
    'btrfs check' resulted in a lot of errors so I ran the check and
    directed the output to a file which is over 2MB in size! The following
    is a small snippet of what it in the file:

    ...

    Everything online hints that attempting repair is particularly
    dangerous, but what else am I to do? At the moment the system is pretty much useless.


    1: get a new card, or, much better, replace with a SATA
    SSD. (I see the Olimex has a SATA port. Use it!) Here's a https://www.newegg.com/adata-ultimate-su800-128gb/p/N82E16820215015?Item=9SIAJNUBMB4508
    $29 128GB SSD from a reputable manufacturer.

    2: Reinstall Debian on the new disk. Don't use btrfs on a
    single-drive system; only use btrfs on a mirrored system. In most cases,
    use ext4.

    3: copy all the data you can from the image file.

    Looks like a plan I will do. I had an SATA drive on it to begin with
    but then decided to just use the micro-SD card. My guess that a quite
    large card with much excess capacity would wear level enough for long
    life. Well, maybe 18 months or so is "long life".

    For the record, the Freedom Box micro-SD card image formats the root
    partition as BTRFS. It wasn't a choice of mine. I've used ext2/3/4 for
    many years and that system has always done well for me.

    Fortunately this isn't a system that is critical, but it does serve some purposes.

    - Nate

    --
    "The optimist proclaims that we live in the best of all
    possible worlds. The pessimist fears this is true."
    Web: https://www.n0nb.us
    Projects: https://github.com/N0NB
    GPG fingerprint: 82D6 4F6B 0E67 CD41 F689 BBA6 FB2C 5130 D55A 8819


    -----BEGIN PGP SIGNATURE-----

    iFwEABECAB0WIQSC1k9rDmfNQfaJu6b7LFEw1VqIGQUCY8C+GgAKCRD7LFEw1VqI GbjiAJ44Mc5Z9Wvosua2yyfOH50JC8qtHgCY/PXCPnetFu/L9/7yhLz9mJ4IZQ==
    =cXMv
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Nate Bargmann@21:1/5 to Intense Red on Fri Jan 13 03:30:01 2023
    * On 2023 12 Jan 16:58 -0600, Intense Red wrote:
    Everything online hints that attempting repair is particularly
    dangerous, but what else am I to do?

    You sum up my experience with BTRFS. I too was "scared" off from it and reformatted my BTRFS partitions and went back to ext4 -- it's a known quantity fit for humans with tons of advice of how to handle problems/errors.

    I had experimented with BTRFS some years ago as its virtual partitions
    feature is attractive for things like tmp, var, and usr where each is "separate" but is part of a larger fixed partition. Choosing proper
    sizes is eased somewhat. Other than that its not my choice, usually.
    In this case the card came already formatted with the root partition as
    BTRFS so I left it alone.

    An SSD is on order. I still have to use a micro-SD card for the boot
    partition as the MICRO cannot boot directly to the SSD as far as I know.

    - Nate

    --
    "The optimist proclaims that we live in the best of all
    possible worlds. The pessimist fears this is true."
    Web: https://www.n0nb.us
    Projects: https://github.com/N0NB
    GPG fingerprint: 82D6 4F6B 0E67 CD41 F689 BBA6 FB2C 5130 D55A 8819


    -----BEGIN PGP SIGNATURE-----

    iF0EABECAB0WIQSC1k9rDmfNQfaJu6b7LFEw1VqIGQUCY8DAAgAKCRD7LFEw1VqI GW2sAJ9xXzej3EBpFl/GjFNiv5WOoKroYQCfR9EsT6Cp5KX1o+jq1nZDsFltUgs=
    =KbtK
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Jeffrey Walton@21:1/5 to n0nb@n0nb.us on Fri Jan 13 04:40:01 2023
    On Thu, Jan 12, 2023 at 8:43 AM Nate Bargmann <n0nb@n0nb.us> wrote:

    I have a Freedom Box Pioneer (hardware is an Olimex A20-OLinuXino-LIME2
    unit with a Samsung 128 GB micro-SD card. The micro-SD is partitioned
    into 2GB boot ext2 and the remainder as the root partition as BTRFS.

    The thing has been crashing for months and now it started giving GPG signature errors when trying to run 'apt update'. I copied the entire micro-SD card to an image file with dd so I have a backup. Running
    'btrfs check' resulted in a lot of errors so I ran the check and
    directed the output to a file which is over 2MB in size! The following
    is a small snippet of what it in the file:

    The microSD card is failing. Replace it.

    Jeff

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Andy Smith@21:1/5 to Intense Red on Sun Jan 15 17:10:01 2023
    Hello,

    On Thu, Jan 12, 2023 at 04:57:07PM -0600, Intense Red wrote:
    Everything online hints that attempting repair is particularly
    dangerous, but what else am I to do?

    You sum up my experience with BTRFS. I too was "scared" off from it and reformatted my BTRFS partitions and went back to ext4 -- it's a known quantity fit for humans with tons of advice of how to handle problems/errors.

    I too don't have a lot of love for btrfs, but I think it is a bit
    unfair to criticise it in this scenario, which is a failing SD card
    with no redundancy. If there'd been redundancy then btrfs should
    have noticed the problems and got the data from the other
    copy/copies, but here it had no opportunity to do so.

    In the same situation, ext4 would have just carried on until it got
    read/write errors but this wouldn't have been any better. btrfs got
    the same errors and reported more of its own that it noticed from
    the incorrect checksums.

    It sounds like the OP's use case didn't involve redundancy nor did
    it involve any of the other btrfs features such as compression or
    snapshots, so btrfs probably wasn't a good choice here. ext4 or XFS
    may have been better here just because they are simpler. I can
    understand not wanting to have a learning experience when it comes
    to one's data.

    The btrfs mailing list is pretty helpful. I think if one was not
    scared to ask for help there regarding unfamiliar steps, btrfs in a
    redundant configuration is pretty safe for your data. My gripes with
    it over the years have been user interface, bugs and availability
    issues, not resilience i.e. I've never lost data to it.

    Having said that, I really do not trust things like SD cards or
    CompactFlash cards (remember those? I still have one in service in a
    firewall) for main storage unless they will be largely or entirely
    read-only. In my mind they are more suited to phones and cameras and
    similar devices.

    Similarly, USB storage. Attaching a USB drive (or stick!) to an
    Intel NUC or Raspberry Pi and exposing that over SMB is what some
    people consider network attached storage, and I'm sure there's
    people reading this who have done this for years and never had a
    problem, but I've had and seen so many problems with non-trivial use
    of USB storage. For myself, I'd want any long term setup to be
    attached by SATA or NVMe or over network to same.

    Cheers,
    Andy

    --
    https://bitfolk.com/ -- No-nonsense VPS hosting

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From piorunz@21:1/5 to All on Sun Jan 15 19:30:01 2023
    Guys,

    Quick offtop question as we are talking about Btrfs:

    How do you replace drives in Btrfs Raid10 array?
    I am in the process of upgrading 4 drives to twice as big ones. Since
    forever, I've been using this (example):

    sudo btrfs device add -f /dev/sdf1 /home
    sudo btrfs device remove /dev/sdd1 /home

    But now I am reading, newer fancy method is:
    sudo btrfs replace /dev/sdd1 /dev/sdf1 /home

    Which one is better please? For both situation where drive has failed or
    is still operational?

    --
    With kindest regards, Piotr.

    ⢀⣴⠾⠻⢶⣦⠀
    ⣾⠁⢠⠒⠀⣿⡁ Debian - The universal operating system ⢿⡄⠘⠷⠚⠋⠀ https://www.debian.org/
    ⠈⠳⣄⠀⠀⠀⠀

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Nate Bargmann@21:1/5 to Andy Smith on Sun Jan 15 19:40:01 2023
    * On 2023 15 Jan 10:07 -0600, Andy Smith wrote:
    Hello,

    On Thu, Jan 12, 2023 at 04:57:07PM -0600, Intense Red wrote:
    Everything online hints that attempting repair is particularly
    dangerous, but what else am I to do?

    You sum up my experience with BTRFS. I too was "scared" off from it and reformatted my BTRFS partitions and went back to ext4 -- it's a known quantity fit for humans with tons of advice of how to handle problems/errors.

    I too don't have a lot of love for btrfs, but I think it is a bit
    unfair to criticise it in this scenario, which is a failing SD card
    with no redundancy. If there'd been redundancy then btrfs should
    have noticed the problems and got the data from the other
    copy/copies, but here it had no opportunity to do so.

    In the same situation, ext4 would have just carried on until it got read/write errors but this wouldn't have been any better. btrfs got
    the same errors and reported more of its own that it noticed from
    the incorrect checksums.

    It sounds like the OP's use case didn't involve redundancy nor did
    it involve any of the other btrfs features such as compression or
    snapshots, so btrfs probably wasn't a good choice here. ext4 or XFS
    may have been better here just because they are simpler. I can
    understand not wanting to have a learning experience when it comes
    to one's data.

    Perhaps this needs to be taken up with the Freedom Box Foundation (it
    has close ties to Debian) as it is the image they provide that chose
    btrfs to be written to the micro-SD card and used as an appliance on the Freedom Box Pioneer hardware (Olimex A20-OLinuXino-LIME2).

    *I* did not choose this filesystem for this application, just to be
    clear. If there is a better choice for what is intended to be an
    appliance running from a micro-SD card, then that should be communicated
    to the Freedom Box people.

    I have an SSD on order and will rebuild with ext4.

    - Nate

    --
    "The optimist proclaims that we live in the best of all
    possible worlds. The pessimist fears this is true."
    Web: https://www.n0nb.us
    Projects: https://github.com/N0NB
    GPG fingerprint: 82D6 4F6B 0E67 CD41 F689 BBA6 FB2C 5130 D55A 8819


    -----BEGIN PGP SIGNATURE-----

    iF0EABECAB0WIQSC1k9rDmfNQfaJu6b7LFEw1VqIGQUCY8RHFwAKCRD7LFEw1VqI GWPoAJ47aYI3N5VLwjKPgPLjTQxgNoBIyQCgnyg4SXRQ2D9ghYZQlO+m87PisMk=
    =FXYw
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Nate Bargmann@21:1/5 to All on Thu Jan 19 18:20:01 2023
    Well, I didn't fix the errors, but I was able to use 'btrfs replace' to
    move the file system to an external HDD. The SDD I ordered apparently
    is ping-ponging its way from Kansas City to various area post offices
    and back again before they get it on the right truck. Sigh...

    - Nate

    --
    "The optimist proclaims that we live in the best of all
    possible worlds. The pessimist fears this is true."
    Web: https://www.n0nb.us
    Projects: https://github.com/N0NB
    GPG fingerprint: 82D6 4F6B 0E67 CD41 F689 BBA6 FB2C 5130 D55A 8819


    -----BEGIN PGP SIGNATURE-----

    iF0EABECAB0WIQSC1k9rDmfNQfaJu6b7LFEw1VqIGQUCY8l5kgAKCRD7LFEw1VqI GZ8yAJ0TLNlyvEsbfM5UU5fYUFKyNN/jUgCfTjF6RvICbxYIDC6GWiQOtmqEhjg=
    =me0j
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)