Linux adds new disks, expands space online

Source: Internet
Author: User

The home directory space in the CentOS 7 development environment is full and requires additional space

    1. Perform "ls/sys/class/scsi_host" on the virtual machine, and then rescan the SCSI bus to add the device. As pictured on the right. Then execute "fdsik-l" to verify that the addition was successful.

    2. Use FDISK to partition the newly added hard disk. As shown on the right

      Then because of the logical volume, so the disk file system needs to be Linux LVM, if the P option to see the ID is not 8e, enter T, and then prompt for hex code, enter 8e on the line. Then enter P to view, if correct, the direct input w save on the line.

    3. Once you have created a partition, you need to create a physical volume. Execute the command pvcreate/dev/sdb1 Create the physical volume on the partition/DEV/SDB1. Then execute the command PVs to view the current physical volume, and of course it can be viewed with the Pvdisplay command.
    4. Execute command LVS View the volume group name that the home/home directory belongs to, and then add the newly created physical volume/DEV/SDB1 to the volume group to execute the command vgextend centos/dev/sdb1. Then execute VGS to see if the size of the volume group changes, i.e. whether the physical volume was added successfully.
    5. Expand the logical volume where home/home resides, execute command lvextend--resize-l +60g/dev/centos/home Increase the logical volume/dev/centos/home by 60G. Then execute df-lh to see if the/home directory space is increasing.

Linux adds new disks, expands space online

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.