BTRFS 無法掛載且無法更換磁碟

BTRFS 無法掛載且無法更換磁碟

這是我的情況,我有一台 NAS 作為備份伺服器,還有另一台也有完整備份的 Linux 機器。 NAS 有三個 2TB 硬碟,因此我決定嘗試使用 BTRFS 和 RAID5 來看看效果如何。我鏡像了兩者,一切都很好。後來我決定升級第二台機器上的作業系統,所以我刪除了第二個備份的資料夾(資料仍然可能存在)。我認為我有足夠的時間進行 NAS 備份,因此沒有抽出時間進行第二次備份(這發生在過去兩週內)。現在我的 NAS 有一個壞硬碟,我已經更換了它,我無法安裝 BTRFS 系統。我開始讀書網站並運行該-repair選項,這在當時似乎是一個好主意,但後來在線程中指出它不是。

所以現在我完全停止了,這樣我就不會進一步損壞任何東西。 dmesg指出 BTRFS 無法安裝設備,因為替換操作正在進行中,但btrfs replace status /mnt表示該操作從未啟動。

我的問題:
1) 是否仍然可以還原和備份我的 BTRFS 磁碟機?
2)如果是這樣,我需要提供什麼資訊才能進行?
3)如果沒有,現在有沒有可用的工具可以恢復我的其他備份?我想我將驅動器從 ext4 格式化為 xfs。

提前致謝。

編輯:我忘了提及我最初是透過使用資訊開始替換的這裡。並且由於斷電而必須重新啟動。

編輯 2:是否可以將 RAID5 從 3 個驅動器降級為只有 2 個驅動器,而不需要其他驅動器?

編輯 3:當我讓系統坐在那裡時出現核心錯誤:

