When Windows and Ubuntu coexist, Ubuntu will bring a Grub system boot. You can choose which system to enable. However, if we partition a disk in Windows, the disk information will be reorganized, and the system boot disk obtained by Grub will change. If Windows is started on/dev/sda1 and Ubuntu is started on/dev/sda8, disk startup caused by partitioning may change Ubuntu boot to a random partition, such as/dev/sda2. When Windows and Ubuntu coexist, ubuntu will bring with it a Grub system boot. You can choose which system to enable from it. However, if we partition the disk in Windows, the disk information will be reorganized, the system boot disk obtained by Grub will change. If Windows is started on/dev/sda1 and Ubuntu is started on/dev/sda8, disk startup caused by partitioning may change Ubuntu boot to a random partition, such as/dev/sda2. The modified partition does not contain the Grub Startup File. At this time, we need to manually set the Grub Startup file so that Ubuntu can find its startup zone.
Next, we will perform a series of operations to solve the problem of Grub loss.
First of all, there are few commands available in Grub Rescue. Install the following method step by step:
Step 1: Find the disk to start Grub.
- Ls
After executing this command, you will see all the partitions in your disk. For example, my disk has the following partitions:
(Hd0, msdos1) (hd0, msdos5) (hd0, msdos6) (hd0, msdos7) (hd0, msdos8 )...
Step 2: Find partitions of non-NTFS file systems.
- Ls (hd0, msdos1 )/
After executing the command, some information will appear. If the command is file not kown, it means that this partition is not what we are looking for, and we keep searching for the remaining partitions, other information may be identified by/AND/boot, or only/boot can be identified, try to identify both of them. For my disk, (hd0, msdos8)
And (hd0, msdos9) are recognized
Step 3: find the location of the Grub File
- Ls (hd0, msdos8)/boot/grub
This command can find grub, But it is strange that there is also a grub in my (hd0, msdos9), so I tried it first.
Execute Step 4 for grub content in msdos8