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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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
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.