Menu

libext2: initialize filesystem

Help
2007-11-08
2012-11-28
  • Parker Abercrombie

    Is it possible to programatically initialize a file system using libext2? (Rather than using mke2fs.) I want to create a virtual filesystem in a single file, and would like my app to be able to initialize the thing. I see in the documentation that ext2fs_initialize and ext2fs_allocate_tables do part of the job. Does the library provide a facility for doing the rest, or am I best off modifying mke2fs?

    Thanks,

    --
    Parker Abercrombie

     
    • Theodore Ts'o

      Theodore Ts'o - 2008-01-02

      It's probably easiest and safest to use system("mke2fs ..."). 

      There currently isn't a single library interface that will do everything that mke2fs does, and while you could copy the code from mke2fs into your program, it wouldn't be very portable, as we add new filesystem features to ext4.

       

Log in to post a comment.