Linux下的LVM是个好东东,调整分区非常方便。网上很多文章都提到用lvresize来分配分区大小,但是都没有提到需要用resize2fs来使设置生效,不知道是不是linux版本的原因。我的使用环境是CentOS5.5,ext3的文件格式。贴一下过程以备忘。
[root@ou ~]# df -h 文件系统 容量 已用 可用 已用% 挂载点 /dev/mapper/VG01-LV_ROOT 9.7G 3.9G 5.3G 43% / /dev/sda1 99M 12M 82M 13% /boot tmpfs 506M 0 506M 0% /dev/shm /dev/mapper/VG01-LV_APPS 2.0G 68M 1.9G 4% /apps [root@ou ~]# vgdisplay --- Volume group --- VG Name VG01 System ID Format lvm2 Metadata Areas 1 Metadata Sequence No 14 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 18.88 GB PE Size 32.00 MB Total PE 604 Alloc PE / Size 384 / 12.00 GB Free PE / Size 220 / 6.88 GB VG UUID Mk4SOE-0ydq-8Kov-QdDw-d4eL-MXaF-G5i6bv [root@ou ~]# lvresize -L +2G /dev/mapper/VG01-LV_APPS Extending logical volume LV_APPS to 4.00 GB Logical volume LV_APPS successfully resized [root@ou ~]# df -h 文件系统 容量 已用 可用 已用% 挂载点 /dev/mapper/VG01-LV_ROOT 9.7G 3.9G 5.3G 43% / /dev/sda1 99M 12M 82M 13% /boot tmpfs 506M 0 506M 0% /dev/shm /dev/mapper/VG01-LV_APPS 2.0G 68M 1.9G 4% /apps [root@ou ~]# resize2fs /dev/mapper/VG01-LV_APPS resize2fs 1.39 (29-May-2006) Filesystem at /dev/mapper/VG01-LV_APPS is mounted on /apps; on-line resizing required Performing an on-line resize of /dev/mapper/VG01-LV_APPS to 1048576 (4k) blocks. The filesystem on /dev/mapper/VG01-LV_APPS is now 1048576 blocks long. [root@ou ~]# df -h 文件系统 容量 已用 可用 已用% 挂载点 /dev/mapper/VG01-LV_ROOT 9.7G 3.9G 5.3G 43% / /dev/sda1 99M 12M 82M 13% /boot tmpfs 506M 0 506M 0% /dev/shm /dev/mapper/VG01-LV_APPS 4.0G 69M 3.7G 2% /apps
Recent Comments