may result in uneven performance. When adding space to the logical volume, the default operation
is to use the same striping parameters of the last segment of the existing logical volume, but you can
override those parameters. The following example extends the existing striped logical volume to use
the remaining free space after the initial lvextend command fails.
# lvextend vg/stripe1 -L 406G
Using stripesize of last segment 64.00 KB
Extending logical volume stripe1 to 406.00 GB
Insufficient suitable allocatable extents for logical volume stripe1:
34480
more required
# lvextend -i1 -l+100%FREE vg/stripe1
4.4.10. Shrinking Logical Volumes
To reduce the size of a logical volume, first unmount the file system. You can then use the lvreduce
command to shrink the volume. After shrinking the volume, remount the file system.
Warning
It is important to reduce the size of the file system or whatever is residing in the volume
before shrinking the volume itself, otherwise you risk losing data.
Shrinking a logical volume frees some of the volume group to be allocated to other logical volumes in
the volume group.
The following example reduces the size of logical volume lvol1 in volume group vg00 by 3 logical
extents.
lvreduce -l -3 vg00/lvol1
4.5. Creating Snapshot Volumes
Use the -s argument of the lvcreate command to create a snapshot volume. A snapshot volume is
writeable.
LVM snapshots are not cluster-aware, so they require exclusive access to a volume. For information
on activating logical volumes on individual nodes in a cluster, see
Volumes on Individual Nodes in a
The following command creates a snapshot logical volume that is 100 megabytes in size named /
dev/vg00/snap. This creates a snapshot of the origin logical volume named /dev/vg00/lvol1.
If the original logical volume contains a file system, you can mount the snapshot logical volume on an
arbitrary directory in order to access the contents of the file system to run a backup while the original
file system continues to get updated.
lvcreate --size 100M --snapshot --name snap /dev/vg00/lvol1
Cluster".
Shrinking Logical Volumes
Section 4.8, "Activating Logical
37
Need help?
Do you have a question about the ENTERPRISE LINUX 4 - LVM ADMINISTRATOR and is the answer not in the manual?
Questions and answers