To do this experiment, you need to add a new hard disk, and then you can use the hard disk to test how to install and use lvm. For details about how to add a hard disk to vmware, Refer to Appendix 1. prepare a physical hard disk and partition 1. cfdisk/dev/sdb2. make the hard disk into an extended partition, and write the partition table 3. use fdisk-l to view the hard disk. II. install and
To do this experiment, you need to add a new hard disk, and then you can use the hard disk to test how to install and use lvm. For details about how to add a hard disk to vmware, refer to the appendix.
I. prepare physical hard disks and partitions
1. cfdisk/dev/sdb
2. make the hard disk into an extended partition and write the partition table.
3. use fdisk-l to view the hard disk.
II. install and configure lvm
1. aptitude lvm2
2. initialize the physical volume
# Pvcreate/dev/sdb5
3. create a volume Group
# Vgcreate volgrp/dev/sdb5
4. activate the volume Group
# Vgscan
5. create a logical volume
# Lvcreate-n software -- size 500 M volgrp
6. Format and mount the logical volume
# Mkfs. ext3/dev/volgrp/software
# Mkdir/home/software
# Mount-t ext3/dev/volgrp/software/home/software
7. View logical volumes
# Lvdisplay
8. change the logical volume size.
# Umount/home/software
# Lvextended-L + 500 M/dev/volgrp/software
After the change, you can see that the size has changed in lvdisplay, but the actual file system is still 500 M, so you still need to do the following operations
9. change the physical volume size
# E2fsck-f/dev/volgrp/software
# Resize2fs/dev/volgrp/software
10. mount the logical volume again.
# Mount-t ext3/dev/volgrp/software/home/software
# Df-h
Use df-h to view the partition size.
11. remove logical volumes
# Lvremove/dev/volgrp/software
Premise: umount the logical volume first