Boot space expansion and system reliability

HCLSRM - Automation for Increasing Boot Partition Size by Migrating to a New Partition

Detailed Article

Pre-Requisite:
"In the vSphere clientprovision an additional disk of at least 1 GB for each SRM VM that requires increased boot space."

Symptoms

Legacy SRM installations, such as those starting from SRM 3.x and subsequently upgraded to newer versions, may encounter issues during the upgrade to SRM 5.1.0.0 if performed on virtual machines with insufficient /boot partition space.

If the /boot partition lacks the required free space, critical OS updates—such as kernel package installations—may fail. This can result in the system entering a continuous reboot loop during the upgrade process.

Such symptoms indicate that the /boot partition does not meet the minimum space requirements necessary for kernel updates and SRM-related components.
Cause

In certain legacy SRM virtual machines (particularly those running SRM 3.x), the /boot partition may be configured with less than 300 MB of space. If the available free space drops below 115 MB, system updates—especially kernel upgrades—can fail.

When this occurs, the system may be unable to install new kernel versions, modules, or essential packages, leading to update failures and potential boot issues.
Resolution

To resolve this issue, the /boot partition must be resized to meet the minimum space requirements. This can be accomplished by migrating the partition to a new disk.

To streamline this process, an automated Boot Partition Migration Script is available. The script performs the following key operations:

  1. Validates and updates UUIDs
    for the /boot and /boot/efi partitions in the /etc/fstab file to ensure accurate mapping before migration.
  2. Checks available space
    in the current /boot partition and, if insufficient, migrates it to a new partition based on user input.
  3. Logs all actions
    to /var/log/migrate_boot.log for auditing and troubleshooting purposes.

It is strongly recommended to run this script prior to initiating SRM upgrades to ensure the /boot partition has adequate space and is correctly configured, thereby preventing upgrade failures and boot-related issues.
Note:
If the script returns a “Permission denied” error, ensure it has the correct execution permissions by running the following command as root:

chmod 744 Boot-Partition-Migration-Script.sh
Functionality
1. Initial Validation
        • UUID Configuration Check
      Ensures that the /boot and /boot/efi partitions have valid UUID entries in the /etc/fstab file.
                        o   If any UUIDs are missing, the script automatically generates and updates them to maintain proper system mapping.

      • Space Assessment
      Evaluates the current size and available free space of the /boot partition.
                        o   If the total size is less than 300 MB or free space is below 115 MB, the script initiates the migration process.
                        o   If both thresholds are met, the script exits gracefully, indicating no action is required.

2. Scenario 1: Migration to an Unlabelled 1 GB Disk

      • SCSI Bus Scan - Performs a scan to detect newly attached disks.

      • Disk Identification - Searches for an available 1 GB unlabelled and unpartitioned disk suitable for migration.

      • Automated Migration Process

      If a suitable disk is found, the script:

                  o  Partitions and prepares the disk for use.
                  o  Labels the new partition and configures it as the /boot partition.
                  o  Updates the /etc/fstab file with the new partition’s UUID.
                  o  Updates GRUB and regenerates the GRUB configuration.

      • Post-Migration - After migration, details of the /boot/efi partition may temporarily disappear. These changes will be fully visible after a system  reboot.

      • A manual reboot is necessary to finalize the migration and verify all changes.


3. Scenario 2: Migration to an Existing Disk with More Than 1 GB Free Space

      If no unlabelled disk is found, the script checks existing disks for at least 1 GB of unpartitioned space.

      If such space is available:

  • The script prompts the user for confirmation to proceed (YES/NO, case-sensitive).
  • If the user responds with YES:
    • Displays a list of disks with available space.
    • Prompts the user to manually enter the preferred disk name (e.g., sda, sdb, sdX).
    • Proceeds with the automated migration process as described in Scenario 1, including partitioning, updating /etc/fstab, regenerating GRUB, and logging all actions.
  • If the user responds with NO:
    • Displays the message:
      "Please add a 1 GB disk and restart the process..."

4. Scenario 3: No Suitable Disk Available

      If the /boot partition is below the required threshold and no suitable disk or unpartitioned space is available, the script will display the following message:
      "Usable space does not exist. Please add a 1 GB disk and restart the process."

5. Error Handling and User Prompts

  • Invalid Disk Name
    Displays: "Invalid option selected. Exiting the script..."
  • Invalid YES/NO Response (Case-Sensitive)
    Displays: "Invalid option selected. Exiting the script..."
  • Disk Scan Failure
    Displays:
    • "ERROR: Disk scan failed for /dev/sdX"
    • "Bad blocks returned exit code ERROR"
    • Shows detailed information about the bad blocks
    • "Please add or replace the disk /dev/sdX and restart the process."
  • Bad Blocks Detected
    Displays:
    • "Bad blocks detected on /dev/sdX"
    • Shows detailed information about the bad blocks
    • "Please add or replace the disk /dev/sdX and restart the process."
Script Name: boot-new-partition-script.zip

Affected Products
SRM