[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和lvdisplay
