Search code examples
linuxext3

Read blocks from an ext3 filesystem?


What's the easiest way to access an ext3 file system at the block level? I don't care for the files, or raw bytes, I just have to read the FS one block at a time. Is there a simple way to do this (in C)? Or maybe a simple app whose source I could look into for inspiration? I found no usable tutorials on the net, and I'm a bit scared to dive into the kernel source to find out how to do it.


Solution

  • Yes, see e2fsprogs. This provides tools you can use to do anything(!) with ext2, ext3, and ext4 filesystems. It also contains a library interface so you can do anything else.

    See the included debugfs, it might be enough for you to start. Otherwise, check out the headers and write some code.