I accidentally deleted Ubuntu's Grub boot under UEFI, so I can't boot into Ubuntu automatically, I can only enter it by manual boot. However, we can use some methods to restore Ubuntu Grub boot, please see below for specific methods.
1. Manually boot into Ubuntu
First, download the Ubuntu installation image (with grub2 boot inside), or directly next to grub2, and then install it in the U disk.
Power on and select the u disk to enter the Grub boot. Then press c to enter the command line mode.
Then manually boot into the original Ubuntu, my boot partition is independent, in (hd0, gpt6), the root partition is in (hd0, gpt7).
If you forget your partition, you can ls,
setroot=(hd0,gpt6)
linux/vmli...roroot=/dev/sda7
initrd/initrd...
boot
The ellipsis part is directly pressed by the Tab key. Then you can enter ubuntu.
2.Rebuild the Grub boot in the ESP partition
Open the command line in Ubuntu and start su in root mode. Then grub-install -v Note that the v here is lowercase. Then the screen pops up and then rebuilds.
If you have any rebuilds, you can mount the ESP partition and see if there is a Ubuntu directory inside. There should be 4 files.
In order to avoid this tragedy in the future, it is recommended to back up the ESP partition before the toss, in case of any eventuality.
First use fdisk -u -l to see which is the ESP partition.
Here I see my ESP partition is in /dev/sda4, write down Sectors, here is 522240.
Then:
dd if=/dev/sda4 bs=512 count=522240 of=./efi.backup
The role of dd is to copy the specified input file Go to the specified output file.
if=Source file path, this is the partition we want to back up.
of=The target file path, here I am writing an efi.backup file in the current directory.
bs=512 means that the size of the block is 512 bytes.
count is how many blocks you want to copy, here we fill in the Sectors obtained above.
If you recover later, directly dd if=./efi.backup bs=512 of=/dev/sda4 will be restored.
The above is the complete content of the Ubuntu Grub boot recovery under UEFI. In the Ubuntu command line, you can re-create the Grub boot of the Ubuntu system.
When CentOS users read ntfs disk devices, they found that the driver files in this
The Linux date command is mainly used to display and set the system time. For progr
If you dont embed a font when you create a PDF file, it may cause different styles
GRUB is a multi-OS boot program, GRUB 2 adds a lot of new features to GRUB, more practical than GRUB
Linux system rescue mode operation example
How to increase or decrease the file system space in Solaris
Linux does not extract compressed files, how to directly view a file size
How Linux uses the shell to identify system bits
Ubuntu install Simple Screen Recorder method
Detailed explanation of the functions and parameters of the Linux system ar command
Difference between Linux exit command and _exit command
How to configure HTTP load balancing system
XP system open Group Policy Editor shows "MMC can not create a snap-in" how to solve?
Win7 system safely remove hardware when the hard drive and optical drive solution
What should I do if Win10 accesses the system folder prompt?
Win10 upgrade error error code 0x8024001e solution
Win10 configuration requirements Windows 10 recommended configuration /minimum configuration list
Win8.1 system check system update error code "8024402f" several solutions
Win8.1 connection is limited or unable to connect to WiFi.
There is no way to add my computer icon on the desktop.
How to set up Win10 to make the system more humane
Win10 UWP version of "microblogging" v5.4 update: support Microsoft Xiaona voice interaction