[root@*****~]# fdisk /dev/sda
The number of cylinders for this disk is set to 39162.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)
#
输入
n
,新建分区
Command (m for help):
n
#
输入
P
,主分区
Command action
e extended
p primary partition (1-4)
p
#
目前是
sda
第三个分区输入
3
Partition number (1-4):
3
#
敲回车,默认就行了(如果要分多个分区,这儿就制定数值)
First cylinder (39163-110960, default 39163):
Using default value 39163
Last cylinder or +size or +sizeM or +sizeK (39163-110960, default 110960):
Using default value 110960
#
这里输入
t
Command (m for help):
t
#
这里选择第三个分区
Partition number (1-4):
3
#
指定分区的格式为8e (LVM)
Hex code (type L to list codes):
8e
Changed system type of partition 3 to 8e (Linux LVM)
#
输入
p
查看一下
Command (m for help):
p
Disk /dev/sda: 912.6 GB, 912680550400 bytes
255 heads, 63 sectors/track, 110960 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 39162 314464342+ 8e Linux LVM
/dev/sda3 39163 110960 576717435 8e Linux LVM
#
这里输入w,保存退出
Command (m for help):
w
The partition table has been altered!
Calling ioctl() to re-read partition table.
WARNING: Re-reading the partition table failed with error 16: (
这里有个小报错,不用管它
).
The kernel still uses the old table.
The new table will be used at the next reboot.
Syncing disks.
#
重启使其生效
[root@***** ~]# reboot
Broadcast message from root (pts/1) (Tue May 15 12:12:27 2012):
The system is going down for reboot NOW!
[root@***** ~]#
|
1.
查看卷组情况,可以看到只有一个卷组
VolGroup00
(此名称因系统而异)
;
[root@*****~]# vgs
/dev/hdc: open failed:
找不到介质
VG #PV #LV #SN Attr VSize VFree
VolGroup00 1 2 0 wz--n- 299.88G 0
2.
创建物理卷(
LVM
分区),并将物理卷加入到组里(
VolGroup00
);
[root@*****~]# lvm
lvm>pvcreate /dev/sda3 ##
创建一个
LVM
硬分区
Physical volume "/dev/sda3" successfully created lvm> vgextend VolGroup00 /dev/sda3 ## 加入与 / 目录同一个 LVM 组 Volume group "VolGroup00" successfully extended
(如果没有格式化就会报如下错误:
lvm> pvcreate /dev/sda3
Can't open /dev/sda3 exclusively. Mounted filesystem? [root@*****~]# mkfs.ext3 /dev/sda3 ## 没有成功是因为没有格式化,要与 / 目录格式一样。) 查看一下:可以看到 sda3 有 500G 的空间可以扩充使用;
2.
挂载到“
/
”根目录下,
将卷组下的卷
LogVol00
扩容
500G
(增加容量的关键);
3.
重新识别磁盘容量;
[root@*****~]#
resize2fs /dev/VolGroup00/LogVol00
4.
查看最终结果:
|