Enable --force option for lvresize
PATCH 1/1 Enable --force option for lvresize
I use lvresize in a script and want to be able to disable the yes/no prompt when a logical volume is reduced in size. The yes_no prompt is already guarded by 'if (!arg_count(cmd, force_ARG))' in lvresize.c, but the --force argument isn't included for lvresize in tools/commands.h so it can't be specified. This tiny patch fixes that.
Cheers,
Chris.
-------------- next part --------------
tools/commands.h +8 -5
@@ -217,6 +217,7 @@"\t[-A|--autobackup y|n]\n" "\t[--alloc AllocationPolicy]\n" "\t[-d|--debug]\n" +"\t[-f|--force]\n" "\t[-h|--help]\n" "\t[-i|--stripes Stripes [-I|--stripesize StripeSize]]\n" "\t{-l|--extents [+]LogicalExtentsNumber[%{VG|PVS|FREE}] |\n"
@@ -230,9 +231,9 @@ "\t[--version]" "\n" "\tLogicalVolume[Path] [ PhysicalVolumePath... ]\n", - alloc_ARG, autobackup_ARG, extents_ARG, mirrors_ARG, nofsck_ARG, - resizefs_ARG, size_ARG, stripes_ARG, stripesize_ARG, test_ARG, - type_ARG) + alloc_ARG, autobackup_ARG, force_ARG, extents_ARG, mirrors_ARG, + nofsck_ARG, resizefs_ARG, size_ARG, stripes_ARG, stripesize_ARG, + test_ARG, type_ARG) xx(lvmchange, "With the device mapper, this is obsolete and does nothing.",
@@ -339,6 +340,7 @@"\t[-A|--autobackup y|n]\n" "\t[--alloc AllocationPolicy]\n" "\t[-d|--debug]\n" +"\t[-f|--force]\n" "\t[-h|--help]\n" "\t[-i|--stripes Stripes [-I|--stripesize StripeSize]]\n" "\t{-l|--extents [+|-]LogicalExtentsNumber[%{VG|LV|PVS|FREE}] |\n"
@@ -351,8 +353,9 @@ "\t[--version]" "\n" "\tLogicalVolume[Path] [ PhysicalVolumePath... ]\n", - alloc_ARG, autobackup_ARG, extents_ARG, nofsck_ARG, resizefs_ARG, - size_ARG, stripes_ARG, stripesize_ARG, test_ARG, type_ARG) + alloc_ARG, autobackup_ARG, extents_ARG, force_ARG, nofsck_ARG, + resizefs_ARG, size_ARG, stripes_ARG, stripesize_ARG, test_ARG, + type_ARG) xx(lvs, "Display information about logical volumes",