Thread: Print Block Bitmap ext2 -- Help!!

  1. #1
    Registered User
    Join Date
    Nov 2011
    Posts
    2

    Print Block Bitmap ext2 -- Help!!

    Hallo,

    i´m quiet new with learning c.
    i have to print the block bitmap (data bitmap) from a blockgroup.
    i don´t know how to begin. could you please so kind and help me?

    thanks

  2. #2
    Registered User
    Join Date
    Nov 2010
    Location
    Long Beach, CA
    Posts
    5,909
    If you just want to know blockgroup info, look into the dumpe2fs utility, it might give you what you want.

    If you're new to C, I recommend starting here: C, C++ Programming Tutorials - Cprogramming.com. Messing directly with the file system is probably not a good idea until you have a solid grasp of C.

    As for the ext2 specifics, I can't help you much as I've never delved into the inner workings. The code for all the ext2 utilities is open source, so perhaps you could look at the source of dumpe2fs, tune2fs and debugfs to get an idea of the inner workings. There's probably a library somewhere that gives you a nice API for messing with ext2 file systems.

  3. #3
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,661
    This seemed pretty easy to find.
    Internals of the ext2 Filesystem

    > i´m quiet new with learning c.
    But newbies messing around with code running as "root" and accessing the low level file system is a recipe for disaster.

    Do you really have to read your own block, or are you perhaps just given a file containing just "the bits" and you have to decode it "as if" you had just read the block yourself. This option is FAR FAR safer for you to tackle.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  4. #4
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    Quote Originally Posted by Andurl462
    Messing directly with the file system is probably not a good idea until you have a solid grasp of C.
    And most likely isn't a good idea, even then...

  5. #5
    Registered User
    Join Date
    Nov 2011
    Posts
    2
    I have to enter each blockgroup and then print every datablock bitmap.

  6. #6
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,661
    OK, so show some code to let us see where you're heading with this, and what your general skill level is like.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Trouble Updating Free Inodes Count on Ext2 FS
    By scurtis in forum C Programming
    Replies: 5
    Last Post: 04-19-2010, 07:52 PM
  2. How to acquire ext2 partition size?
    By pupkin in forum Windows Programming
    Replies: 4
    Last Post: 07-23-2007, 05:00 AM
  3. Unable to List Files Attributes on EXT2
    By Maragato in forum C Programming
    Replies: 16
    Last Post: 08-11-2004, 12:30 PM
  4. Accessing EXT2 from FAT32
    By shankar96 in forum Linux Programming
    Replies: 1
    Last Post: 05-14-2004, 06:47 AM
  5. Reading a (possibly EXT2) partition with Windows
    By nickname_changed in forum Linux Programming
    Replies: 5
    Last Post: 08-20-2003, 07:43 PM