VMディスクLVMの調整
1990 ワード
1. ( )
#df -h
2. ( , )
#fdisk /dev/sda
The number of cylinders for this disk is set to 7832.
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)
Command (m for help): n :
Command action
e extended
p primary partition (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 = 8225280 bytes
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!
3.
#reboot
4. ( )
#fdisk -l
5.
#df -T /dev/sda1 :
6.
#mkfs.ext4 /dev/sda3 :ext4 (ext2、ext3、ext4 )
7. PV(pv vg,vg lv)
#pvcreate /dev/sda3
pv
#pvdisplay
vg
#vgdisplay
8. PV VG
#vgextend vg_centos /dev/sda3 :vg_centos vg , vg VG name
9. LV , VG LV
#lvdisplay
10.lvextend -l +2559 /dev/VolGroup00/LogVol00 :2559 pvdisplay free PE
11. resize2fs
resize2fs /dev/mapper/VolGroup00-LogVol00
VolGroup00-LogVol00