手机版
你好,游客 登录 注册
背景:
阅读新闻

Linux逻辑卷管理LVM

[日期:2013-03-25] 来源:Linux社区  作者:missedyou [字体:大 中 小]
  • 格式化逻辑卷,创建文件系统
  1. [root@rhel5 ~]# mkfs.ext3 /dev/iscsi/sharedisk
  2. mke2fs 1.39 (29-May-2006)
  3. Filesystem label=
  4. OS type: Linux
  5. Block size=4096 (log=2)
  6. Fragment size=4096 (log=2)
  7. 262144 inodes, 524288 blocks
  8. 26214 blocks (5.00%) reserved for the super user
  9. First data block=0
  10. Maximum filesystem blocks=536870912
  11. 16 block groups
  12. 32768 blocks per group, 32768 fragments per group
  13. 16384 inodes per group
  14. Superblock backups stored on blocks:
  15. 32768, 98304, 163840, 229376, 294912
  16. Writing inode tables: done
  17. Creating journal (16384 blocks): done
  18. Writing superblocks and filesystem accounting information: done
  19. This filesystem will be automatically checked every 38 mounts or
  20. 180 days, whichever comes first. Use tune2fs -c or -i to override.
  21. [root@rhel5 ~]# tune2fs -c 0 -i 0 /dev/iscsi/sharedisk
  22. tune2fs 1.39 (29-May-2006)
  23. Setting maximal mount countto -1
  24. Setting interval between checks to 0 seconds
  25. [root@rhel5 ~]#mkdir /data
  26. [root@rhel5 ~]# mount /dev/iscsi/sharedisk /data/
  27. [root@rhel5 ~]# df -h
  28. 文件系统 容量 已用 可用 已用% 挂载点
  29. /dev/mapper/rootvg-rootlv 9.7G 7.6G 1.7G 83% /
  30. /dev/sda1 99M 14M 80M 15% /boot
  31. tmpfs 322M 0 322M 0% /dev/shm
  32. /dev/mapper/iscsi-sharedisk 2.0G 68M 1.9G 4% /data

================================================================================

  • 添加新的PV到VG
  1. 紧接着上面的讲解实例,通过fdisk新建一个磁盘分区,对应的分区为/dev/sda6,现在要把新增的硬盘分区加入到卷组iscsi,操作如下:
  2. [root@rhel5 ~]# vgdisplay iscsi | grep -i free //首先检查iscsi卷组中的空闲空间
  3. Free PE / Size 686 / 2.68 GB
  4. [root@rhel5 ~]# pvcreate /dev/sda6 //先将/dev/sda6转换为物理卷
  5. Physical volume "/dev/sda6" successfully created
  6. [root@rhel5 ~]# vgextend iscsi /dev/sda6 //将新增物理卷添加到卷组iscsi中
  7. Volume group"iscsi" successfully extended
  8. [root@rhel5 ~]# vgdisplay iscsi | grep -i free //此时剩余卷组空间还有4.55G,刚好是新增物理卷的大小
  9. Free PE / Size 1164 / 4.55 GB
linux
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款