以下圖。html
增長完後會有提示 「磁盤已成功擴展。您必須從客戶機操做系統內部對磁盤從新進行分區和擴展文件系統。是繼續完成如下步驟纔算成功。
centos
# df -h
# fdisk /dev/sda
照着紅色部分輸入,按回車。服務器
The number of cylinders for this disk isset to 7832.There is nothing wrong with that, but thisis larger than 1024,app
and could in certain setups cause problemswith:this
1) software that runs at boot time (e.g.,old versions of LILO)spa
2) booting and partitioning software fromother OSs操作系統
(e.g., DOS FDISK, OS/2 FDISK)code
Command (m for help): n 說明:新增分區htm
Command actionblog
e extended
p primarypartition (1-4)
p
Partition number (1-4): 3 說明:新增分區號(1,2默認已經用了)
First cylinder (2611-7832, default 2611): 默認回車(最小)
Using default value 2611
Last cylinder or +size or +sizeM or +sizeK(2611-7832, default 7832):默認回車(最大)
Using default value 7832
Command (m for help): t 說明:修改分區類型
Partition number (1-4): 3 說明:修改分區類型對應的分區號
Hex code (type L to list codes): 8e 說明:8e是lvm磁盤類型
Changed system type of partition 3 to 8e(Linux LVM)
Command (m for help): p 說明:打印分區表
Disk /dev/sda: 64.4 GB, 64424509440 bytes
255 heads, 63 sectors/track, 7832 cylinders
Units = cylinders of 16065 * 512 = 8225280bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 2610 20860402+ 8e Linux LVM
/dev/sda3 2611 7832 41945715 8e Linux LVM
Command (m for help): w 說明:保存退出
The partition table has been altered!
# reboot
# fdisk -l
# df -T /dev/sda1 說明:查看當前的主分區類型
# mkfs.ext4 /dev/sda3 說明:ext4爲你查看到的文件系統類型(ext二、ext三、ext4等)
# pvcreate /dev/sda3
查看pv狀態
# pvdisplay
查看vg狀態
# vgdisplay
# vgextend vg_centos /dev/sda3 說明 vg_centos是個人服務器vg名稱,請經過查看vg狀態獲得名稱VG name
# lvdisplay
# lvextend -l +2559 /dev/VolGroup00/LogVol00
說明:2559爲上面pvdisplay查看到的free的PE數量
若是剛纔看到是0,要用命令pvdisplay再看一下
# resize2fs/dev/mapper/VolGroup00-LogVol00