I want to resize an ext4 partition programmatically in C. I believe I can use libparted to resize the partition, but not the file system? Can anybody point me in the right direction?
Asked
Active
Viewed 713 times
0
-
1You could have a look at the source of resize2fs. – thiton Jul 12 '12 at 10:29
-
which can be found [here](http://git.kernel.org/?p=fs/ext2/e2fsprogs.git;a=summary). – Alex Chamberlain Jul 12 '12 at 10:31
1 Answers
0
Use resize_fs()
.
Take a look here for example of usage:
http://fossies.org/dox/e2fsprogs-1.42.4/resize2fs_8c_source.html#l00072

Igor Chubin
- 61,765
- 13
- 122
- 144
-
Thanks! It should be noted `main` of `main.c` does a lot of work prior to calling that function. – Alex Chamberlain Jul 12 '12 at 11:44