Identify and resolve ECS instance startup failures caused by missing boot files or OS release files.
Symptoms
The instance fails to start and displays an error message like the following:
[ OK ] Reached target Remote File Systems (Pre).
[ OK ] Reached target Remote File Systems.
[ 1.575629] EXT4-fs (vda1): mounted filesystem with ordered data mode. Opts: (null)
[ OK ] Mounted /sysroot.
[ OK ] Reached target Initrd Root File System.
Starting Reload Configuration from the Real Root...
[ OK ] Started Reload Configuration from the Real Root.
[ OK ] Reached target Initrd File Systems.
[ OK ] Reached target Initrd Default Target.
Starting dracut pre-pivot and cleanup hook...
[ 1.661164] tsc: Refined TSC clocksource calibration: 2499.915 MHz
[ OK ] Started dracut pre-pivot and cleanup hook.
Starting Cleaning Up and Shutting Down Daemons...
[ OK ] Stopped dracut pre-pivot and cleanup hook.
[ OK ] Stopped target Timers.
[ OK ] Stopped target Remote File Systems.
[ OK ] Stopped target Remote File Systems (Pre).
Starting Plymouth switch root service...
[ OK ] Stopped dracut initqueue hook.
[ OK ] Stopped target Initrd Default Target.
[ OK ] Stopped target Basic System.
[ OK ] Stopped target System Initialization.
Stopping udev Kernel Device Manager...
[ OK ] Stopped target Sockets.
[ OK ] Stopped target Paths.
[ OK ] Stopped Apply Kernel Variables.
[ OK ] Stopped target Slices.
[ OK ] Stopped target Local File Systems.
[ OK ] Stopped udev Coldplug all Devices.
[ OK ] Stopped target Swap.
[ OK ] Stopped udev Kernel Device Manager.
[ OK ] Stopped dracut pre-udev hook.
[ OK ] Stopped dracut cmdline hook.
[ OK ] Stopped Create Static Device Nodes in /dev.
[ OK ] Stopped Create list of required sta...ce nodes for the current kernel.
[ OK ] Closed udev Control Socket.
[ OK ] Closed udev Kernel Socket.
Starting Cleanup udevd DB...
[ OK ] Started Cleaning Up and Shutting Down Daemons.
[ OK ] Started Cleanup udevd DB.
[ OK ] Reached target Switch Root.
[ OK ] Started Plymouth switch root service.
Starting Switch Root...
[FAILED] Failed to start Switch Root.
See 'systemctl status initrd-switch-root.service' for details.Causes
-
The /boot directory is missing key boot files, such as the kernel image
vmlinuzor the rootfs imageinitramfs. -
The /etc/os-release and /usr/lib/os-release files are missing, which prevents
systemdfrom detecting the operating system.
These steps are verified on Alibaba Cloud Linux 3.2 64-bit. Steps may vary by OS distribution. See your distribution's official documentation.
Solution 1: Restore the system disk from a snapshot
-
Restore the system disk from a snapshot.
-
Roll back a disk from a snapshot.
Solution 2: Copy boot files from another instance
The instance has started
Use SCP or OSS to copy the required boot files from another instance that uses the same image.
The instance fails to start
Copy the boot files from another instance that uses the same image and attach the repaired disk back.
-
Identify the missing boot files.
-
Create an ECS instance with the same image.
-
Detach the system disk from the affected instance. Record the disk ID.
See Detach a system disk.
-
Attach the detached system disk to the new instance.
See Attach a data disk.
-
Copy the missing boot files to the attached system disk.
-
Detach the repaired system disk and reattach it to the original instance.