Skip to main content

We've Moved!

Product Documentation has moved to docs.hitachivantara.com
Hitachi Vantara Knowledge

Upgrading hard disk drive resources

Perform the following steps to upgrade the hard disk drive (HDD) resources on a VM.

Procedure

  1. Back up the home directory. Enter:

    tar -czvf /root/home.tgz -C /home
  2. Verify the contents of the backup directory. Enter:

    tar -tvf /root/home.tgz
  3. Unmount the home directory. Enter:

    umount /dev/mapper/centos-home
  4. Remove the logical volume for the home directory. Enter:

    lvremove /dev/mapper/centos-home
  5. Create a new 50 GB logical volume for the home directory. Enter:

    lvcreate -L 50GB -n home centos
  6. Format the home directory. Enter:

    mkfs.xfs /dev/centos/home
  7. Remount the home directory. Enter:

    mount /dev/mapper/centos-home
  8. Extend the root directory volume to the remaining space, and then resize the file system. Enter:

    lvextend -r -l +100%FREE /dev/mapper/centos-root
  9. Restore the backed-up contents of the home directory. Enter:

    tar -xzvf /root/home.tgz -C /home
  10. Synchronize the changes. Enter:

    dracut --regenerate-all --force
  11. Display the existing disk space. Enter:

    lsblk
    Display existing disk space
  12. Increase the disk space so that the total disk space is 400 GB. For example, if the existing disk space is 337 GB, then you must increase the disk space by 63 GB.

  13. Log on to vSphere Client, right-click the VM, and then select Edit Settings. Add new hard disk

  14. Click ADD NEW DEVICE, and then Hard Disk.

  15. For New Hard disk, enter the amount the disk space is to be increased, and then click OK. For example, 70 GB.Specify the disk space for the new hard disk

  16. Verify the newly added hard disk. Enter:

    lsblk
    Verify the newly added hard disk
  17. Create a primary partition for the newly added hard disk. Enter:

    fdisk /dev/sdb
    Select the following options:
    1. n for new disk
    2. p for primary partition
    3. 1 for number of partitions
    4. default to set the first sector as default
    5. default to set the last sector as default
    6. w to save the configuration and exit
    Create a primary partition
  18. Verify if the disk partition was successful. Enter:

    lsblk
    Verify the disk space after partition
  19. Create a physical drive in the logical volume. Enter:

    pvcreate /dev/sdb1
  20. Extend the logical volume for the root directory. Enter:

    vgextend centos /dev/sdb1
    Extend the logical volume
  21. Verify the logical volume configuration changes. Enter the following commands:

    pvs
    vgs
    lvs
    df -h
    where:
    • pvs is to verify the physical drive.
    • vgs is to verify the updated volume group size.
    • lvs is to verify the logical volume size.
    • df -h is to verify the updated root file system size.
    Verify the logical volume configuration

 

  • Was this article helpful?