Skip to contentSkip to conversation

GUI for "btrfs inspect-internal"?

discuss Zhang Boyang 2 participants 2 messages Oct 12, 2020 Btrfs file system

lore
Share & tools
lore
#0 lore raw

Hello all,

I'm a learner of btrfs, I found "btrfs inspect-internal" is very useful. However it's seems not user friendly. For example, if I want view EXTENT_DATA for some inode, I need to walk through root to leaf (I'm not sure), which is a boring task.

I want to develop a GUI for "btrfs inspect-internal". Basically it will communicate with "btrfs inspect-internal" CLI using pipes.

+------------------------+
| btrfs inspect-internal |
+------------------------+
           | pipe
 +---------------------+                   +---------------+
 |    backend server   |-------------------|  web browser  |
 | maybe: python+flask |       http        |     (GUI)     |
 +---------------------+                   +---------------+

The GUI will include features like "click block offset to jump", "view history", "jump to inode", etc.

Do you think this is a good idea? Comments are welcome.

Thank you all!

ZBY

#1 lore raw
Quoted 20 lines · Zhang Boyang

Hello all,

I'm a learner of btrfs, I found "btrfs inspect-internal" is very useful. However it's seems not user friendly. For example, if I want view EXTENT_DATA for some inode, I need to walk through root to leaf (I'm not sure), which is a boring task.

I want to develop a GUI for "btrfs inspect-internal". Basically it will communicate with "btrfs inspect-internal" CLI using pipes.

+------------------------+
| btrfs inspect-internal |
+------------------------+
           | pipe
 +---------------------+                   +---------------+
 |    backend server   |-------------------|  web browser  |
 | maybe: python+flask |       http        |     (GUI)     |
 +---------------------+                   +---------------+
Quoted 4 lines

The GUI will include features like "click block offset to jump", "view history", "jump to inode", etc.

Do you think this is a good idea? Comments are welcome.

This is certainly something I've considered doing. I'd say a few
points to think about (having done so myself):

- Make sure that the "GUI" on the browser side works in plain text mode with lynx or links or similar. This is likely to be useful as a diagnostic tool, possibly in environments with no network or desktop to support a graphical JS-enabled browser.

- Think carefully about the URI structure for your server. Every individual item in the filesystem (metadata block, inode, tree, tree entry, extent, ...) should have its own unique URI, and you should be able to do the navigation between these things.

- Filesystems being investigated like this are more likely than not going to be broken in some way. Make sure your code is robust to that.

- Piping direct from inspect-internal is maybe not the best approach, as you'll be spending quite a lot of time parsing text from it. For a mountable filesystem, using something like python-btrfs to access the search ioctls might be a better approach; for a filesystem that's not mountable, you're going to have to hit the block device directly.

- Due to the above, consider writing your code to separate the presentation mechanism from the metadata-reading mechanism, so that it's easier to switch out one FS-reader for another.

Hugo.

Signature · 4 lines
Hugo Mills             | In the future, terrorists won't be carrying their ID
hugo@... carfax.org.uk | cards. They'll be carrying yours.
http://carfax.org.uk/  |
PGP: E2AB1DE4          |                          Henry Porter, Suspect Nation