Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

open_container__info_stream: ERROR: Couldn't read block 0 in order to determine block size. #88

Open
chriskuku opened this issue Dec 3, 2024 · 3 comments

Comments

@chriskuku
Copy link

drat 0.1.3:

I'm wondering why I'm suddenly getting this, although an fsck_apfs /dev/disk3s2 works. (reporting an error)?

$ sudo fsck_apfs /dev/disk3s2
** Checking the container superblock.
   Checking the checkpoint with transaction ID 263004.
** Checking the space manager.
** Checking the space manager free queue trees.
** Checking the object map.
** Checking volume.
** Checking the APFS volume superblock.
   The volume BackupNeu was formatted by diskmanagement (1677.141.3.7.2) and last modified by apfs_kext (1677.141.3.7.2).
** Checking the object map.
error: (oid 0x1c8eeb) om: btn: invalid o_type (0x40000002, expected 0x40000003)
   Object map is invalid.
** The volume /dev/disk3s2 could not be verified completely.
$ sudo ./drat inspect --container /dev/disk3s2
Opening `/dev/disk3s2` in read-only mode ... OK.
Determining block size ... read_block: ERROR: `fread()` encountered an unknown error whilst reading from the stream.
open_container__info_stream: ERROR: Couldn't read block 0 in order to determine block size.

@jivanpal
Copy link
Owner

jivanpal commented Dec 3, 2024

You are likely giving Drat the device node of an APFS volume (which is not an actual block device), rather than that of the APFS container or underlying partition that the filesystem resides in. fsck_apfs works this out automatically, but Drat doesn't. See this comment and the ones preceding it for an explanation.

@chriskuku
Copy link
Author

chriskuku commented Dec 5, 2024

Thanks. I understand. Using

Opening `/dev/disk3` in read-only mode ... OK.
Determining block size ... 4096 bytes.
Simulating a mount of the container.
Reading block 0 ... validating ... OK.

Details of block 0:
--------------------------------------------------------------------------------
Stored checksum:    0x38d846a9f0105e81
OID:                0x1
XID:                0x4035c
...
...

Now it works. OK, fine. But how can drat help me to repair or fix the error, that fsck_apfs is reporting (in my original post)?

@jivanpal
Copy link
Owner

jivanpal commented Dec 5, 2024

You should be able to use Drat's other subcommands to explore the filesystem. Try drat list /dev/disk3 0 / to explore the root of the first APFS volume. Once salvageable files are identified, they can be recovered using drat recover.

For general help, run drat or drat <subcommand>, e.g. drat list.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants