分类: LINUX
2009-07-07 09:36:26
linux下的LVM实验
环境:vmware + rhel5.3
1. 添加5块硬盘
#fdisk -l | grep dev //能看到5块新的硬盘
Disk /dev/sdb: 2147 MB, 2147483648 bytes
Disk /dev/sdc: 2147 MB, 2147483648 bytes
Disk /dev/sdd: 2147 MB, 2147483648 bytes
Disk /dev/sde: 2147 MB, 2147483648 bytes
Disk /dev/sdf: 2147 MB, 2147483648 bytes
2. 格式化5块硬盘,把分区的system id设成8e
# fdisk /dev/sdb1
n -> p -> 1
t -> 8e
w
3. 创建PV
# pvcreate /dev/sdb1 /dev/sdc1 /dev/sdd1 /dev/sde1 /dev/sdf1
4. 查看PV
# pvdisplay
5. 创建VG(gmmvg:包含/dev/sdb1 /dev/sdc1 /dev/sdd1)
# vgcreate gmmvg /dev/sdb1 /dev/sdc1 /dev/sdd1
6. 查看VG
# vgdisplay
7. 创建LV
# lvcreate -L 1G -n gmmlv01 gmmvg
8. 创建文件系统
# mkfs.ext3 /dev/gmmvg/gmmlv01
9. 挂载
# mkdir /gmmdir01
# mount /dev/mount /dev/gmmvg/gmmlv01 /gmmdir01
# df -h
/dev/mapper/gmmvg-gmmlv01 1008M 34M 924M 4% /gmmdir01
问:为什么是mapper?mapper是什么?
10. 扩展VG (把/dev/sde1添加到gmmvg中)
# vgextend gmmvg /dev/sde1
# vgdisplay gmmvg