首先确认VG中有足够的剩余容量,否则要先进行扩VG操作,再此略过
[root@rhel6 ~]# fdisk -l
Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x7594408f
/dev/sda1
Partition 1 does not end on cylinder boundary.
/dev/sda2
确认LV剩余情况
[root@rhel6 ~]# lvscan
[root@rhel6 ~]# df -lh
Îļþϵͳ
/dev/mapper/vg_rhel6-LogVol00
tmpfs
/dev/sda1
/dev/mapper/vg_rhel6-LogVol01
/dev/mapper/vg_rhel6-LogVol02
/dev/mapper/vg_rhel6-LogVol03
扩LV容量,增加100G (+100G,如果是指定空间变化为100G,则不需要加号)
[root@rhel6 vg_rhel6]# lvextend -L +100G /dev/vg_rhel6/LogVol01
[root@rhel6 vg_rhel6]# lvscan
但查看挂载情况, /HOME 容量并未提升
[root@rhel6 dev]# df -lh
Îļþϵͳ
/dev/mapper/vg_rhel6-LogVol00
tmpfs
/dev/sda1
/dev/mapper/vg_rhel6-LogVol01
/dev/mapper/vg_rhel6-LogVol02
/dev/mapper/vg_rhel6-LogVol03
刷新文件系统大小
[root@rhel6 dev]# resize2fs -f /dev/vg_rhel6/LogVol01
resize2fs 1.41.12 (17-May-2010)
Filesystem at /dev/vg_rhel6/LogVol01 is mounted on /home; on-line resizing required
old desc_blocks = 4, new_desc_blocks = 10
Performing an on-line resize of /dev/vg_rhel6/LogVol01 to 39014400 (4k) blocks.
The filesystem on /dev/vg_rhel6/LogVol01 is now 39014400 blocks long.
文件系统大小已改变
[root@rhel6 dev]# mount
/dev/mapper/vg_rhel6-LogVol00 on / type ext4 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
tmpfs on /dev/shm type tmpfs (rw,rootcontext="system_u:object_r:tmpfs_t:s0")
/dev/sda1 on /boot type ext4 (rw)
/dev/mapper/vg_rhel6-LogVol02 on /tmp type ext4 (rw)
/dev/mapper/vg_rhel6-LogVol03 on /usr type ext4 (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
nfsd on /proc/fs/nfsd type nfsd (rw)
[root@rhel6 dev]# df -lh
Îļþϵͳ
/dev/mapper/vg_rhel6-LogVol00
tmpfs
/dev/sda1
/dev/mapper/vg_rhel6-LogVol02
/dev/mapper/vg_rhel6-LogVol03
[root@rhel6 dev]# lvextend [root@rhel6 ~]# lvscan
问题:我在未UMOUNT的情况下进行的操作,但结果正常。不UMOUNT是否有负面影响或风险?