People who have used Windows and Ubuntu dual systems for a long time may encounter reinstalling a system or adding a partition to cause a system reboot:
GRUB loadingerror:unknow filesystemgrub rescue>Please indicate the source: http://blog.csdn.net/jscese/article/details/36865449
I. Concept
BIOS:"Basic Input Output System", Chinese name It is "basic input and output system". In fact, it is a set of programs that are solidified onto a ROM chip on the motherboard of the computer. It stores the most important basic input and output programs, system setting information, self-test program after booting, and system self-starting program. Its main function is to provide the lowest level of hardware setup and control for the computer.
MBR: “Master Boot Record” The physical sector of the hard disk, also called the master boot record! Because the BIOS is too small to host the running program, after the bios detects a hard disk, the contents of the 0 cylinder, 0 head, and 1 sector of the hard disk are simply judged, and then go to the specified position in the memory, and then jump. To this position, start running from this location, the size is 512 bytes, which mainly stores the boot program and the partition table of the hard disk.
GRUB: & ldquo;GRand Unified Bootloade” Multiple operating system boot manager, which can be used to boot into other systems after running this GRUB, including window and linux
From the literal meaning, they should be able to understand their flow, roughly:
PC first boot to the BIOS, then detect the MBR of the hard disk, the content of the MBR sector (that is, GRUB written on it) Load the memory to run, and then achieve the new jump start by running the results obtained by GRUB!
II.Ubuntu grub2 fix
When the PC is installed with windows and then installed ubuntu or only one ubuntu system, the grub2 bootloader that comes with the ubuntu system is written on the MBR. Then the main boot program for booting is grub2! (ububub uses grub2 since 9.10)
and grub2 is divided into two parts, some of which are written to MBR, some of which exist with ubuntu's /boot/grub directory. under.
And grub rescue> is the grub program that does not work properly on behalf of the MBR part, start grub rescue mode, because the /boot/grub part cannot be found.
The available commands under grub rescue:
set, ls, insmod, root, prefix (set the startup path)
First, all the partitions are viewed through ls and will be listed:
(hd0), (hd0, msdos8), (hd0, msdos7), (hd0, msdos6), (hd0, msdos5), (hd0, msdos3), (hd0, msdos1)
Need to find the ubuntu installation partition, through ls (hd0, msdos*) /boot until it does not appear: error: unknown filesystem
If you know where to start installing ubuntu, such as sda7 then here is msdos7, if It is to add partitions in the place before the ubuntu hard disk space, then move the ubuntu partition serial number backwards! Become msdos8
After setting, set the one-time startup parameters by the following command:
grub rescue>setroot=(hd0,msdos8)grub rescue>set prefix=(hd0,msdos8)/grubgrub Rescue>insmod /grub/normal.modgrub rescue>normal will appear in the boot interface in boot/grub!If /boot/grub is not corrupted, you can enter the ubuntu system. If the part of grub boot ubuntu is damaged, you need to manually boot:
Enter the grub command line:
Grub> root (hd0,8) ## Specify partitiongrub> kernel /boot/vmlinuz-2.6.18- containing vmlinuz-2.6.18-274.7.1.el5 and initrd-2.6.18-274.7.1.el5.img 274.7.1.el5 ro root=/dev/sda8 ## root= is to specify the partition containing /sbin/init, that is, the mount/partition (by Linux) grub> initrd /boot/initrd-2.6.18- 274.7.1.el5.img ## It is said that this can omit grub> bootAfter correctly entering ubuntu, you need to update the grub part of MBR to adapt to the new partition:
Terminal input: < Br>
sudo update-grub2sudo grub-install/dev/sda updated to /boot/grub/grub.cfg! Then install grub to the MBRof the main hard disk. I have encountered such an unsuccessful installation. In the GRUB2 manual, there is another way to reinstall grub2 to MBR. Record it:
This solution is installed. The chroot command is used to access the file of the damaged system. Once the chroot command is executed, the LiveCD will treat the /(root) of the corrupted system as what it is currently using. The instructions executed in the chroot environment affect the file system of the compromised system, not the LiveCD. 1. Boot into the LiveCD desktop (Ubuntu 9.10 or later). Note that this LiveCD must be the same version you want to fix now - either 32-bit or 64-bit (otherwise chroot will fail). 2. Open the terminal - application, affiliate application, terminal. 3. Confirm your standard system partition - (option is lowercase "L") sudo fdisk -l If you are not sure, execute df -Th to find the correct disk capacity and ext3 or ext4 format. 4. Mount your standard system partition with the correct partition: sda1, sdb5, and so on. Sudo mount /dev/sdXX /mnt #example: sudo mount /dev/sda1 /mnt5. If you have a separate /boot partition: sdYY is the location of the /boot partition (eg sdb3) sudo mount /dev/sdYY /mnt /boot6. Mount the important virtual file system: sudo mount --bind /dev /mnt/devsudo mount --bind /dev/pts /mnt/dev/ptssudo mount --bind /proc /mnt/procsudo mount --bind /sys /mnt/sys7. Chroot to your standard system device: sudo chroot /mnt8. If /boot/grub/grub.cfg is not present on your system or its contents are incorrect, use the following command to rebuild update-grub9. Reinstall GRUB 2 : Replace with the correct device - sda, sdb, and so on. Do not specify a partition number. Grub-install /dev/sdX10. Verify the installation (use the correct device, such as sda. Do not specify partition): sudo grub-install --recheck /dev/sdX11. Exit chroot: press CTRL-D12 on the keyboard. Uninstall Virtual File system: sudo umount /mnt/dev/ptssudo umount /mnt/devsudo umount /mnt/procsudo umount /mnt/sys If you have mounted a separate /boot partition: sudo umount /mnt/boot13. Uninstall LiveCD /usr Directory: sudo umount /mnt/usr14. Uninstall the last device: sudo umount /mnt15. Reboot. Sudo reboot
ubuntu configuration SSH password-free login 1. Install SSH: 2. Whether to generate .ssh
As a network operation and maintenance engineer, if you manage more routing and switching d
ls is simply a list of file names in the directory, ll more detailed list of file types, file owner
Lab environment: Under Vbox, Rehat5 virtual machine Using samba server Purpose: Upload file to serv
Configuring rdate time server tutorial under Linux
Linux common word processing command summary
Ubuntu graphical desktop and command line interface Switch shortcuts
8 tips make you a superb Linux end user
Linux ping external network packet loss solution
Use external device (optical drive) to install and update library
Centos6.5 x86 installation oracle 11g2r tutorial
Linux modified hostname two ways
How to play CF flash CF how to flash
How can Win7 solve the webpage verification code?
How does my world go to heaven? How does my world open the paradise mode
How to solve the problem of garbled Windows XP system
What should I do if the win7 system is damaged?
Play Windows 7 unique features Control the automatic operation of USB devices
Win10 uses the Edge to browse the web video when the green screen solution
Win8.1 can't open task manager prompts without permission to access the project
Win10 push how to close Win10 upgrade prompts to close the method Daquan