[ 685.809945] ------------[ 切到這裡 ]------------
[685.810386]核心錯誤位於/build/linux-a2WvEb/linux-4.4.0/fs/btrfs/raid56.c:1917!
[685.810833]無效操作碼:0000[#1]SMP
[685.811279]連結的模組:crct10dif_pclmul crc32_pclmul aesni_intel aes_x86_64 lrw 128mulglue_helper ablk_helper input_leds cryptd s_hdamulglid_o_mhdaa_oo​​l sndt_hd snd_hda_intel k10temp snd_hda_codec snd_hda_core snd_hwdep snd_pcm i2c_piix4 snd_seq_midi snd_seq_midi_event snd_rawmidi nuvoton_cir snd_seq_midi_event snd_rawmidi nuvoton_cir 3m_seq_midi; amd irqbypass nfsd auth_rpcgss parport_pc nfs_acl lockd ppdev 寬限lp sunrpc parport autofs4 btrfs raid10 raid456 async_raid6_recov async_memcpy async_pq async_xor async_tx xor raid6_pq libcrc32c raid1 raid0 多路徑線性pata_acidam iamid algo_bit ttm _helper syscopyarea sysfillrect sysimgblt r8169 fb_sys_fops mii drm pata_atiixp
[685.813359]ahci libahci fjes
[685.813876]CPU:1 PID:2553通訊:btrfs-transacti未污染4.4.0-36-generic#55-Ubuntu
[ 685.814400] 硬體名稱: 由 OEM 填寫 由 OEM/FM2A85X-ITX 填寫,BIOS P1.50 05/04/2013
[685.814931]任務:ffff8800db2cb700 ti:ffff8800d3a54000任務.ti:ffff8800d3a54000
[685.815462]RIP:0010:[][]__raid_recover_end_io+0x475/0x520[btrfs]
[685.816028]RSP:0018:ffff8800d3a57720 EFLAGS:00010213
[685.816568]RAX:ffff8800d3ce5700 RBX:ffff8800d0c66000 RCX:00000000000000000
[685.817112]RDX:0000000080000000 RSI:0000000000000000 RDI:0000000000000003
[685.817658]RBP:ffff8800d3a57760 R08:ffffea00035596c0 R09:00000000000000018
[685.818207]R10:ffff8800d0c1d9a0 R11:ffffffff81ccf5ea R12:ffff8800d0c1d9b0
[685.818759]R13:0000000000000003 R14:ffff8800d0c1d9a0 R15:ffff8800d2f87000
[685.819316]FS:00007f108f26b700(0000)GS:ffff88011ec80000(0000)knlGS:0000000000000000
[685.819876]CS:0010 DS:0000 ES:0000 CR0:000000008005003b
[685.820436]CR2:0000000000ef5000 CR3:0000000001e0a000 CR4:00000000000406e0
[685.820999]堆疊:
[ 685.821557] 0000000000000000 000000000000010 0000000100000001 000000000000000
[685.822128]0000000000000010ffff8800d2f87000000000000000003ffff8800d2f87000
[685.822695]ffff8800d3a577b0ffffffffc04169d5ffff8800d3a577700000000000000000
[685.823258]呼叫追蹤:
[685.823832][]__raid56_parity_recover+0x1e5/0x200[btrfs]
[ 685.824410] [] raid56_parity_recover+0xf6/0x160 [btrfs]
[ 685.824990] [] btrfs_map_bio+0xe3/0x320 [btrfs]
[685.825557][]? kmem_cache_alloc+0x187/0x1f0
[685.826137][]? btrfs_bio_wq_end_io+0x28/0x70 [btrfs]
[685.826720][]btree_submit_bio_hook+0xff/0x110[btrfs]
[685.827305][]submit_one_bio+0x6d/0xa0[btrfs]
[ 685.827886] [] read_extent_buffer_pages+0x193/0x2f0 [btrfs]
[685.828464][]? free_root_pointers+0x60/0x60 [btrfs]
[685.829040][]btree_read_extent_buffer_pages.constprop.51+0xac/0x110[btrfs]
[685.829621][]btrfs_read_buffer+0x2c/0x30[btrfs]
[685.830199][]read_block_for_search.isra.34+0xe4/0x380[btrfs]
[685.830781][]? unlock_up+0x172/0x1a0 [btrfs]
[ 685.831363] [] btrfs_search_slot+0x381/0xa00 [btrfs]
[685.831946][]lookup_inline_extent_backref+0xed/0x5a0[btrfs]
[685.832532][]? set_extent_dirty+0x32/0x40 [btrfs]
[685.833114][]? btrfs_alloc_path+0x1a/0x20 [btrfs]
[685.833696][]__btrfs_free_extent.isra.70+0x113/0xd30[btrfs]
[685.834285][]? btrfs_merge_delayed_refs+0x66/0x650 [btrfs]
[685.834873][]__btrfs_run_delayed_refs+0xaab/0x11f0[btrfs]
[685.835452][]? lock_timer_base.isra.22+0x54/0x70
[685.836038][]btrfs_run_delayed_refs+0x7d/0x2a0[btrfs]
[685.836627][]? btrfs_wait_pending_ordered+0x22/0x90 [btrfs]
[ 685.837214] [] btrfs_commit_transaction+0x4d2/0xa90 [btrfs]
[685.837801][]transaction_kthread+0x229/0x240[btrfs]
[685.838390][]? btrfs_cleanup_transaction+0x570/0x570 [btrfs]
[685.838970][]kthread+0xd8/0xf0
[685.839548][]? kthread_create_on_node+0x1e0/0x1e0
[685.840132][]ret_from_fork+0x3f/0x70
[685.840718][]? kthread_create_on_node+0x1e0/0x1e0
[685.841304]代碼:75 d4 89 45 d0 e9 94 fe ff 8b 5d d0 4c 89 f1 00 10 00 00 89 da ff 15 c9 dc eb ff 8b 45 d4 8985 d 15 c9 dc 198b 454 89 d a7 98 00 00 00 4c 89 e7 e8 ea 75 41 c1 f0 41 80 8f
[685.842653]RIP[]__raid_recover_end_io+0x475/0x520[btrfs]
[ 685.843314] 退休儲蓄計劃
[ 685.843980] ---[ 結束追蹤 d312a2207e01141e ]---

答案1

提醒:btrfs 的 raid5 模式非常不穩定,尤其是恢復方面。

對您來說最好的解決方案是使用救援工具 ( man 8 btrfs-restore) 並盡可能保存所有資料。

相關內容