Background
My machine is an old notebook ThinkPad e430c, but the BIOS also supports EFI boot. I didn't mean to toss it, but I didn't think I would install Windows. If you have a plan, install Windows and then install Linux, which can save you a lot of trouble. I don't know when my hard disk partition was replaced by me gpt, if you are MBR, that can save a lot of trouble.
Loading ubuntu16.10
Write the system image to the USB flash drive and install it with UltraISO. Because there is no data on the hard disk, so feel free to partition, configure. I was deliberately leaving some partitions unallocated for a rainy day. Partition at least one EFI partition, one swap partition, one root partition.
Loading Win7
The 32-bit WIN7 certainly does not support GPT , so 32-bit don't toss it. I heard that GPT disk cannot be installed with ghost, so I downloaded an image of the original installation mode. I heard that some of the installation image does not support EFI, so we need to pay attention to the image, of course, if the image does not support, there are other ways to Baidu. Fortunately my image is supported by EFI, so no extra work is necessary. Mirror down, with engraved u disk or engraved CD-ROM according to their own preferences, because my image has 3.7G, I am not engraved on the U disk, so chose the CD.
I used the image:
Http://www.xitonghe.com/win7/qijianban-xiazai-167.html
Https://pan.baidu.com/s/1c2MH2jY
BIOS configuration
Be sure to pay attention to the BIOS configuration, I am the BIOS configuration is not right, the installation of Win7 has been stuck in the WIn7 startup interface, I thought it was a mirror problem, resulting in a few more engraved disk. I use the bios of my machine as an example to illustrate, other models of the BIOS to explore their own.
Startup--uefi/-CSM Support (Yes)
The correct option is to select the UEFI only option in the BIOS of the startup page of the uefi/Legacy Boot , while the following-CSM support chooses yes. I say I met some of the situation, just beginning I selected above the UEFIonly, the following selection of no, the result is the installation of the card at the start of the Win7 interface. Later selected both (both UEFI support and support Legacy), the results smoothly into the installation interface, but the installation of the partition when prompted I was a GPT partition, can not be installed.
Now it is possible to install Win7 properly, I allocated two zones to Win7 with unallocated space, a C drive, and a D drive. The installation is finished successfully. After restarting can only enter the Win7, now can activate the system, genuine users ignore the next thing. Because it is a GPT disk, so the various activation tools can not be used, Baidu under the "GPT Partition activation win7 tool." My use is Green Union. This GPT disk win7 Activation tool can be activated successfully by using it.
Http://www.xdowns.com/soft/6/7/2015/Soft_134260.html
Https://pan.baidu.com/s/1skYRZ1j
The next thing is the plays.
Back to Ubuntu
Restart the system, the first step is to find a way to start grub (ubuntu16.10 with the GRUB2, as described below, I still use the word grub), various methods, I am using the front of the Ubuntu installed U disk. Select boot from the USB flash drive and press C to enter the GRUB command line when you enter the selection menu. is the black screen next to a grub> prompt.
First of all, my zoning, as follows:
device Start End sector Size type/dev/sda12048 976895 974848476M EFI System/dev/sda2976896 16992255 16015360 7. 7G Linux Swap/dev/sda3 16992256 20991999 3999744 1.9G Linux filesystem/dev/sda4 20992000 220991487 199999488 95.4G Linux filesystem/dev/sda5220991488 781459455 560467968 267. 3G Linux filesystem/dev/sda6781459456 863379455 81920000 the. 1G Microsoft Basic Data/dev/sda7863379456 863641599 262144128M Microsoft reserved/dev/sda8863641600 976771071 11312947254G Microsoft Basic Data
File system 1k-block already used% mount point available
Udev 3984384 0 3984384 0%/dev
Tmpfs 801152 9812 791340 2%/run
/dev/sda4 97905948 7087240 85802340 8%/
Tmpfs 4005744 696 4005048 1%/DEV/SHM
TMPFS 5120 4 5116 1%/run/lock
Tmpfs 4005744 0 4005744 0%/sys/fs/cgroup
/dev/sda3 1968400 131852 1736556 8%/boot
/DEV/SDA1 486456 14044 472412 3%/boot/efi
/dev/sda5 274776980 69853816 190895188 27%/Home
Tmpfs 801148 801020 1%/run/user/100
In Grub (HD1,GPT3) corresponds to/dev/sda3, (HD1,GPT4) corresponds to/DEV/SDA4. Follow these steps to successfully boot into Ubuntu.
1.Set root= (HD1,GPT4) Description:(HD1,GPT4) refers to the Ubuntu root file system/The partition being hung. 2.Linux (HD1,GPT3)/vmlinuz-4.8.0-26-generic root=/dev/ sda4 Description:(HD1,GPT3) isThe partition where/boot is located, if your/boot does not have a separate partition, then you can fully use (HD1,GPT4)/boot/vmlinuz-4.8.0- --generic or/boot/vmlinuz-4.8.0- --generic to replace (HD1,GPT3)/vmlinuz-4.8.0- --generic.vmlinuz-4.8. 0--genericIs the kernel image you want to boot, the/boot directory is completely likely to have many different versions of the image, select which, generally choose the latest bar. If you don't know how to look at what you have, there is something to look at later./dev/ sda4 refers to the name of the device in the file system where the root filesystem resides. 3.INITRD initrd.img-4.8.0-26- Generic Description: note initrd.img -4.8. 0--genericVersion to be associated with mlinuz-4.8.0- --generic versions are consistent. 4.Boot
OK, so you're already in the Ubuntu system. In the heart finally can not panic, currently you can continue to repeat the above steps to enter Ubuntu again. Then there are two steps, and it's done. That is to re-install grub to disk. Enter the command terminal in order to execute the following two commands.
1 sudo update- Grub Instructions: This step is to update the list of boot menus, if this step is not done, it is also white done. In Ubuntu you may also have an update-grub2 when you check the command, which isa symbolic link to update-grub. 2sudogrub-install/dev/SDA Description: Write grub to the hard disk as the default bootstrapper. Parameter /DEV/SDA is your hard disk file, according to your actual situation change, perhaps your hard disk is/dev/sdb it.
To all this, restart the system and then you can see the GRUB selection interface, you can choose whether to go to Ubuntu or Win7, in the end want to let which as the default startup items, and then study grub.
Report:
How do I determine the relevant parameters of my partition before the Grub command interface?
With the LS command can list the current hard disk all the partitions, if there are more than one hard disk, will be listed, such as when I entered the grub with my installation of the USB flash drive, is also displayed.
At this time if you like me familiar with their own partition, the basic can guess which partition is, or a try it, how to try?
Assuming that there is a partition called (HD0,GPT2), then enter the command LS (hd0,gpt2)/ then press ENTER or double-press the TAB key to see its listed file name, according to the root file system those directory name, then this partition is/mounted partition. If your boot directory does not have a separate hanging partition, then you can. If you have a separate partition, then you will find the partition where/boot is located in the same way as you did.
How do I see the kernel file name?
Assume/directory hangs in partition (HD0,GPT1),/boot hangs in partition (HD0,GPT2). If/directory is in a partition with/boot, then use the command LS (hd0,gpt1)/boot/ . If not in a partition, use the command LS (hd0,gpt2)/. Pay attention to the last one/.
GPT HDD first installed ubuntu16.10 after loading Win7