Rate This Document
Findability
Accuracy
Completeness
Readability

Installing the Bcache Module

You can use either the RPM package or the ISO image for installation.

Installing the RPM Package

  • If the kernel RPM package is used for installation, you need to install CentOS 7.6 or openEuler on the server in advance.
  • The RPM package used in this section is the package generated in Compiling the Kernel.
  1. Upload the kernel RPM package generated in Compiling the Kernel to the /home/kernel-rpm directory.
    1
    2
    mkdir -p /home/kernel-rpm
    cp /root/rpmbuild/RPMS/aarch64/* /home/kernel-rpm
    
  2. Install the kernel RPM package.
    • CentOS 7.6
      1
      2
      cd /home/kernel-rpm
      yum -y install kernel-4.14.0-115.10.1.el7a.aarch64.rpm kernel-devel-4.14.0-115.10.1.el7a.aarch64.rpm kernel-headers-4.14.0-115.10.1.el7a.aarch64.rpm
      
    • openEuler 20.03
      1
      2
      cd /home/kernel-rpm
      dnf -y install kernel-4.19.90-2003.4.0.0036.aarch64.rpm kernel-devel-4.19.90-2003.4.0.0036.aarch64.rpm
      
  3. Install the dependencies. (Perform this step only for openEuler 20.03. Skip this step for CentOS 7.6.)
    1
    yum install libblkid
    
  4. Check the default kernel startup item.
    1
    grub2-editenv list
    

    Check the default kernel version number.

    • If the default version is the newly installed kernel version, skip 5.
    • Otherwise, go to 5.
  5. Modify the default kernel startup item.
    • CentOS 7.6

      Check the kernels that can be configured in the current environment.

      cat /etc/grub2-efi.cfg  | grep CentOS

      Set the default boot kernel.

      grub2-set-default "CentOS Linux (4.14.0-115.10.1.el7a.aarch64) 7 (AltArch)"

      In the preceding command, CentOS Linux (4.14.0-115.10.1.el7a.aarch64) 7 (AltArch) indicates the newly installed kernel version.

    • openEuler 20.03

      Check the kernels that can be configured in the current environment.

      cat /etc/grub2-efi.cfg  | grep openEuler

      Set the default boot kernel.

      grub2-set-default "openEuler (4.19.90-2003.4.0.0036.aarch64) 20.03 (LTS)"

      In the preceding command, openEuler (4.19.90-2003.4.0.0036.aarch64) 20.03 (LTS) indicates the newly installed kernel version.

  6. Reboot the system.
    1
    reboot
    
  7. Verify the bcache module.
    1
    modinfo bcache
    

  8. Verify the page size.
    1
    getconf PAGESIZE
    

Installing the ISO Image

Before installing the ISO image, modify its kernel and add bcache-tools to it.

  1. Download the native image file and mount it to the local drive.
  2. Copy all files in the native image to the new directory.
    • CentOS 7.6
      1
      2
      3
      4
      mkdir -p /home/centos7.6-iso
      cd /home/centos7.6-iso
      cp -r /mnt/* ./
      cp /mnt/.discinfo /mnt/.treeinfo ./
      
    • openEuler 20.03
      1
      2
      3
      4
      mkdir -p /home/openEuler20.03-iso
      cd /home/openEuler20.03-iso
      cp -r /mnt/* ./
      cp /mnt/.discinfo /mnt/.treeinfo ./
      
  3. Replace the original kernel RPM package with the RPM package generated in Compiling the Kernel.
    1
    cp /root/rpmbuild/RPMS/aarch64/* ./Packages
    

    The extension name of the generated kernel RPM package is different from that of the original RPM package in the image. You need to manually delete the original RPM package. You can run the rm -f package_name command to delete the original RPM package in the ISO image based on the RPM package names in /root/rpmbuild/RPMS/aarch64.

    Example:

    /home/centos7.6-iso/Packages/kernel-4.14.0-115.el7.0.1.aarch64.rpm

    /home/centos7.6-iso/Packages/kernel-4.14.0-115.el7a.0.1.aarch64.rpm

    In this case, you need to manually delete /home/centos7.6-iso/Packages/kernel-4.14.0-115.el7a.0.1.aarch64.rpm.

  4. Generate repodata again.
    • CentOS 7.6
      1
      createrepo -g repodata/aced7d22b338fdf7c0a71ffcf32614e058f4422c42476d1f4b9e9364d567702f-c7-x86_64-comps.xml ./
      
    • openEuler 20.03
      1
      createrepo -g repodata/normal.xml ./
      
  5. Generate the ISO file.
    • CentOS 7.6
      1
      genisoimage -e images/efiboot.img -no-emul-boot -T -J -R -c boot.catalog -hide boot.catalog -V "CentOS 7 aarch64" -o /home/centos7.6-bcache.iso .
      

      The centos7.6-bcache.iso image is generated in the /home/ directory.

    • openEuler 20.03
      1
      2
      cd /opt/mkeuleros/
      sh mkeuleros.sh -f config/aarch64/standard.conf -n openEuler -v 20.03-LTS -s SP1 -a aarch64 -r file:///home/openEuler20.03-iso/
      

      Generate the image openEuler-20.03-LTS-aarch64-dvd.iso in the /result/ directory.

  6. Install the system.
    1. Select SOFTWARE SELECTION when installing the system.

    2. After selecting the required Base Environment, select Development Tools on the right.

    3. Continue with the installation process.
  7. Verify the page size.
    1
    getconf PAGESIZE
    

  8. Verify the bcache module.
    1
    modinfo bcache