mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-22 07:03:38 +00:00
lvresize: Use --force so it can make LVs smaller (RHBZ#587484).
This also adds a regression test for this bug.
This commit is contained in:
@@ -267,7 +267,7 @@ do_lvresize (const char *logvol, int mbytes)
|
||||
|
||||
r = command (NULL, &err,
|
||||
"lvm", "lvresize",
|
||||
"-L", size, logvol, NULL);
|
||||
"--force", "-L", size, logvol, NULL);
|
||||
if (r == -1) {
|
||||
reply_with_error ("%s", err);
|
||||
free (err);
|
||||
|
||||
@@ -2585,7 +2585,14 @@ are activated or deactivated.");
|
||||
["e2fsck_f"; "/dev/VG/LV"];
|
||||
["resize2fs"; "/dev/VG/LV"];
|
||||
["mount_options"; ""; "/dev/VG/LV"; "/"];
|
||||
["cat"; "/new"]], "test content")],
|
||||
["cat"; "/new"]], "test content");
|
||||
InitNone, Always, TestRun (
|
||||
(* Make an LV smaller to test RHBZ#587484. *)
|
||||
[["part_disk"; "/dev/sda"; "mbr"];
|
||||
["pvcreate"; "/dev/sda1"];
|
||||
["vgcreate"; "VG"; "/dev/sda1"];
|
||||
["lvcreate"; "LV"; "VG"; "20"];
|
||||
["lvresize"; "/dev/VG/LV"; "10"]])],
|
||||
"resize an LVM logical volume",
|
||||
"\
|
||||
This resizes (expands or shrinks) an existing LVM logical
|
||||
|
||||
Reference in New Issue
Block a user