lvreduce(1M) — Series 800 Only
NAME
lvreduce − decrease number of physical extents allocated to a logical volume
SYNOPSIS
/etc/lvreduce {-m mirror_copies | -l logical_extents_number | -L logical_volume_size} [-f] lv_path [physical_volume_path ...]
DESCRIPTION
lvreduce changes either the number of logical extents allocated to a logical volume specified by lv_path, or the number of physical extents allocated to each logical extent in the logical volume. The change is determined according to which command options you use. lvreduce removes mirror copies from physical_volume_path, if specified.
Options
lvreduce recognizes the following options and arguments:
-f Force reduction of the number of logical extents without first requesting confirmation. Note: This option can be dangerous when there is a file system on the lv_path that is larger than the size which the Logical Volume is being reduced to. If the file system is unmounted, the -f option forces the reduction the Logical Volume without reducing the file system. The file system becomes corrupt and is not mountable. If the file system is mounted, lvreduce fails, preventing a mounted file system from becoming corrupted. This option is allowed only if -l or -L is also specified.
-m mirror_copies
Set the number of physical extents (mirrors) allocated for each logical extent.
mirror_copies can have the value 0 or 1. This means that beyond the original copy, no other (0) or one (1) mirror copy contains the same data as the original copy. If they are specified in the command line, mirror copies residing in physical_volume_path are used for lvreduce.
mirror_copies must be less than the current number of mirrors for the logical volume. One, and only one of the three options -m, -l, and -L must be specified.
This option requires installation of optional LVM MIRRORING software (not included in the standard HP-UX operating system) before it can be used.
-l logical_extents_number
Decrease the number of logical extents allocated to the lv_path. logical_extents_number must be less than the number of logical extents previously allocated to lv_path.
logical_extents_number represents the new total number of logical extents within lv_path. The change is accomplished by deallocating the number of logical extents represented by the difference between the previous number of extents and logical_extents_number.
lvreduce asks for confirmation if the -f option is not specified.
lvreduce requires use of one of the three options, -l, -L, or -m.
-L logical_volume_size
Decrease the size of logical volume to logical_volume_size, where logical_volume_size is specified in units of Mbytes. If the logical_volume_size is not a multiple of extent size, the size is adjusted to the next multiple.
The -L option is the same as -l option, where logical_extents_number is equivalent to logical_volume_size divided by extent size.
See the description of -l option above.
EXTERNAL INFLUENCES
Environment Variables
LANG determines the language in which messages are displayed.
If LANG is not specified or is set to the empty string, a default of "C" (see lang(5)) is used instead of LANG.
If any internationalization variable contains an invalid setting, lvreduce behaves as if all internationalization variables are set to "C". See environ(5).
EXAMPLES
Decrease the number of the logical extents of a logical volume to one hundred:
lvreduce -l 100 /dev/vg01/lvol3
Reduce to one mirror (that is, two copies) for each logical extent of a logical volume:
lvreduce -m 1 /dev/vg01/lvol5
Remove mirror copies of logical extents of a logical volume, possibly from the physical volume /dev/dsk/c1d0s2:
lvreduce -m 0 /dev/vg01/lvol4 /dev/dsk/c1d0s2
WARNINGS
The Logical Volume Manager does not store any information about which physical extents contain useful data; therefore, using the -l option might lead to the loss of useful data. Specifically, a file system corruption occurs if the lvreduce operation occurs on an unmounted file system. The lvreduce command on a Logical Volume containing a file system of greater length than the size being reducing to is not recommended.
To reduce a Logical Volume being used for swap, that swap area must be currently be in use.
SEE ALSO
lvcreate(1M), lvdisplay(1M), lvextend(1M), pvchange(1M), pvdisplay(1M).
Hewlett-Packard Company — HP-UX Release 9.0: August 1992