Add space to the root partition and create logical volumes on VMware

Source: Internet
Author: User

1, in VMware add space to the root partition

509 cd/sys/class/scsi_host/ See if the added drive information is in the system

521 echo "---" >/sys/class/scsi_host/host0/scan loading hard disk information

522 echo "---" >/sys/class/scsi_host/host1/scan

523 echo "---" >/sys/class/scsi_host/host2/scan

524 ls/dev/sd* To see if the information was loaded successfully

525 PVCREATE/DEV/SDC Create a physical volume

526 Vgextend VG_CCMSDZHKJR/DEV/SDC to add a physical volume to a volume group

529 Lvresize-r-L +100%FREE/DEV/VG_CCMSDZHKJR-LOGVOL00/DEV/SDC Add all the space of SDC, the new drive, to the root partition logical volume

/dev/vg_ccmsdzhkjr-logvol00 is the path to the root partition

535 DF-

2. Add the remaining space on the same disk to the root partition

By using VGS to see that there is still 348G of space left unused

[Email protected] ~]# VGS

VG #PV #LV #SN Attr vsize vfree

VolGroup 1 2 0 wz--n-465.27g 348.08g

Lvextend-l +348g/dev/mapper/volgroup-logvol01 Add the remaining hard disk block to the root partition,/DEV/MAPPER/VOLGROUP-LOGVOL01 is the name of the root partition

RESIZE2FS/DEV/MAPPER/VOLGROUP-LOGVOL01 & Assigning a file system to the root partition

Next, use Df-h to see the space of the root partition slowly increasing.

3. Create a logical volume on a physical machine or on Xen

XM Block-attach 188077-chenyi file://vdisk/19066-b.img xvdb w This command should be executed when the new drive does not take effect

Create a logical volume for a new hard disk partition

echo "scsi add-single-device 0 0 2 0" >/PROC/SCSI/SCSI load the hard drive you just added

0 0 2 0 Here the 2 represents the new drive letter

Pvcreate/dev/sdb Creating a physical volume

Vgextend Vg_ccmsdzhkjr/dev/sdb to add a physical volume to a volume group

If you are joining a new volume group, you can use the Vgcreate vg0 New Volume group name/dev/sdb the physical volume name

Lvcreate to create a logical volume command:

Format 1: lvcreate-l +100%free - n lv_data vg_data

-L +100%free: Sets the size of the logical volume to the remaining space of the hard disk

-L 512M: Sets the size of the logical volume to 512M.

-N Lv_data: Sets the logical volume's name as Lv_data; notation:/dev/Volume Group name/data

vg_data: The name of the volume group, which is the name of the volume group to be added.

After creating the logical disk, format the , /dev/maaper below

MKFS.EXT4/DEV/MAAPER/LV volume name -VG volume name

after formatting is mounted to the directory ,

when it is mounted.

MOUNT/DEV/MAAPER/LV volume name -VG volume name /vdisk/disk1 mount directory

If you need to add a disk to a hard disk file system to a virtual machine, you can use the following command

DD If=/dev/zero of=/vdisk/vmtest1-1.img bs=1g count=0 seek=50 represents the creation of a mirrored file with a capacity of 50G

SEEK=50 Representative 50G

BS=1G represents G as Unit

DD If=/dev/zero of=/vdisk/187058-02.img count=50 seek=0 bs=1g representative writes a 50G file

4. Add system disk capacity to XFS file system in Centos7

Xfs_growfs/dev/mapper/centos-root

Add space to the root partition and create logical volumes on 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.