how to resize logical volume on LVM partition
---------------------------------------------
[root@igloo ~]# vgdisplay
--- Volume group ---
VG Name VolGroup00
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 7
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 2
Open LV 2
Max PV 0
Cur PV 1
Act PV 1
VG Size 74.41 GB
PE Size 32.00 MB
Total PE 2381
Alloc PE / Size 193 / 6.03 GB
Free PE / Size 2188 / 68.38 GB
VG UUID JoY5DH-S0HV-Q5Dw-b2wC-Rpe0-XeaR-QFbG75
[root@igloo ~]# lvresize -l +2188 /dev/VolGroup00/LogVol00
Extending logical volume LogVol00 to 73.41 GB
Logical volume LogVol00 successfully resized
[root@igloo ~]# vgdisplay
--- Volume group ---
VG Name VolGroup00
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 9
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 2
Open LV 2
Max PV 0
Cur PV 1
Act PV 1
VG Size 74.41 GB
PE Size 32.00 MB
Total PE 2381
Alloc PE / Size 2381 / 74.41 GB
Free PE / Size 0 / 0
VG UUID JoY5DH-S0HV-Q5Dw-b2wC-Rpe0-XeaR-QFbG75
[root@igloo ~]# lvscan
ACTIVE '/dev/VolGroup00/LogVol00' [73.41 GB] inherit
ACTIVE '/dev/VolGroup00/LogVol01' [1.00 GB] inherit
[root@igloo ~]# tune2fs -l /dev/VolGroup00/LogVol00
tune2fs 1.36 (05-Feb-2005)
Filesystem volume name: <none>
Last mounted on: <not available>
Filesystem UUID: b7ca5f0d-1e0c-4ea1-992f-90a05f9aad3e
Filesystem magic number: 0xEF53
Filesystem revision #: 1 (dynamic)
Filesystem features: has_journal ext_attr resize_inode dir_index filetype needs_recovery sparse_super large_file
Default mount options: (none)
Filesystem state: clean
Errors behavior: Continue
Filesystem OS type: Linux
Inode count: 659936
Block count: 1318912
Reserved block count: 65945
Free blocks: 912119
Free inodes: 580516
First block: 0
Block size: 4096
Fragment size: 4096
Reserved GDT blocks: 321
Blocks per group: 32768
Fragments per group: 32768
Inodes per group: 16096
Inode blocks per group: 503
Filesystem created: Thu Apr 14 07:22:27 2005
Last mount time: Sun Apr 17 17:24:09 2005
Last write time: Sun Apr 17 17:24:09 2005
Mount count: 6
Maximum mount count: -1
Last checked: Thu Apr 14 07:22:27 2005
Check interval: 0 (<none>)
Reserved blocks uid: 0 (user root)
Reserved blocks gid: 0 (group root)
First inode: 11
Inode size: 128
Journal inode: 8
Default directory hash: tea
Directory Hash Seed: b6995f53-9ac4-4e8d-ab1f-fbe7e0e2326e
Journal backup: inode blocks
on a Fedora Core 2 box, do these tricks:
[root@flabby ~]# vgchange -an /dev/VolGroup00
[root@flabby ~]# vgrename /dev/VolGroup00 /dev/VolGroup01
[root@flabby ~]# vgchange -ay
attach the hard disk to a Fedora Core 3 box:
[root@intruder ~]# e2fsck -f /dev/VolGroup01/LogVol00
e2fsck 1.35 (28-Feb-2004)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/VolGroup01/LogVol00: 79450/659936 files (1.3% non-contiguous), 406478/1318912 blocks
[root@intruder ~]# resize2fs /dev/VolGroup01/LogVol00
resize2fs 1.35 (28-Feb-2004)
esizing the filesystem on /dev/VolGroup01/LogVol00 to 19243008 (4k) blocks.
The filesystem on /dev/VolGroup01/LogVol00 is now 19243008 blocks long.
[root@intruder ~]# e2fsck -f /dev/VolGroup01/LogVol00
[root@intruder ~]# mount /dev/VolGroup01/LogVol00 /mnt/hd/
[root@intruder ~]# df -m /mnt/hd/
Filesystem 1M-blocks Used Available Use% Mounted on
/dev/mapper/VolGroup01-LogVol00
74008 1507 69495 3% /mnt/hd
|