| 第六步:在线调整文件系统的大小
[root@localhost users]# lvextend -L 32M /dev/myvg/mylv1 ====》这是物理扩容 Extending logical volume mylv1 to 32.00 MB Logical volume mylv1 successfully resized
[root@localhost users]# lvs LV VG Attr LSize Origin Snap% Move Log Copy% mylv1 myvg -wi-ao 32.00M [root@localhost users]# resize2fs -p /dev/myvg/mylv1 ====》这是逻辑扩容 resize2fs 1.39 (29-May-2006) Filesystem at /dev/myvg/mylv1 is mounted on /users; on-line resizing required Performing an on-line resize of /dev/myvg/mylv1 to 32768 (1k) blocks. The filesystem on /dev/myvg/mylv1 is now 32768 blocks long.
[root@localhost users]# df -lh Filesystem Size Used Avail Use% Mounted on /dev/sda2 3.8G 3.3G 384M 90% / /dev/sda3 14G 1.1G 12G 9% /home /dev/sda1 46M 11M 34M 24% /boot tmpfs 252M 0 252M 0% /dev/shm /dev/mapper/myvg-mylv1 32M 1.1M 30M 4% /users
[root@localhost users]# cat /users/inittab # # inittab This file describes how the INIT process should set up # the system in a certain run-level. # # Author: Miquel van Smoorenburg, <miquels@drinkel.nl.mugnet.org>
通过LVM的逻辑架构图,需要明确的是,如果要对文件系统进行扩容,应该分为2步进行操作,首先进行物理扩容,然后是逻辑扩容。所谓物理扩容,是从物理的角度,对LV进行扩展,当然LV本身的大小收到VG的限制;所谓逻辑扩容,是通过对文件系统的逻辑边界进行重新确定,是依附于物理边界之上的。 |