LVM Experimental Steps!

Source: Internet
Author: User

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!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.