linux-apfs-oot icon indicating copy to clipboard operation
linux-apfs-oot copied to clipboard

bad node only when mounting volume 0

Open ghost opened this issue 5 years ago • 7 comments

Volumes 1-3 work fine to mount and are browsable, but when trying to mount volume 0 I get this error:

bad node in block 0xad22
unable to read catalog root node

apfsck -uw /dev/nvme0n1p2 returns

Container keybag: odd inconsistency (may not be corruption).
Volume superblock: unknown optional feature

I don't find much in udev apart from the previously metioned unable to read catalog root node.

I'm on kernel 5.6.0-rc4-1-mainline on a MBP 2019 16,1 w/ NVMe SSD.

ghost avatar Mar 08 '20 17:03 ghost

Thanks for the thorough report.

Container keybag: odd inconsistency (may not be corruption). Volume superblock: unknown optional feature

One of your volumes has an undocumented feature but it's compatible, so that shouldn't be the cause of your problem. The apfsck stops running as soon as it finds anything to report so, if you can, try running it without the -u flag next.

bad node in block 0xad22 unable to read catalog root node

It would be useful to take a look at this image; if it has private information, would you mind sharing at least a couple of blocks, such as 0x0 and 0xad22?

eafer avatar Mar 11 '20 01:03 eafer

running apfsck -w ... gives the same output. apfsck -c doesn't give any output. Perhaps I'm using the programs wrong, but I read the manpage and it seemed like nothing else of value could be gained from this.

No output means everything looks fine. That's very strange, it seems that the fsck is finding the catalog root without any problem, unlike the module.

I could absolutely share some information, this is a fresh install.

That's good to hear.

But how to do so I don't know. Can you give me instructions?

Sure. You can copy the first 1gb from the container with the following command (as root):

dd if=<input_device> of=<output_file> bs=4096 count=262144

Replace <input_device> with the path to the device file for your container, and <output_file> with the name you want for the output file. Then upload this file somewhere, and send me the link.

Hopefully 1gb will be enough. Let me know if you are having trouble with something.

eafer avatar Mar 14 '20 21:03 eafer

I have the same issue.

[243915.516458] APFS (nvme0n1p2): this module is read-only [243915.538507] APFS (nvme0n1p2): bad node in block 0x6b8 [243915.538719] APFS (nvme0n1p2): unable to read catalog root node

What should I do?

HLFH avatar Jan 11 '21 10:01 HLFH

What should I do?

Ideally, you should send me a filesystem image where you can reproduce this issue. Do you think you can do that?

eafer avatar Jan 12 '21 22:01 eafer

To start with, I am getting:

apfsck -uw /dev/nvme0n1p2 Container keybag: odd inconsistency (may not be corruption). Nonempty reaper: not supported.

apfsck -w /dev/nvme0n1p2 Container keybag: odd inconsistency (may not be corruption). Volume superblock: unknown optional feature.

apfsck -c /dev/nvme0n1p2 Volume superblock: unknown optional feature.

dd if=/dev/nvme0n1p2 of=/root/fscopy bs=4096 count=262144

HLFH avatar Jan 14 '21 13:01 HLFH

Container keybag: odd inconsistency (may not be corruption).

Your volume is not encrypted, right?

Nonempty reaper: not supported.

The reaper shouldn't matter for a read-only mount. It's likely that your container does have some unsupported feature, but you won't be able to find it with my apfsck as it is now. If you want you could try to apply a patch like:

diff --git a/apfsck/apfsck.c b/apfsck/apfsck.c index f2e1bee..bd14294 100644 --- a/apfsck/apfsck.c +++ b/apfsck/apfsck.c @@ -89,7 +89,7 @@ void report_crash(const char *context) void report_unknown(const char *feature) { if (options & OPT_REPORT_UNKNOWN)

  •   report(feature, "not supported.");
    
  •   printf("%s: not supported.\n", feature);
    

}

/**

Now the check will continue after the reaper, and me may get some more information.

eafer avatar Jan 14 '21 19:01 eafer

Your volume is not encrypted, right?

Right.

dd if=/dev/nvme0n1p2 of=/root/fscopy bs=4096 count=262144

I've sent you today the fscopy file to your email.

And... I will try the patch.

EDIT: I think I applied the patch correctly and... I have quite the same info:

➜ ~ apfsck -uw /dev/nvme0n1p2

Container keybag: odd inconsistency (may not be corruption). Nonempty reaper: not supported. Nonempty reaper: not supported. Volume superblock: unknown optional feature. ➜ ~ apfsck -w /dev/nvme0n1p2

Container keybag: odd inconsistency (may not be corruption). Volume superblock: unknown optional feature. ➜ ~ apfsck -c /dev/nvme0n1p2

Volume superblock: unknown optional feature.

EDIT2: and dmesg:

[ 307.794835] apfs: loading out-of-tree module taints kernel. [ 307.794864] apfs: module verification failed: signature and/or required key missing - tainting kernel [ 307.796157] APFS (nvme0n1p2): this module is read-only [ 307.814077] APFS (nvme0n1p2): bad node in block 0x6b8 [ 307.814133] APFS (nvme0n1p2): unable to read catalog root node

HLFH avatar Jan 20 '21 14:01 HLFH