Recover the lost Linux boot item after Windows is reinstalled

Source: Internet
Author: User


Reinstalling Windows to retrieve the lost Linux boot items is well known. It is best to install Windows first and then install linux when installing both Windows and linux systems. In linux, you can find the Windows system on the hard disk to display the boot menu. The domineering Windows system directly ignores other systems. However, for Windows, after a long period of time, the computer becomes stuck (slightly obsessive-compulsive disorder) and the system will be reinstalled. The problem arises. After Windows is reinstalled, the previous linux boot menu disappears and Windows directly overwrites the boot area. Www.2cto.com if this was not the case when Windows was reinstalled today, I would not bother to find out how to find the linux solution in Windows. The key is that I didn't want to delete the previously installed linux. So there are various Baidu and Google. After combining several methods, we finally got it done. Record my methods below for your reference only. 011. Start live cd with a cd for Ubuntu installation. (If you were using a USB flash drive, you can use a USB flash drive to replace live cd. The effect is the same. I use thinkpad, press F12 at startup, select start from usb, and enter the linux system by default.) 022. Open the terminal and enter the command 03 ubuntu <a href =" http://my.oschina.net/u/555627 "Class =" referer "target =" _ blank "> @ ubuntu </a> :~ $ Sudo-I # Switch to the root user identity 04 www.2cto.com root <a href =" http://my.oschina.net/u/555627 "Class =" referer "target =" _ blank "> @ ubuntu </a> :~ # Fdisk-l # view the partition of the computer disk. The following shows the result. The result varies with the machine. Find the partition with the "System" column as "Linux" and write down the Device name. Here it is "/dev/sda10 ". 053. Check the terminal information and remember the partition where your Ubuntu system is installed (if there is a root partition, record it ). 06 The result is similar to the following: 07 Disk/dev/sda: 500.1 GB, 500107862016 bytes # Here/dev/sda represents the hard Disk 08 255 heads, 63 sectors/track, 60801 cylinders09 Units = cylinders of 16065*512 = 8225280 bytes10 Sector size (logical/physical): 512 bytes/512 bytes11 I/O size (minimum/optimal ): 512 bytes/512 bytes12 Disk identifier: 0xf0b1ebb013 www.2cto.com Device Boot Start End Blocks Id System14/dev/sda1 * 1 3825 30724281 7 HPFS/NTFS15/dev/sda2 3826 60802 457661193 f W95 Ext 'd (LBA) 16 Partition 2 does not end on cylinder boundary.17/dev/sda5 3826 11474 61440561 7 HPFS/NTFS18/dev/sda6 11475 26772 122881153 + 7 HPFS/NTFS19/dev/sda7 26773 42070 122881153 + 7 HPFS/NTFS20/dev/sda8 42071 54427 99257571 7 HPFS/NTFS21/dev/sda9 54428 54610 1464320 82 Linux swap/Solaris22/dev/sda10 54610 60802 49734656 83 Linux # This behavior is Linux partition, write down the Device name 23 Disk/dev/sdb: 1977 MB, 1977614336 bytes # Here/dev/sdb represents self-starting USB flash drive 24 www.2cto.com 61 heads, 62 sectors/track, 1021 cylinders25 Units = cylinders of 3782*512 = 1936384 bytes26 Sector size (logical/physical): 512 bytes/512 bytes27 I/O size (minimum/optimal ): 512 bytes/512 bytes28 Disk identifier: 0x00044e7e29 Device Boot Start End Blocks Id System30/dev/sdb1 * 1 1021 1930680 c W95 FAT32 (LBA) 314 if your Ubuntu/partition is sda7 and the/boot partition is sda6, run the following command on the terminal: 32 www.2cto.com root <a href =" http://my.oschina.net/u/555627 "Class =" referer "target =" _ blank "> @ ubuntu </a> :~ # Mount/dev/sda10/mnt # mount the Linux partition represented by/dev/sda10 to 33 root under the/mnt directory <a href =" http://my.oschina.net/u/555627 "Class =" referer "target =" _ blank "> @ ubuntu </a> :~ # Mount/dev/sda6/mnt/boot # Yes (this will not be skipped if no/boot is separately partitioned) 34 root <a href =" http://my.oschina.net/u/555627 "Class =" referer "target =" _ blank "> @ ubuntu </a> :~ # Grub-install -- root-directory =/mnt // dev/sda # install grub. If it is normal, the following information is displayed. 35 (Note:/mnt/(space here)/dev/sda) 36 Installation finished. No error reported.37 www.2cto.com 5. Restart 38 root <a href =" http://my.oschina.net/u/555627 "Class =" referer "target =" _ blank "> @ ubuntu </a> :~ # Reboot # restart your computer. You will see the familiar grub startup interface! Here we use a very important concept in linux: mount. I am just getting started. I still have a lot to learn about linux and make common progress.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.