You are not logged in.

#1 2018-03-02 06:30:24

PriceKIller
Member
Registered: 2015-07-19
Posts: 6

[SOLVED] Unmountable BTRFS

Today, when I was using my computer suddenly I could not download a file I need. Then I reboot my system, only to find that my BTRFS partition (which is originally mounted to /home) was unable to be mounted. And several days ago, another my BTRFS partition ( / ) also failed, so I reformat it into EXT4 and reinstalled the OS. Is there any way to rebuild the tree or recover some data?

(PS: Recently I enable "hibernate" by creating a new swap partition. Is that related to the failure?)


The following are the efforts I've done:

[root@Kepler-004M pkg]# btrfs check /dev/nvme0n1p7
parent transid verify failed on 38322176 wanted 63558 found 63564
parent transid verify failed on 38322176 wanted 63558 found 63564
Ignoring transid failure
parent transid verify failed on 37093376 wanted 63558 found 63564
parent transid verify failed on 37093376 wanted 63558 found 63564
Ignoring transid failure
extent buffer leak: start 77545472 len 16384
extent buffer leak: start 80068608 len 16384
extent buffer leak: start 80068608 len 16384
ERROR: cannot open file system
[root@Kepler-004M ~]# btrfs-find-root /dev/nvme0n1p7
parent transid verify failed on 38322176 wanted 63558 found 63564
parent transid verify failed on 38322176 wanted 63558 found 63564
Ignoring transid failure
parent transid verify failed on 37093376 wanted 63558 found 63564
parent transid verify failed on 37093376 wanted 63558 found 63564
Ignoring transid failure
Superblock thinks the generation is 63560
Superblock thinks the level is 0
Found tree root at 80609280 gen 63560 level 0
Well block 48562176(gen: 63559 level: 0) seems good, but generation/level doesn't match, want gen: 63560 level: 0
Well block 30654464(gen: 63557 level: 0) seems good, but generation/level doesn't match, want gen: 63560 level: 0
Well block 29196288(gen: 63556 level: 0) seems good, but generation/level doesn't match, want gen: 63560 level: 0
Well block 27475968(gen: 63555 level: 0) seems good, but generation/level doesn't match, want gen: 63560 level: 0
Well block 24952832(gen: 63554 level: 0) seems good, but generation/level doesn't match, want gen: 63560 level: 0
Well block 22593536(gen: 63553 level: 0) seems good, but generation/level doesn't match, want gen: 63560 level: 0
Well block 79200256(gen: 63552 level: 0) seems good, but generation/level doesn't match, want gen: 63560 level: 0
Well block 79052800(gen: 63551 level: 0) seems good, but generation/level doesn't match, want gen: 63560 level: 0
Well block 10092544(gen: 63531 level: 0) seems good, but generation/level doesn't match, want gen: 63560 level: 0
extent buffer leak: start 77545472 len 16384
extent buffer leak: start 80068608 len 16384
extent buffer leak: start 80068608 len 16384
[root@Kepler-004M pkg]# btrfs rescue chunk-recover /dev/nvme0n1p7
Scanning: DONE in dev0                       
parent transid verify failed on 38322176 wanted 63558 found 63564
parent transid verify failed on 38322176 wanted 63558 found 63564
Ignoring transid failure
parent transid verify failed on 37093376 wanted 63558 found 63564
parent transid verify failed on 37093376 wanted 63558 found 63564
Ignoring transid failure
extent buffer leak: start 77545472 len 16384
extent buffer leak: start 80068608 len 16384
extent buffer leak: start 80068608 len 16384
open with broken chunk error
Chunk tree recovery failed

Last edited by PriceKIller (2018-03-02 17:33:30)

Offline

#2 2018-03-02 12:39:15

Condor
Member
Registered: 2017-12-01
Posts: 26

Re: [SOLVED] Unmountable BTRFS

PriceKIller wrote:

(PS: Recently I enable "hibernate" by creating a new swap partition. Is that related to the failure?)

