You are not logged in.

#1 2017-09-25 21:39:27

Convergence
Member
Registered: 2005-07-02
Posts: 377

BTRFS RAID1 Mounting RO [probably due to corruption]

My /home partition is a raid1 (just two disks mirroring eachother).  I noticed that I suddenly (it's been working nicely for many months, and I've made no changes to the system recently) couldn't write to /home, because it was mounted read-only.  I ran dmesg and got this (just the parts that I think are relevant):

[  134.907223] BTRFS critical (device sdd1): corrupt leaf, bad key order: block=2181710577664, root=1, slot=123
[  134.907242] BTRFS: error (device sdd1) in __btrfs_free_extent:6951: errno=-5 IO failure
[  134.907246] BTRFS info (device sdd1): forced readonly
[  134.907250] BTRFS: error (device sdd1) in btrfs_run_delayed_refs:2971: errno=-5 IO failure
[  134.909583] BTRFS error (device sdd1): pending csums is 1413120
[  439.233121] systemd-fstab-generator[1896]: Checking was requested for "label=rooty", but it is not a device.
[  439.519047] JFS: nTxBlock = 8192, nTxLock = 65536
[  439.591720] SGI XFS with ACLs, security attributes, realtime, no debug enabled
[  486.304208] systemd-fstab-generator[2047]: Checking was requested for "label=rooty", but it is not a device.

Sdd1 is one of the drives in the array.  This business about "rooty" may be unrelated, because that is the label of the root partition (Can you guess what I named my home partion?).

Smart is not reporting any errors in that drive.  I just ran a short test, and it was fine. If you want me to post those results, or if you think I should run a long test, let me know. 
(Actually, I just ran the extended test, and it also ran without error)

Here is the output of "btrfs device stats /home":

[/dev/sdd1].write_io_errs    0
[/dev/sdd1].read_io_errs     0
[/dev/sdd1].flush_io_errs    0
[/dev/sdd1].corruption_errs  0
[/dev/sdd1].generation_errs  0
[/dev/sda].write_io_errs    0
[/dev/sda].read_io_errs     0
[/dev/sda].flush_io_errs    0
[/dev/sda].corruption_errs  0
[/dev/sda].generation_errs  0

Which I find kind of disappointing because something is clearly wrong.

So, reading the wiki, it is suggested to alter mkinitcpio and add the path to btrfs, so that it becomes available from the initial ramdisk (without even booting root).  However, I don't think that's necessary since my root partition is fine.  Here is my plan, please let me know if it sounds reasonable:
1. Reboot, and from grub edit the kernel line by appending "s" to boot into single user mode.
2. From single user mode, run "btrfs check /home".
3. Read the output and determine what to do from there. (This will likely mean backing stuff up before running "btrfs)

Thanks in advance for your time.

PS:
BTW, I think I'm done with this BTRFS experiment.  Really, I'd like to repair the damage, and then just turn one of the drives into an XFS partition and move the data there.  If there's an obvious shortcut to getting there, I'd appreciate any suggestions.

Last edited by Convergence (2017-09-25 21:56:40)


It's a very deadly weapon to know what you're doing
---  William Murderface

Offline

Board footer

Powered by FluxBB