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

RAID阵列与LVM逻辑卷组

[日期:2013-01-22] 来源:Linux社区  作者:liuyatao666 [字体:大 中 小]
11.将/dev/sde1加入到物理卷中
 
[root@lyt ~]# pvcreate /dev/sde1
 
  Physical volume "/dev/sde1" successfully created
 
12.将扩展卷组
 
[root@lyt ~]# vgextend vgtest /dev/sde1
 
  /dev/cdrom: open failed: Read-only file system
 
  Attempt to close device '/dev/cdrom' which is not open.
 
  Volume group "vgtest" successfully extended
 
13.扩展逻辑卷lvtest的大小(有2中方法)
 
(1)将逻辑卷/dev/vgtest/lvtest的大小扩展为1500M
 
[root@lyt ~]# lvextend -L 1500M /dev/vgtest/lvtest   
 
  Extending logical volume lvtest to 1.46 GB
 
  Logical volume lvtest successfully resized
 
(2)将逻辑卷/dev/vgtest/lvtest的大小增加12M
 
[root@lyt ~]# lvextend -L+12M /dev/vgtest/lvtest
 
  Extending logical volume lvtest to 1.48 GB
 
  Logical volume lvtest successfully resized
 14.重新读取逻辑卷大小
 
[root@lyt ~]# resize2fs /dev/vgtest/lvtest
 
resize2fs 1.39 (29-May-2006)
 
Filesystem at /dev/vgtest/lvtest is mounted on /lvdate; on-line resizing required
 
Performing an on-line resize of /dev/vgtest/lvtest to 387072 (4k) blocks.
 
The filesystem on /dev/vgtest/lvtest is now 387072 blocks long.
 
15.减小逻辑卷大小(有2种方法)
 
[root@lyt ~]# umount /dev/vgtest/lvtest    #首先卸载逻辑卷
 
(1)将逻辑卷的大小减小到1500M
 
[root@lyt ~]# lvreduce -L 1500M /dev/vgtest/lvtest  #将逻辑卷减小到1500M
 
  WARNING: Reducing active logical volume to 1.46 GB
 
  THIS MAY DESTROY YOUR DATA (filesystem etc.)
 
Do you really want to reduce lvtest? [y/n]: y
 
  Reducing logical volume lvtest to 1.46 GB
 
  Logical volume lvtest successfully resized
 (2)将逻辑卷的大小减小100M
 
[root@lyt ~]# lvreduce -L-100M /dev/vgtest/lvtest
 
  WARNING: Reducing active logical volume to 1.37 GB
 
  THIS MAY DESTROY YOUR DATA (filesystem etc.)
 
Do you really want to reduce lvtest? [y/n]: y
 
  Reducing logical volume lvtest to 1.37 GB
 
  Logical volume lvtest successfully resized
 
16.清除逻辑卷(逻辑卷必须卸载后才能清除)
 
[root@lyt ~]# lvremove /dev/vgtest/lvtest
 
Do you really want to remove active logical volume lvtest? [y/n]: y
 
  Logical volume "lvtest" successfully removed
 
17.清除卷组
 
[root@lyt ~]# vgremove /dev/vgtest
 
  /dev/cdrom: open failed: Read-only file system
 
  Attempt to close device '/dev/cdrom' which is not open.
 
  Volume group "vgtest" successfully removed
 18.清除物理卷
 
[root@lyt ~]# pvremove /dev/sd*    #将物理卷全部清除
 
  Physical Volume /dev/sda not found
 
  No physical volume label read from /dev/sda1
 
  Physical Volume /dev/sda1 not found
 
  /dev/cdrom: open failed: Read-only file system
 
  Attempt to close device '/dev/cdrom' which is not open.
 
  Can't pvremove physical volume "/dev/sda2" of volume group "VolGroup00" without -ff
 
  Physical Volume /dev/sdb not found
 
  /dev/cdrom: open failed: Read-only file system
 
  Attempt to close device '/dev/cdrom' which is not open.
 
  Labels on physical volume "/dev/sdb1" successfully wiped
 
  /dev/cdrom: open failed: Read-only file system
 
  Attempt to close device '/dev/cdrom' which is not open.
 
  Labels on physical volume "/dev/sdb2" successfully wiped
 
  Physical Volume /dev/sdc not found
 
  /dev/cdrom: open failed: Read-only file system
 
  Attempt to close device '/dev/cdrom' which is not open.
 
  Labels on physical volume "/dev/sdc1" successfully wiped
 
  /dev/cdrom: open failed: Read-only file system
 
  Attempt to close device '/dev/cdrom' which is not open.
 
  Labels on physical volume "/dev/sdc2" successfully wiped
 
  Physical Volume /dev/sdd not found
 
  /dev/cdrom: open failed: Read-only file system
 
  Attempt to close device '/dev/cdrom' which is not open.
 
  Labels on physical volume "/dev/sdd1" successfully wiped
 
  /dev/cdrom: open failed: Read-only file system
 
  Attempt to close device '/dev/cdrom' which is not open.
 
  Labels on physical volume "/dev/sdd2" successfully wiped
 
  Physical Volume /dev/sde not found
 
  /dev/cdrom: open failed: Read-only file system
 
  Attempt to close device '/dev/cdrom' which is not open.
 
  Labels on physical volume "/dev/sde1" successfully wiped
 
19.浏览物理卷、卷组和逻辑卷的命令分别有:
 
pvscan和pvdisplay、vgscan和vgdisplay、lvscan和lvdisplaylinux
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

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