Closed ghost closed 5 years ago
Hi. Nope, this library only interacts with already mounted filesystems, using the "live" kernel API. It never reads from or writes to the disk directly. Actually, two weeks ago I realized the top level README was not super clear about that and I added commit 9568709e4, but that's not in master branch yet.
Of course, it would be super fun to have a library that can handle offline filesystems. I have been playing around with ideas for that, but there's nothing yet, not even a small proof of concept.
A big reason why the current code should never be used to write things back is that python does not have the concept of an 8,16,64bit integer etc. Everything is just a number. When reading values and looking at them or printing them on screen, that's not a problem. But when writing something back, it certainly is.
The README text has changed a bit in v11, to explicitly mention the library can only work with online, mounted filesystems.
Hi, I'm trying to somehow fix my currently broken raid10 array. Unfortunately, filesystem is unmountable, but with btrfs tools I was able to locate blocks I think are broken (invalid checksums, wrong parent key), but I don't have enough knowledge to at least try to fix them. Your library looks very promising, because I'm much more familiar with python than C, and it already helped me to better understand some things.
Is it possible to use this library to dig into unmounted/unmountable/broken filesystem? When trying to use with unmounted device (
/dev/mapper/data0
is first of four) I get following error (IPython output):Kernel: 4.20.7 (Arch Linux) Btrfs-progs: v4.20.1