1. When installing CentOS with a USB flash drive, partition partitions should note: The system (contains Win7) can only be 4 primary partitions, so you can only delete a primary partition or in the extended partition in the free partition to establish the directory.
2, CentOS at the end of the installation step, the boot loader option only "installed on the USB stick" One, note: not easily installed on the MBR, will overwrite the Win7 system boot loader.
So let's first choose to install the bootloader on the USB stick and then fix it.
3, CentOS repair Grub boot Loader
Reference and turn from: http://blog.csdn.net/llhwin2010/article/details/8435153
Install CentOS with a USB stick, if using the default boot mount, the boot will be installed on the USB stick, must be started with a USB stick, this situation can be manually written to boot through grub. (When I install on another server manually set boot but installed to stay in grub can not start, this did not delve into, here is the first to say manual modification of the boot method, for those who encounter the same problem reference, if there are errors, welcome to shoot Bricks)
Enter GRUB
Linux Code
- [Email protected] home]#/sbin/grub
Find the location of Grub
Linux Code
- Grub> Find/grub/stage1
- (hd0,6)
If you are prompted for error 15:file not found, try to find/boot/grub/stage1 or find Stage1 (hd0,6) represents the 7th partition of the 1th hard disk, and the corresponding (hd0,0) represents the first partition of the first hard disk, This step actually tells us whether the boot was written to the USB stick
[ because under normal circumstances, we have only one hard disk in our computer, so the second hard drive is a USB drive. (HD1-hd0) As for partitioning, when creating a directory with free disk space, the device name such as/DEV/SDA ' X ' is displayed, the partition is ' x-1 ', or the DF command is used to view the disk where the/boot directory is located ]
Get down to the chase.
We will boot the write (hd0,6), that is, the first disk in the partition, I am here in the system disk is this, specifically can be used under Linux with the DF command to view
Linux Code
- grub> Root (hd0,6) [In my system, for example, the partition number of the directory/boot in my CentOS system is 6, so this is the root (hd0,6)]
- Filesystem type is EXT2FS, partition type 0x83
- grub> Setup (hd0)
- Checking if "/boot/grub/stage1" exists ... no
- Checking if "/grub/stage1" exists ... yes
- Checking if "/grub/stage2" exists ... yes
- Checking if "/grub/e2fs_stage1_5" exists ... yes
- Running "embed/grub/e2fs_stage1_5 (hd0)" ... sectors is embedded.
- Succeeded
- Running "Install/grub/stage1 (hd0) (hd0) 1+15 P (hd0,0)/grub/stage2/grub/grub.conf" ... succeeded
- Done.
- Grub> reboot
Then modify the boot/boot/grub/menu.lst or/boot/grub/grub.conf CentOS under these two files are bound, change one can
Linux Code
- [Email protected] home]# Vi/boot/grub/menu.lst
- # grub.conf generated by Anaconda
- #
- # Note that you don't have the to rerun grub after making changes to the This file
- # notice:you has a/boot partition. This means
- # all kernel and INITRD paths is relative to/boot/, eg.
- # Root (hd0,6) [corresponds to the above/boot area]
- # kernel/vmlinuz-version RO root=/dev/volgroup00/logvol00
- # initrd/initrd-version.img
- #boot =/dev/sdb
- default=0
- timeout=5
- Splashimage= (hd0,6)/grub/splash.xpm.gz
- Hiddenmenu
- Title CentOS (2.6. 18-274.3. 1.EL5)
- Root (hd0,6)
- kernel/vmlinuz-2.6. 18-274.3. 1.el5 ro root=/dev/volgroup00/logvol00
- initrd/initrd-2.6. 18-274.3. 1.el5.img
- Title CentOS (2.6. 18-238.el5)
- Root (hd0,6)
- kernel/vmlinuz-2.6. 18-238.el5 ro root=/dev/volgroup00/logvol00
- initrd/initrd-2.6. 18-238.el5.img
- Title Other
- rootnoverify (hd0,6)
- Chainloader +1
The (hd1,0) to change (hd0,6), splashimage= (hd0,6)/grub/splash.xpm.gz This is the boot background image of the location, change does not change the relationship is not big, restart CentOS can start normally
Install dual-system CentOS under Win7 and fix problems with the CentOS boot loader installed on the USB flash drive