reassign 380226 partman-base thanks This is not a bug in libparted; parted_server is simply not specifying the correct constraint for the resize operation.
This patch might fix parted_server, but I don't know how to test it. diff -u parted_server.c~ parted_server. --- parted_server.c~ 2007-01-11 13:57:27.000000000 +0000 +++ parted_server.c 2007-02-27 23:50:18.000000000 +0000 @@ -712,8 +712,6 @@ ped_file_system_close(fs); fs = NULL; } - if (NULL == fs && NULL != ped_file_system_probe(&(part->geom))) - return false; } else { fs = NULL; } @@ -727,10 +725,50 @@ log("successfully checked"); if (part->type & PED_PARTITION_LOGICAL) maximize_extended_partition(disk); - if (NULL != fs) + if (NULL != fs) { constraint = ped_file_system_get_resize_constraint(fs); - else - constraint = ped_constraint_any(disk->dev); + } else { + PedFileSystemType *fs_type; + PedGeometry *fs_geom; + PedAlignment start_align; + PedGeometry full_dev; + fs_type = ped_file_system_probe(&(part->geom)); + log("probed file system: %s", NULL != fs_type ? "yes" : "no"); + if (NULL != fs_type) { + fs_geom = ped_file_system_probe_specific(fs_type, + &part->geom); + } else { + fs_geom = NULL; + } + if (NULL != fs_geom) { + /* We cannot resize or move the fs but we can move the + * end of the partition so long as it contains the + * whole fs. + */ + if (ped_alignment_init(&start_align, + fs_geom->start, 0) + && ped_geometry_init(&full_dev, disk->dev, + 0, disk->dev->length - 1)) { + constraint = ped_constraint_new( + &start_align, + ped_alignment_any, + &full_dev, &full_dev, + fs_geom->length, + disk->dev->length); + } else { + constraint = NULL; + } + ped_geometry_destroy(fs_geom); + } else { + constraint = NULL; + } + } + if (open_filesystem && NULL == constraint) { + log("failed to get resize constraint"); + if (NULL != fs) + ped_file_system_close(fs); + return false; + } if (!ped_disk_set_partition_geom(disk, part, constraint, start, end)) result = false; else if (NULL == fs) -- END -- I'm assuming that open_filesystem will be set when resizing the NTFS partition. This should be the case if it's not a virtual partition (what does that mean?). Ben. -- Ben Hutchings Power corrupts. Absolute power is kind of neat. - John Lehman, Secretary of the US Navy 1981-1987
signature.asc
Description: This is a digitally signed message part