Creating a logical volume in a Linux system in VMware

Source: Internet
Author: User

1, with Poweroff will be virtual machine.

2. Add 4 1G HDD to the Linux virtual machine. Lsblk can be viewed after booting. Fdisk-l can also.

3, open the Linux virtual machine, 4 1G of hard disk to do LVM logical volume management.

The steps are as follows:

A: Use all remaining space by dividing the SDB, SDC, SDD, and SDE into a primary partition.

View all hard disk block devices with LSBLK

B: Create a SDB1, SDC1, SDD1 partition as a volume group named Vg0.

C: Add Sde1 to the VG0 volume group, and then remove SDC1 from the VG0 volume group.

D: Create a logical volume with a capacity of 2G with a name of Lv_data in the VG0 volume group.

E: Extend the lv_data logical volume capacity to 2.5G.

F: Format the Lv_data and mount it manually to the/data directory.

G: Copy the/etc/host* file to the/data directory.

LVM Implementation Reference:

Lsblk

FDISK/DEV/SDB-->n--->p--->1---> return 2 under-->W//Create Primary partition

PVCREATE/DEV/SD[B-E]1//Create physical volume

PVs

Vgcreate vg0/dev/sd[b-d]1//Create Volume group

Vgextend vg0/dev/sde1//Extended VG0 Volume Group capacity

Vgreduce VG0/DEV/SDC1//delete a piece of partition from VG0, note: Vgremove is deleting the entire volume group

VGs

Lvcreate-l 2g-n lv_data vg0//Create Logical Volume-l specify Logical Volume Size-n Specify Logical volume name

Lvextend-l +0.5g/dev/vg0/lv_data//expansion

Mkfs.ext4/dev/vg0/lv_data//Format ha, that is, create file system

Mkdir/data

Mount/dev/vg0/lv_data/data//Manually mount to the specified directory

Cp-v/etc/host*/data//Copy data

Ls/data


This article from "DANIEPDD" blog, declined reprint!

Creating a logical volume in a Linux system in VMware

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.