背景:开发服务器是虚拟机,原来只规划了2G,后来发现硬盘不够用了,需要进行扩容。
文章说必须基于LVM,命令检验一下。据说centos默认安装也是LVM的。
[sss@localhost ~]$lvdisplay
--- Logical volume ---
LV Path /dev/vg_vm/lv_root
LV Name lv_root
VG Name vg_vm
LV UUID bWyLlY-hYra-7hPc-2eU9-tXMH-FJFa-7ZLDoF
LV Write Access read/write
LV Creation host, time vm.sss, 2015-01-05 03:29:55 +0800
LV Status available
# open 1
LV Size 6.71 GiB
Current LE 1718
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:0
--- Logical volume ---
LV Path /dev/vg_vm/lv_swap
LV Name lv_swap
VG Name vg_vm
LV UUID oLj3cQ-USD7-JIGZ-HMJz-NlmA-aQf6-lECYyC
LV Write Access read/write
LV Creation host, time vm.sss, 2015-01-05 03:29:56 +0800
LV Status available
# open 1
LV Size 816.00 MiB
Current LE 204
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:1
[sss@localhost ~]$sudo fdisk -l
Disk /dev/sda: 32.2 GB, 32212254720 bytes
255 heads, 63 sectors/track, 3916 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: 0x00036057
Device Boot Start End Blocks Id System
/dev/sda1 * 1 64 512000 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2 64 1045 7875584 8e Linux LVM
Disk /dev/mapper/vg_vm-lv_root: 7205 MB, 7205814272 b