• Bare Metal Server

bms
  1. Help Center
  2. Bare Metal Server
  3. Private Image Creation Guide (BMS)
  4. Creating a Linux Image
  5. Configuring the Root Partition to Automatically Expand Disk Capacity
  6. CentOS 6 and Red Hat 6

CentOS 6 and Red Hat 6

NOTE:

For CentOS 6 and Red Hat 6, you must install three packages to enable the root partition to automatically expand disk capacity: Cloud-Init, cloud-utils-growpart, and dracut-modules-growroot. Cloud-Init has been installed in section Installing Cloud-Init.

This section uses CentOS 6.9 as an example to describe how to install the packages. The procedure also applies to other OSs.

  1. Check whether Cloud-Init, cloud-utils-growpart, and dracut-modules-growroot are installed. If not, perform subsequent operations in this section to install them.
    [root@localhost ~]# rpm -qa | grep cloud-init
    cloud-init-0.7.5-10.el6.centos.2.x86_64
    [root@localhost ~]# rpm -qa | grep growpart
    [root@localhost ~]# rpm -qa | grep growroot
    [root@localhost ~]#
  2. Download the cloud-utils-growpart package from https://dl.fedoraproject.org/pub/epel/6Server/x86_64/Packages/c/. Then upload it to the VM by following the instructions in chapter 11.
  3. Run the following command to install the cloud-utils-growpart package:

    rpm -ivh cloud-utils-growpart-0.27-10.el6.x86_64.rpm

    [root@localhost redhat]# rpm -ivh cloud-utils-growpart-0.27-10.el6.x86_64.rpm
    Preparing...                 ############################### [100%]
       1:cloud-utils-growpart    ############################### [100%]
    [root@localhost redhat]#
  4. Install the dracut-modules-growroot package.
    1. Run the following command:

      yum install -y http://dl.Fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm

    2. Run the yum install dracut-modules-growroot command to install the dracut-modules-growroot package online.

      If message Is this ok [y/N] is displayed, enter y.

    3. After the installation is successful, run the dracut -f command to update the kernel.
  5. Run the commands in step 1 to check whether Cloud-Init, cloud-utils-growpart, and dracut-modules-growroot have been installed successfully.