Centos8 delete boot directory recovery

Time:2021-6-1

After the system is installed, it’s better to make a backup of the boot partition, because we can’t move it, so the backup should be done once and for all, just in case. If we accidentally delete this directory, we don’t have to panic. Because of this partition, we can’t use it except when we start up, so it’s very easy to recover. Moreover, after recovery, other services in our operating system are basically unaffected. Let’s see how to recover if / boot is deleted by mistake

Since the / boot partition is generally used to store the image and related boot files, the recovery does not affect the normal operation of other services of the system after being mistakenly deleted; However, the system can’t start after being deleted by mistake, because grub.conf file is also deleted in / boot / grub /.

Centos8 delete boot directory recovery

Delete boot directory

Centos8 delete boot directory recovery

Unable to start, enter grub mode

Centos8 delete boot directory recovery

 

At this time, it is necessary to hang the disk for repair

Centos8 delete boot directory recovery

Load a shell after emergency mode starts

Centos8 delete boot directory recovery

Check that the disk has been automatically mounted to the / MNT / directory

Centos8 delete boot directory recovery

Use chroot command to enter the disk system. Otherwise, only in the memory system.

The boot directory is empty.

Centos8 delete boot directory recovery

Mount CD image

Centos8 delete boot directory recovery

Use other centos8 systems to view the packages generated by vmlinuz and initramfs in the boot directory

Centos8 delete boot directory recovery

Install kernel

Centos8 delete boot directory recovery

Boot directory recovery

Centos8 delete boot directory recovery

Centos8 delete boot directory recovery

 

It can boot normally

Centos8 delete boot directory recovery