summaryrefslogtreecommitdiffstats
path: root/resize
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2011-07-13 09:27:57 +0100
committerRichard W.M. Jones <rjones@redhat.com>2011-07-13 09:27:57 +0100
commitd31de200b82ef66d7e87b32dd5345c053997cc35 (patch)
tree61c66e460f4e759534216e07e8dfedcb7fd70bb4 /resize
parent8c26750336f0f9cbcaa1e98278d9062af83a6b65 (diff)
downloadlibguestfs-d31de200b82ef66d7e87b32dd5345c053997cc35.tar.gz
libguestfs-d31de200b82ef66d7e87b32dd5345c053997cc35.tar.xz
libguestfs-d31de200b82ef66d7e87b32dd5345c053997cc35.zip
virt-resize: Add --ntfsresize-force option.
Use the non-deprecated g#ntfsresize_opts API call, and also add the --ntfsresize-force option for forcing resize.
Diffstat (limited to 'resize')
-rw-r--r--resize/resize.ml9
-rw-r--r--resize/virt-resize.pod8
2 files changed, 14 insertions, 3 deletions
diff --git a/resize/resize.ml b/resize/resize.ml
index 82fd7658..8e7057c6 100644
--- a/resize/resize.ml
+++ b/resize/resize.ml
@@ -30,7 +30,7 @@ let prog = Filename.basename Sys.executable_name
let infile, outfile, copy_boot_loader, debug, deletes, dryrun,
expand, expand_content, extra_partition, format, ignores,
- lv_expands, output_format,
+ lv_expands, ntfsresize_force, output_format,
quiet, resizes, resizes_force, shrink =
let display_version () =
let g = new G.guestfs () in
@@ -57,6 +57,7 @@ let infile, outfile, copy_boot_loader, debug, deletes, dryrun,
let format = ref "" in
let ignores = ref [] in
let lv_expands = ref [] in
+ let ntfsresize_force = ref false in
let output_format = ref "" in
let quiet = ref false in
let resizes = ref [] in
@@ -85,6 +86,7 @@ let infile, outfile, copy_boot_loader, debug, deletes, dryrun,
"-n", Arg.Set dryrun, " Don't perform changes";
"--dryrun", Arg.Set dryrun, " -\"-";
"--dry-run", Arg.Set dryrun, " -\"-";
+ "--ntfsresize-force", Arg.Set ntfsresize_force, " Force ntfsresize";
"--output-format", Arg.Set_string format, "format Format of output disk";
"-q", Arg.Set quiet, " Don't print the summary";
"--quiet", Arg.Set quiet, " -\"-";
@@ -123,6 +125,7 @@ read the man page virt-resize(1).
let format = match !format with "" -> None | str -> Some str in
let ignores = List.rev !ignores in
let lv_expands = List.rev !lv_expands in
+ let ntfsresize_force = !ntfsresize_force in
let output_format = match !output_format with "" -> None | str -> Some str in
let quiet = !quiet in
let resizes = List.rev !resizes in
@@ -138,7 +141,7 @@ read the man page virt-resize(1).
infile, outfile, copy_boot_loader, debug, deletes, dryrun,
expand, expand_content, extra_partition, format, ignores,
- lv_expands, output_format,
+ lv_expands, ntfsresize_force, output_format,
quiet, resizes, resizes_force, shrink
(* Default to true, since NTFS support is usually available. *)
@@ -916,7 +919,7 @@ let () =
| Resize2fs ->
g#e2fsck_f target;
g#resize2fs target
- | NTFSResize -> g#ntfsresize target
+ | NTFSResize -> g#ntfsresize_opts ~force:ntfsresize_force target
in
(* Expand partition content as required. *)
diff --git a/resize/virt-resize.pod b/resize/virt-resize.pod
index c84e40fb..69c93e38 100644
--- a/resize/virt-resize.pod
+++ b/resize/virt-resize.pod
@@ -405,6 +405,14 @@ of partitions, if it knows how (see I<--expand> option above).
If you give the I<--no-expand-content> option then virt-resize
will not attempt this.
+=item B<--ntfsresize-force>
+
+Pass the I<--force> option to L<ntfsresize(8)>, allowing resizing
+even if the NTFS disk is marked as needing a consistency check.
+You have to use this option if you want to resize a Windows
+guest multiple times without booting into Windows between each
+resize.
+
=item B<-d>
=item B<--debug>