0

I need an assistance with restoring HDD where was BTRFS after I tried to install Windows on SSD within the same PC. So, my PC has 3 disks:

  • SSD with Fedora under BTRFS - /dev/sda{x}
  • SSD without any FS - /dev/sdb
  • HDD as a file storage under BTRFS - /dev/sdc.

I tried to install Windows on /dev/sdb to get 2 OSes on the same PC. But for some unclear reason Windows installation changed somehow FS on /dev/sdc

➜  ~ sudo lsblk /dev/sdc   
NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINTS
sdc      8:32   0  1,8T  0 disk 
└─sdc1   8:33   0  100M  0 part

➜  ~ sudo btrfs fi show /dev/sdc
Label: 'Disk 2TB'  uuid: 24075f5b-eb67-45d8-a9cd-5fe6b9d11248
    Total devices 1 FS bytes used 1.45TiB
    devid    1 size 1.82TiB used 1.46TiB path /dev/sdc

Disk cannot be mounted since

➜  ~ sudo mount /dev/sdc /mnt/disk_2tb 
mount: /mnt/disk_2tb: wrong fs type, bad option, bad superblock on /dev/sdc, missing codepage or helper program, or other error.
       dmesg(1) may have more information after failed mount system call.
➜  ~ dmesg| grep sdc
[    1.983864] sd 4:0:0:0: [sdc] 3907029168 512-byte logical blocks: (2.00 TB/1.82 TiB)
[    1.983868] sd 4:0:0:0: [sdc] 4096-byte physical blocks
[    1.983874] sd 4:0:0:0: [sdc] Write Protect is off
[    1.983876] sd 4:0:0:0: [sdc] Mode Sense: 00 3a 00 00
[    1.983885] sd 4:0:0:0: [sdc] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[    1.983896] sd 4:0:0:0: [sdc] Preferred minimum I/O size 4096 bytes
[    2.024803]  sdc: sdc1
[    2.024940] sd 4:0:0:0: [sdc] Attached SCSI disk
[    3.196935] BTRFS: device label Disk 2TB devid 1 transid 5113 /dev/sdc scanned by systemd-udevd (491)
[  109.407061]  sdc: sdc1
[  183.250214]  sdc: sdc1
[  220.103191]  sdc: sdc1
[  713.817340]  sdc: sdc1
[  752.095854]  sdc: sdc1
[ 4253.223636]  sdc: sdc1
[ 4253.244072] BTRFS: device label Disk 2TB devid 1 transid 5113 /dev/sdc scanned by systemd-udevd (17293)
[ 4260.709988]  sdc: sdc1
[ 4438.692603]  sdc: sdc1
[ 4551.237692] BTRFS info (device sdc): using free space tree
[ 4551.237697] BTRFS info (device sdc): has skinny extents
[ 4551.238345] BTRFS error (device sdc): bad tree block start, want 27230208 have 5227060755056173072
[ 4551.238460] BTRFS error (device sdc): bad tree block start, want 27230208 have 0
[ 4551.238466] BTRFS error (device sdc): failed to read chunk root
[ 4551.239223] BTRFS error (device sdc): open_ctree failed

According to btrfs rescue super-recover disk has bad supers

➜  ~ sudo btrfs rescue super-recover -v /dev/sdc
All Devices:
    Device: id = 1, name = /dev/sdc

Before Recovering:
    [All good supers]:
        device name = /dev/sdc
        superblock bytenr = 65536

        device name = /dev/sdc
        superblock bytenr = 274877906944

    [All bad supers]:
        device name = /dev/sdc
        superblock bytenr = 67108864


Make sure this is a btrfs disk otherwise the tool will destroy other fs, Are you sure? [y/N]: y
checksum verify failed on 27230208 wanted 0x902be40a found 0x55ee4508
checksum verify failed on 27230208 wanted 0x00000000 found 0xb6bde3e4
ERROR: cannot read chunk root
Failed to recover bad superblocks

Also outputs of btrfs-find-root, btrfs-select-super and btrfs check

➜  ~ sudo btrfs-find-root /dev/sdc
WARNING: cannot read chunk root, continue anyway
Superblock thinks the generation is 5113
Superblock thinks the level is 0

➜  ~ sudo btrfs-select-super -s 1 /dev/sdc
No valid Btrfs found on /dev/sdc
Open ctree failed

➜  ~ sudo btrfs check --repair /dev/sdc
enabling repair mode
WARNING:

    Do not use --repair unless you are advised to do so by a developer
    or an experienced user, and then only after having accepted that no
    fsck can successfully repair all types of filesystem corruption. Eg.
    some software or hardware bugs can fatally damage a volume.
    The operation will start in 10 seconds.
    Use Ctrl-C to stop it.
10 9 8 7 6 5 4 3 2 1
Starting repair.
Opening filesystem to check...
checksum verify failed on 27230208 wanted 0x902be40a found 0x55ee4508
checksum verify failed on 27230208 wanted 0x00000000 found 0xb6bde3e4
checksum verify failed on 27230208 wanted 0x902be40a found 0x55ee4508
bad tree block 27230208, bytenr mismatch, want=27230208, have=5227060755056173072
ERROR: cannot read chunk root
ERROR: cannot open file system

log file of btrfs rescue chunk-recover execution.

Any ideas how to fix this kind of errors?

0 Answers0