If you've used a swap partition – unlikely, except perhaps if you had a crash/bad resume from hibernation.

If you've used a swap file residing on a Btrfs volume, then likely yes. Btrfs doesn't support swap files (yet).

PriceKIller wrote:
parent transid verify failed on 38322176 wanted 63558 found 63564

This indicates that somewhere in the middle of a transaction Btrfs was rudely interrupted, now the filesystem/journal state is inconsistent.

The Btrfs Wiki page for btrfsck over at kernel.org suggests a range of options to recover. Follow the steps below Before trying fsck and note that some will (attempt) to repair the filesystem and write to it while doing so. The result might be actual data loss if they fail! Consider pulling a bytewise copy of the partition with dd to a safe location.

Safe to use are the mount options ro,recoveryusebackuproot(*) and btrfs restore. They are read-only and might help you to pull data off the filesystem. btrfs scrub verifies checksums, and will probably not help here. Note that btrfs-zero-log is generally advised against at by the wiki, and only helps in specific cases.


(*) Edit: The mount option recovery is deprecated and was replaced by usebackuproot. See btrfs mount options.

Last edited by Condor (2018-03-02 12:44:15)

Offline

#3 2018-03-02 16:09:48

PriceKIller
Member
Registered: 2015-07-19
Posts: 6

Re: [SOLVED] Unmountable BTRFS

Condor wrote:

The Btrfs Wiki page for btrfsck over at kernel.org suggests a range of options to recover. Follow the steps below Before trying fsck and note that some will (attempt) to repair the filesystem and write to it while doing so. The result might be actual data loss if they fail! Consider pulling a bytewise copy of the partition with dd to a safe location.

Safe to use are the mount options ro,recoveryusebackuproot(*) and btrfs restore. They are read-only and might help you to pull data off the filesystem. btrfs scrub verifies checksums, and will probably not help here. Note that btrfs-zero-log is generally advised against at by the wiki, and only helps in specific cases.


(*) Edit: The mount option recovery is deprecated and was replaced by usebackuproot. See btrfs mount options.

Thanks for your detailed solution, but I cannot even mount it as a read-only fs.

[root@Kepler-004M ~]# sudo mount -O ro,usebackuproot /dev/nvme0n1p7 /mnt
mount: /mnt: wrong fs type, bad option, bad superblock on /dev/nvme0n1p7, missing codepage or helper program, or other error.

Offline

#4 2018-03-02 16:53:37

Condor
Member
Registered: 2017-12-01
Posts: 26

Re: [SOLVED] Unmountable BTRFS

The mount command should be written with a lowercase letter -o. The uppercase -O does something else, and is effectively ignored here. You might also want to add the option -t btrfs to the mount command so that it does not need to guess.

Last edited by Condor (2018-03-02 16:53:53)

Offline

#5 2018-03-02 17:04:58

PriceKIller
Member
Registered: 2015-07-19
Posts: 6

Re: [SOLVED] Unmountable BTRFS

Still useless. It seems that root nodes of the fs have all been corrupted. Perhaps the best way to solve will be reformating it. I'm about to give up.

[root@Kepler-004M ~]# mount -t btrfs -o uesrbackuproot,ro /dev/nvme0n1p7 /mnt
mount: /mnt: wrong fs type, bad option, bad superblock on /dev/nvme0n1p7, missing codepage or helper program, or other error.

Offline

#6 2018-03-02 17:26:36

Slithery
Forum Moderator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 2,802

Re: [SOLVED] Unmountable BTRFS

There's still a typo in your mount command.


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#7 2018-03-02 17:32:55

PriceKIller
Member
Registered: 2015-07-19
Posts: 6

Re: [SOLVED] Unmountable BTRFS

Slithery wrote:

There's still a typo in your mount command.

Nerver mind, I ran a 'correct' one before, any attempts to mount all lead to the same error message. So I just format it into ext4 and start over.

Offline

Board footer

Powered by FluxBB