LVM Test Requirements:
The company's mail server due to the number of users, mail storage needs a lot of space, considering the need for dynamic expansion,
Plan to add two SCSI drives (each 20G) and build LVM logical volumes to mount to the "/mailbox" directory dedicated to storing mail data
--------------------------------------------------------------------------------------
Step One:
1. Convert physical volumes
Use the FDISK command to plan two partitions with type set to "8e"
/DEV/SDB1,/DEV/SDC1
Use the Pvcreate command to convert the above partition to a physical volume
[[email protected] ~]# fdisk-l//view hard drive condition
[[email protected] ~]# FDISK/DEV/SDB//partition hard disk is 8e logical volume type
N P 1 T 8e
[[email protected] ~]# FDISK/DEV/SDC//partition hard disk is 8e logical volume type
[Email protected] ~]# fdisk-l
[Email protected] ~]# PVCREATE/DEV/SDB1/DEV/SDC1
-------------------------------------------------------------------------
Step Two:
2. Create a volume group
Create a volume group using the Vgcreate command Mail_store
Physical volumes included:/DEC/SDB1,/DEV/SDC1
[Email protected] ~]# vgcreate MAIL_STORE/DEV/SDB1/DEV/SDC1
[Email protected] ~]# Vgdisplay
--------------------------------------------------------------------------
Step Three:
3. Creating a Logical Volume
Use the Lvcreate command to create a logical volume mail
20GB space from the volume group Mail_store
To create a ext3 file system using the MKFS command
[Email protected] ~]# lvcreate-l 20g-n Mail Mail_store
[Email protected] ~]# lvcreate-l 20g-n Mail Mail_store
[Email protected] ~]# mkfs-t Ext3/dev/mail_store/mail
[Email protected] ~]# Lvdisplay
--------------------------------------------------------------------
Fourth Step:
Capacity expansion for logical volumes
To expand capacity for logical volume mail using the Lvextend command
10GB to logical volume from volume group Mail_store
Update system-recognized file system size using the RESIZE2FS command
[Email protected] ~]# lvextend-l +10g/dev/mail_store/mail
[Email protected] ~]# Resize2fs/dev/mail_store/mail
[Email protected] ~]# Lvdisplay
-------------------------------------------------------------------------
Fifth Step:
Create the mount point directory/mailbox and mount the/dev/mail_store/mail to the/mailbox directory
[Email protected] ~]# Mkdir/mailbox
[Email protected] ~]# mount/dev/mail_store/mail/mailbox/
[Email protected] ~]# DF-HT
[Email protected] ~]# Vi/etc/fstab
/dev/mail_store/mail/mailbox ext3 Defaults 1 2
[Email protected] ~]# umount-a
[Email protected] ~]# mount-a
[email protected] ~]# mount
[Email protected] ~]# DF-HT
This article is from the "Small Zheng Technology Blog" blog, please be sure to keep this source http://ko178.blog.51cto.com/220419/1639993
LVM Experimental Steps!