In Linux, after partition adjustment, error: unknown Filesystem grub rescue> is displayed when the system is restarted, and the system cannot access it. This means that your grub2 configuration file is broken… Grub2 cannot be started due to partition adjustment or partition UUID change, and therefore enters grub Rescue mode.
Only a few commands are available in rescue mode: set, ls, insmod, root, prefix
(1)setView environment variables, where you can view boot paths and partitions. (2)ls View the device (3) Insmod load the module (4)root specify the partition used to boot the system and set the GRUB boot partition in rescue mode (5)prefix set the GRUB boot pathCopy the code
Specific repair steps are as follows:
-
Grub rescue> ls
(hd0) (hd0,msdos9) (hd0,msdos8) (hd0,msdos7) (hd0,msdos6) (hd0,msdos5) (hd0,msdos2) (hd0,msdos1)
Note: Above is my partition device, it may be different for everyone, but the principle is the same. Grub > find /boot/grub/grub.conf also works
-
2, Find the ubuntu partition: (that is, find your Linux system installed in the above partition)
grub rescue> ls (hd0,msdos1)/
If unknown Filesystem appears, try the next… If the name of the folder and file appears in your Ubuntu home folder, that’s the partition you’re looking for.
-
3, change the boot partition :(if you found the boot partition is hd0,msdos8)
-
rescue>root=(hd0,msdos8)
Grub rescue>prefix=/boot/grub // GRUB Path Settings GRUB rescue>set root=(hd0, MSdos8) GRUB rescue>set prefix=(hd0, MSdos8)/boot/grub Grub Rescue >insmod normal // Start normal After grub rescue>normal you should see the familiar boot menu bar
-
4. Go to the cli to start Ubuntu
When you go to the system boot options screen, you still can’t go to it because you haven’t actually modified GRUB yet. You have to go to Ubuntu to do this. When you go to the system boot options screen, press C to enter the command line mode. grub >set root=hd0,msdos8 grub >set prefix=(hd0,msdos8)/boot/grub grub >linux /vmlinuz-xxx-xxx root=/dev/sda8 Acpi =off grub >initrd /initrd.img-xxx- XXX grub >boot
-
5. Go to Ubuntu and fix grub
Running in the terminal
sudo update-grub`
sudo grub-install /dev/sdaCopy the code
-
6, restart, done!!
Note: sometimes only modify 1 ~ 3 steps, and then in the menu bar can enter the system, and everything is normal. On reboot, the system only has a blinking cursor in the upper left corner of the system, so you can’t enter the system. It may be a problem with the boot option. Change the boot option to hard disk.
Method 2:
First make Ubuntu boot USB
The copy code is as follows:
sudo dd if= ubuntu 13.10 - the desktop - amd64. Iso of = / dev/sdb1#/dev/sdb1 is the USB drive letterCopy the code
-
1. Log in to the Ubuntu trial environment using the boot USB drive
-
2. View the disk partition status and obtain the Linux installation partition number sudo fdisk -l
View the output and determine which disk and partition the Linux system is installed on based on the file type and partition size. Ubuntu is installed on my computer in /dev/sda3. Alternatively, open the Gparted graphical tool to view partition information. Mount the Ubuntu partition
-
3. Since Ubuntu is installed on /dev/sda3, we can mount the Ubuntu installation partition with the following command. You will need to replace /dev/sda3 with your own Linux installation partition. sudo mount /dev/sda3 /mnt
-
4. Mount other required directories (use –bind)
sudo mount --bind /dev /mnt/dev
sudo mount --bind /proc /mnt/proc
sudo mount --bind /sys /mnt/sysCopy the code
-
5. The Linux system code for Chroot to the hard disk is as follows:
The sudo chroot/MNT chroot command switches the root directory to the specified directory
-
6. Install & update Grub
grub2-install /dev/sda
grub2-mkconfig -o /boot/grub2/grub.cfgCopy the code
-
7. After Grub is successfully repaired, you need to exit the chroot environment and unmount mounted devices and directories.
exit Exit the chroot environment
sudo umount /mnt/dev
sudo umount /mnt/proc
sudo umount /mnt/sys
sudo umount /mntCopy the code
-
8. Restart.
Root (hd0,x) input (after, press TAB key auto-complete very easy to use. X represents your Linux root partition
>linux /vmlinuz ro quiet
>initrd /initrd.lz
>bootCopy the code
LST: find –set-root /boot/grub/menu. LST: grub command index configfile /boot/grub/menu. LST: grub command index configfile /boot/grub/menu. LST