Problem description
The "Not enough space on /boot" error occurs during operating system migration.
Cause
The /boot partition requires at least 100 MiB of free space to install the new initramfs and kernel. If the /boot directory has less than 100 MiB available, the migration fails.
Solution
Remove unused kernel versions from the /boot directory, including the corresponding initramfs, vmlinuz, and config files. Verify that the system boots correctly after removal.
-
Connect to the ECS instance as the root user. Connect to a Linux instance by using a password or key.
-
View the installed kernel versions:
rpm -qa | grep kernel -
Check the currently running kernel version:
uname -rExample output:
[root@iZbp104w56ovfyfxy9o**** ~]# uname -r 3.10.0-1160.el7.x86_64 -
Remove unused kernel versions.
In this example,
kernel-3.10.0-514.26.2.el7.x86_64is removed.-
If the kernel was installed from an RPM package, run:
yum remove kernel-3.10.0-514.26.2.el7.x86_64 -
If the kernel was installed by compiling the source code, run the following commands in sequence:
REMOVE_KERNEL=3.10.0-514.26.2.el7.x86_64 grubby --remove-kernel=/boot/vmlinuz-$REMOVE_KERNEL rm -rf /boot/initramfs-$REMOVE_KERNEL.img /boot/initramfs-${REMOVE_KERNEL}kdump.img /boot/symvers-$REMOVE_KERNEL.gz /boot/System.map-$REMOVE_KERNEL /boot/vmlinuz-$REMOVE_KERNEL /boot/config-$REMOVE_KERNEL grubby --remove-kernel=/boot/vmlinuz-$REMOVE_KERNEL
-
-
Set the latest remaining kernel as the default boot kernel.
-
View all installed kernels:
grubby --info=ALL -
View the current default boot kernel:
grubby --default-kernelExample output:
[root@iZbp104w56ovfyfxy9o**** ~]# grubby --default-kernel /boot/vmlinuz-3.10.0-1160.90.1.el7.x86_64 -
Set the latest kernel as the default.
In this example,
3.10.0-1160.76.1.el7.x86_64is set as the default boot kernel.grubby --set-default /boot/vmlinuz-3.10.0-1160.76.1.el7.x86_64
-
-
After you resolve the network issue, run the SMC client to retry the operation. For more information, see Run the SMC client.