오늘부터 외장 하드 드라이브의 btrfs 볼륨에 적당한 양의 데이터(MB 범위)를 쓰려고 하면 볼륨이 읽기 전용으로 전환되어 작업이 중단됩니다. 볼륨은 매우 간단합니다(RAID 없음, 스냅샷 없음).
journalctl
쓰는 동안 다음이 표시됩니다.
Jan 23 18:34:16 my-machine kernel: BTRFS: device label <...> devid 1 transid 3344 /dev/sdb1 Jan 23 18:34:16 my-machine kernel: BTRFS info (device sdb1): disk space caching is enabled Jan 23 18:34:16 my-machine kernel: BTRFS info (device sdb1): has skinny extents Jan 23 18:36:35 my-machine kernel: BTRFS critical (device sdb1): corrupt node: root=7 block=253655810048 slot=106, bad key order, current (18446744073709551606 128 9223372601711906816) next (18446744073709551606 128 564873670656) Jan 23 18:38:13 my-machine kernel: BTRFS critical (device sdb1): corrupt node: root=7 block=253655810048 slot=106, bad key order, current (18446744073709551606 128 9223372601711906816) next (18446744073709551606 128 564873670656) Jan 23 18:39:43 my-machine kernel: BTRFS critical (device sdb1): corrupt node: root=7 block=253655810048 slot=106, bad key order, current (18446744073709551606 128 9223372601711906816) next (18446744073709551606 128 564873670656) Jan 23 18:40:58 my-machine kernel: BTRFS critical (device sdb1): corrupt node: root=7 block=253655810048 slot=106, bad key order, current (18446744073709551606 128 9223372601711906816) next (18446744073709551606 128 564873670656) Jan 23 18:42:28 my-machine kernel: BTRFS critical (device sdb1): corrupt node: root=7 block=253655810048 slot=106, bad key order, current (18446744073709551606 128 9223372601711906816) next (18446744073709551606 128 564873670656) Jan 23 18:42:39 my-machine kernel: BTRFS critical (device sdb1): corrupt node: root=7 block=253655810048 slot=106, bad key order, current (18446744073709551606 128 9223372601711906816) next (18446744073709551606 128 564873670656) Jan 23 18:42:39 my-machine kernel: BTRFS critical (device sdb1): corrupt node: root=7 block=253655810048 slot=106, bad key order, current (18446744073709551606 128 9223372601711906816) next (18446744073709551606 128 564873670656) Jan 23 18:42:39 my-machine kernel: BTRFS: error (device sdb1) in btrfs_finish_ordered_io:3074: errno=-5 IO failure Jan 23 18:42:39 my-machine kernel: BTRFS info (device sdb1): forced readonly
처음에는 btrfs check
다음과 같은 출력이 제공됩니다.
$ sudo btrfsck /dev/sdb1 Checking filesystem on /dev/sdb1 UUID: a69162a3-aeb3-43c0-b74d-cfd280bfa8b6 checking extents bad block 253655810048 ERROR: errors found in extent allocation tree or chunk allocation checking free space cache checking fs roots checking csums there are no extents for csum range 563128786944-564280360960 csum exists for 563128786944-564280377344 but there is no extent record there are no extents for csum range 566428172288-567179472896 Right section didn't have a record there are no extents for csum range 565354430464-567179472896 Right section didn't have a record there are no extents for csum range 564280688640-567179472896 Right section didn't have a record there are no extents for csum range 564280639488-567179472896 csum exists for 564280639488-567179472896 but there is no extent record ERROR: errors found in csum tree found 1681395552256 bytes used, error(s) found total csum bytes: 0 total tree bytes: 2406924288 total fs tree bytes: 2279718912 total extent tree bytes: 123813888 btree space waste bytes: 350386565 file data blocks allocated: 1685019078656 referenced 1685018304512
를 실행했지만 btrfs scrub
때때로 자체적으로 작동이 중단되는 경우가 있습니다. 그런 다음 드라이브를 다시 마운트해야 합니다.
$ sudo btrfs scrub start -B /mnt/hd ERROR: scrubbing /mnt/hd failed for device id 1: ret=-1, errno=5 (Input/output error) scrub canceled for a69162a3-aeb3-43c0-b74d-cfd280bfa8b6 scrub started at Wed Jan 23 21:26:28 2019 and was aborted after 00:45:20 total bytes scrubbed: 509.99GiB with 0 errors
그러나 다음을 사용합니다 btrfs scrub resume
.
$ sudo btrfs scrub status /mnt/hd scrub status for a69162a3-aeb3-43c0-b74d-cfd280bfa8b6 scrub resumed at Wed Jan 23 22:24:05 2019 and finished after 01:52:15 total bytes scrubbed: 1.20TiB with 27163 errors error details: csum=27163 corrected errors: 0, uncorrectable errors: 27163, unverified errors: 0
btrfs scrub
저도 실행하기 전에 한 번 시도해 봤습니다 btrfs check --repair
. 후속 실행에서는 btrfs check
"Bad Block 253655810048" 대신 "Bad Block 253432905728"이 표시되지만 이는 크게 변경되지 않은 것 같습니다 . 이제 btrfs scrub
끝나면 다음과 같이 btrfs check
말하세요 .
Checking filesystem on /dev/sdb1 UUID: a69162a3-aeb3-43c0-b74d-cfd280bfa8b6 checking extents bad block 253432905728 ERROR: errors found in extent allocation tree or chunk allocation checking free space cache block group 253432430592 has wrong amount of free space, free space cache has 253722624 block group has 253689856 ERROR: free space cache has more free space than block group item, this could leads to serious corruption, please contact btrfs developers failed to load free space cache for block group 253432430592 ERROR: errors found in free space cache found 1681395535872 bytes used, error(s) found total csum bytes: 0 total tree bytes: 2406203392 total fs tree bytes: 2279718912 total extent tree bytes: 123797504 btree space waste bytes: 350047303 file data blocks allocated: 1685019078656 referenced 1685018304512
매우 걱정스러워 보입니다! 어떻게 이런일이 일어 났습니까? 파일 시스템이 정말 망가진 걸까요? 아니면 드라이브에 문제가 있습니까(오래된 것도 아니고 전혀 많이 사용되지도 않으며 SMART에 문제가 없는 것 같습니다)?