-- Leo's gemini proxy

-- Connecting to jacksonchen666.com:1965...

-- Connected

-- Sending request

-- Meta line: 20 text/gemini;lang=en

Dealing With Btrfs Corruption

2023-08-10 14:30:14Z (last updated 2023-09-25 07:31:34Z)



2 days ago, I shutdown the imac forcefully by holding the power button. Boy did that cause some problems.


After starting it up again, I try to mount my Btrfs volumes. Doesn't work.


After trying (`mount -o degraded`) and trying, it still doesn't work. So I yelled into the void (AKA from my Mastodon instance). After a little back and forth with psykose (who apparently was a big Alpine Linux package maintainer), I was suggested to head to the #btrfs channel on libera.chat. So I just did that.


After asking and providing some details, someone responded with "try `mount -o recovery=usebackuproot`" which didn't work since the correct answer is `mount -o rescue=usebackuproot`. And the correct answer actually did work!


After quickly looking around, I found the files were... right there. Except for one folder which returned I/O error on `ls`, but that was non-critical (a backup folder).


After sitting around in the IRC channel for a bit, I was linked this page related to my error, which said to use `btrfs restore` to grab my files. So I used that to grab the files.

The linked page


I was also suggested to disable write caches (on the drives, presumably), so something like that shouldn't happen again (and that I got lucky this time). I ran `hdparm -W0 /dev/whateverhere` on all the drives for the Btrfs thing


Now I'm in that process of restoring, and it'll definitely take a while, especially when I'm using an external drive connected to my server which is shared to the imac through nfs and through the intranet connection and also the imac is on Wi-Fi but that shouldn't matter because it has 5Ghz Wi-Fi.


Other links

These links weren't exactly an important, and they were inline on the HTML side. So it's separated.


psykose who was a big Alpine Linux package maintainer


public inbox (comments and discussions)

public inbox archives

(mailing list etiquette for public inbox)

-- Response ended

-- Page fetched on Fri May 10 20:29:19 2024