libext2: initialize filesystem

  • 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?


    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.


Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks