[parted-devel] filesystem-related functions in libparted
Curtis Gedak
gedakc at gmail.com
Wed Aug 1 16:10:29 UTC 2012
Hi Lisa,
Responses to questions follow in-line.
On 12-07-27 05:49 AM, Lisa Vitolo wrote:
> I need to implement these two things:
> 1) knowing the minimum size a partition can be resized to (for when
> there is a filesystem and we don't want to destroy its data);
The minimum size for a partition depends on the minimum size of the file
system. The minimum partition size can also be affected by the type of
alignment used. For example with modern disk drives, the size of a
cylinder is 255 heads * 63 sectors per track = 16,065 sectors. Please
note that cylinder alignment is used for legacy operating systems, such
as DOS. Newer operating systems and disk drives work well with, and
often default to MiB alignment.
> 2) resizing a partition together with its filesystem, if resizing is
> supported for that particular filesystem.
> I've read that for resizing a filesystem I need to call directly the
> filesystem services as you don't support it anymore starting from
> libparted 3.0, and that's okay.
The resizing capability for FAT16, FAT32, HFS, and HFS+ was
re-introduced in a separate library with parted 3.1.0.
> For the second task, from what I heard libparted still provides
> ped_file_system_open and ped_file_system_get_resize_constraint, but it
> seems I'm not able to access them in my code. I've included the
> headers parted.h and filesys.h, but I still receive an error from the
> compiler (not the linker) that it doesn't find them. My version of
> parted is 3.0-1. What am I missing? :)
I suggest that you start your project using the latest version of
parted-3.1 (not 3.0-1).
http://lists.gnu.org/archive/html/bug-parted/2012-03/msg00001.html
For an example of how to link with the new libparted-fs-resize library,
you might look at the GParted source code. Specifically configure.in,
and src/Makefile.am.
http://gparted.org
Regards,
Curtis Gedak
More information about the parted-devel
mailing list