- 格式化逻辑卷,创建文件系统
- [root@rhel5 ~]# mkfs.ext3 /dev/iscsi/sharedisk
- mke2fs 1.39 (29-May-2006)
- Filesystem label=
- OS type: Linux
- Block size=4096 (log=2)
- Fragment size=4096 (log=2)
- 262144 inodes, 524288 blocks
- 26214 blocks (5.00%) reserved for the super user
- First data block=0
- Maximum filesystem blocks=536870912
- 16 block groups
- 32768 blocks per group, 32768 fragments per group
- 16384 inodes per group
- Superblock backups stored on blocks:
- 32768, 98304, 163840, 229376, 294912
- Writing inode tables: done
- Creating journal (16384 blocks): done
- Writing superblocks and filesystem accounting information: done
- This filesystem will be automatically checked every 38 mounts or
- 180 days, whichever comes first. Use tune2fs -c or -i to override.
- [root@rhel5 ~]# tune2fs -c 0 -i 0 /dev/iscsi/sharedisk
- tune2fs 1.39 (29-May-2006)
- Setting maximal mount countto -1
- Setting interval between checks to 0 seconds
- [root@rhel5 ~]#mkdir /data
- [root@rhel5 ~]# mount /dev/iscsi/sharedisk /data/
- [root@rhel5 ~]# df -h
- 文件系统 容量 已用 可用 已用% 挂载点
- /dev/mapper/rootvg-rootlv 9.7G 7.6G 1.7G 83% /
- /dev/sda1 99M 14M 80M 15% /boot
- tmpfs 322M 0 322M 0% /dev/shm
- /dev/mapper/iscsi-sharedisk 2.0G 68M 1.9G 4% /data
================================================================================
- 添加新的PV到VG
- 紧接着上面的讲解实例,通过fdisk新建一个磁盘分区,对应的分区为/dev/sda6,现在要把新增的硬盘分区加入到卷组iscsi,操作如下:
- [root@rhel5 ~]# vgdisplay iscsi | grep -i free //首先检查iscsi卷组中的空闲空间
- Free PE / Size 686 / 2.68 GB
- [root@rhel5 ~]# pvcreate /dev/sda6 //先将/dev/sda6转换为物理卷
- Physical volume "/dev/sda6" successfully created
- [root@rhel5 ~]# vgextend iscsi /dev/sda6 //将新增物理卷添加到卷组iscsi中
- Volume group"iscsi" successfully extended
- [root@rhel5 ~]# vgdisplay iscsi | grep -i free //此时剩余卷组空间还有4.55G,刚好是新增物理卷的大小
- Free PE / Size 1164 / 4.55 GB
