1. 程式人生 > >關於64位 windows&linux雙系統引導問題

關於64位 windows&linux雙系統引導問題

start trac track uid too 處理 blog windows for

換了臺本子win7 64位,抽空做個雙系統,裝了下linux。

遇到開機問題:進linux可以正常使用,進win7花屏死機,初步估計是grub(此時的boot sector位grub)的問題,啟動器被破壞一種表現。

對應做了以下處理:

1、在linux下修改/boot/grub/gurb.cfg,把:

 1  ### BEGIN /etc/grub.d/30_os-prober ###
 2  menuentry Windows 7 (loader) (on /dev/sda1) --class windows --class os $menuentry_id_option osprober-chain-04EC18F4EC18E22A
{ 3 insmod part_msdos 4 insmod ntfs 5 set root=hd0,msdos1 6 if [ x$feature_platform_search_hint = xy ]; then 7 search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 04EC18F4EC18E22A 8 else 9 search --no-floppy --fs-uuid --set=root 04EC18F4EC18E22A
10 fi 11 parttool ${root} hidden- 12 chainloader +1 13 } 14 ... 15 } 16 ### END /etc/grub.d/30_os-prober ###

修改為:

1 1 fi

2 parttool ${root} hidden-

3 ntldr /bootmgr ### bootmgr啟動器 ###

重定位啟動位置。

而後重裝grub,quote網上案例:

事先在bash做個update-grub

可以得到

win系統的硬盤所在位置

比如,win7 on /dev/sda1

而後

1 $sudo fdisk -l

--》

 1 Disk /dev/sda: 500.1 GB, 500107862016 bytes  
 2 255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors  
 3 Units = sectors of 1 * 512 = 512 bytes  
 4 Sector size (logical/physical): 512 bytes / 512 bytes  
 5 I/O size (minimum/optimal): 512 bytes / 512 bytes  
 6 Disk identifier: 0xc3ffc3ff  
 7   
 8 Device Boot Start End Blocks Id System  
 9 /dev/sda1 * 2048 206847 102400 7 HPFS/NTFS/exFAT  
10 /dev/sda2 206848 102402047 51097600 7 HPFS/NTFS/exFAT  
11 /dev/sda3 102402048 266242047 81920000 7 HPFS/NTFS/exFAT  
12 /dev/sda4 266244094 976771071 355263489 f W95 Extd (LBA)  
13 /dev/sda5 266244096 362371071 48063488 7 HPFS/NTFS/exFAT  
14 /dev/sda6 362373120 771971071 204798976 7 HPFS/NTFS/exFAT  
15 /dev/sda7 771973120 772165631 96256 83 Linux  
16 /dev/sda8 772167680 776165375 1998848 82 Linux swap / Solaris  
17 /dev/sda9 776167424 912883711 68358144 83 Linux  
18 /dev/sda10 912885760 976771071 31942656 83 Linux  

可以看到win系統所在位置,起始位2048,end在206847,以及sector的信息 sectors of 1 * 512 = 512 bytes。

——》

1 sudo grub-install /dev/sda  
2 sudo update-grub  
3 sudo dd if=/dev/sda of=/dev/sda bs=512 count=1 seek=2048 skip=206847

so on。

關於64位 windows&linux雙系統引導問題