[Parted-maintainers] Bug#380226: libparted does not resize NTFS

Frans Pop elendil at planet.nl
Mon Jan 22 21:51:29 GMT 2007


Hello David,

First of all, thank you for your interest in helping solve this.

On Monday 22 January 2007 22:01, David Cantrell wrote:
> libparted does not resize NTFS at the moment, so it's not the cause of
> the problem.  But I'm not sure what you are using libparted with.  What
> software are you using that invokes libparted?  Where can I find the
> source for it?

Correct. We use ntfsresize to resize the file system. The only thing we 
need libparted for is to resize the physical partition the NTFS file 
system is on.

The actual resize operation is done in the following steps:
- run ntfsresize to determine if the NTFS partition is clean and what the
  range is it can be resized to
- ask user for new partition/file system size
- if smaller than current, resize NTFS file system using ntfsresize
- resize physical partition using libparted
- resize NTFS file system up to new size of physical partition

This procedure works fine for pre-Vista NTFS partitions.
With Vista partitions the issue we currently have is that Windows for some 
reason no longer creates the partition starting on the second sector of 
the disk and that libparted, because of the current constraints, changes 
the starting sector of the physical partition which, of course, makes the 
file system inaccessible.

The software we use for this in the installer is a fairly complex beast 
called partman, which consists of various components. Most of it is 
scripted, but the interaction with libparted is done through a program 
called parted_server.

The script that does the resize operation is:
http://svn.debian.org/wsvn/d-i/trunk/packages/partman/partman-partitioning/active_partition/resize/do_option?op=file&rev=0&sc=0
which calls functions in (of main interest are the functions 
get_ntfs_resize_range and perform_resizing):
http://svn.debian.org/wsvn/d-i/trunk/packages/partman/partman-partitioning/resize.sh?op=file&rev=0&sc=0
and more general functions in:
http://svn.debian.org/wsvn/d-i/trunk/packages/partman/partman-base/definitions.sh?op=file&rev=0&sc=0

The parted_server program is:
http://svn.debian.org/wsvn/d-i/trunk/packages/partman/partman-base/parted_server.c?op=file&rev=0&sc=0

Hope this helps.

Cheers,
Frans Pop

P.S. If you would like to discuss this, feel free to look for me on IRC. I 
am "fjp" on #debian-boot on OFTC.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.alioth.debian.org/pipermail/parted-maintainers/attachments/20070122/14bf2956/attachment.pgp


More information about the Parted-maintainers mailing list