VG Name main
LV UUID 7U5wVQ-qIWU-7bcz-J4vT-zAPh-xGVN-CDNfjx
LV Write Access read/write
LV snapshot status active destination for /dev/main/multimedia
LV Status available
# open 0
LV Size 512.00 MB
Current LE 128
COW-table size 128.00 MB
COW-table LE 32
Allocated to snapshot 0.02%
Snapshot chunk size 8.00 KB
Segments 1
Allocation inherit
Read ahead sectors 0
Block device 253:6
This display shows the volume group, attributes (again, see man lvm ), and logical volume size. Additional information is shown for snapshot volumes and LVs that are being copied or moved between PVs. The Block device shown in the
6.1.1.3.3. Growing a logical volume
To increase the size of a logical volume, use the
# lvextend
Extending logical volume multimedia to 1.00 GB
Logical volume multimedia successfully resized
Specify the LV device as the first argument, and use the --size option to specify the new size for the volume. Use a numeric size with one of the size suffixes from Table 6-2 as the value for the --size option.
Table 6-2. Size suffixes used by LVM
Suffix | Name | Size | Approximation |
---|---|---|---|
k, K | Kibibyte (kilobyte) | 210 = 1,024 bytes | Thousand bytes |
m, M | Mebibyte (megabyte) | 220 = 1,048,576 bytes | Million bytes |
g, G | Gibibyte (gigabyte) | 230 = 1,073,741,824 bytes | Billion bytes |
t, T | Tebibyte (terabyte) | 240 = 1,099,511,627,776 bytes | Trillion bytes |
Once you have resized the LV, resize the filesystem contained inside:
#
resize2fs
resize2fs 1.39 (29-May-2006)
Resizing the filesystem on /dev/main/multimedia to 1048576 (1k) blocks.
The filesystem on /dev/main/multimedia is now 1048576 blocks long.
Note that you do not need to specify the filesystem size; the entire LV size will be used.
If the
6.1.1.3.4. Shrinking a logical volume
Before reducing the size of a logical volume, you must first reduce the size of the filesystem inside the LV. This must be done when the filesystem is unmounted:
# umount
Next, run a filesystem check to verify the integrity of the filesystem. This is required in order to prevent data loss that may occur if there is data near the end of the filesystem (this is the area that will be freed up by shrinking) and that data is not properly accounted for in the filesystem tables:
# fsck -f
e2fsck 1.38 (30-Jun-2005)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure