2010年4月8日 星期四

使用 Windows bootloader 來 load Linux

用 Windows 本身的 bootloader 來建立多系統的電腦


使用 Windows NT/2000/2003/XP 本身的 bootloader 來 dual boot 需要一個叫 bootpart 的程式,在這裡下載。另外要注意安裝 linux 時要把 GRUB 裝在 linux 的分區,而不是裝在 MBR。

bootpart 執行後可以看到類似下面的資料,是所有硬碟的 partition 列表,
C:\>bootpart
Boot Partition 2.60 for WinNT/2K/XP (c)1995-2005 G. Vollant (info@winimage.com)
WEB : http://www.winimage.com and http://www.winimage.com/bootpart.htm
Add partition in the Windows NT/2000/XP Multi-boot loader
Run "bootpart /?" for more information

Physical number of disk 0 : 96e096d
0 : C:* type=7  (HPFS/NTFS), size= 15358108 KB, Lba Pos=63
1 : C:  type=5  (Extended), size= 145476607 KB, Lba Pos=30716280
2 : C:  type=7   (HPFS/NTFS), size= 145476576 KB, Lba Pos=30716343
Physical number of disk 1 : f6568938
3 : D:* type=83  (Linux native), size= 19535008 KB, Lba Pos=63
4 : D:  type=5  (Extended), size= 2000092 KB, Lba Pos=39070080
5 : D:  type=82   (Linux swap), size= 2000061 KB, Lba Pos=39070143
找到裝有 linux 的 partition,如上面的 3,執行下面的命令:
C:\>bootpart 3 bootlnx.sec ubuntu
意思是建立一個叫 bootlnx.sec 檔名的檔案,用第三個 partition boot,並用 “ubuntu” 的名字加入 Windows bootloader 的選單。執行完了之後,產生一個 bootlnx.sec 檔案,並在 boot.ini 中加了最後一行:
[boot loader]
timeout=5
default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS
[operating systems]
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Windows XP Media Center Edition" /noexecute=optin /fastdetect
C:\bootlnx.sec="ubuntu"
這樣就 ok 了,重開機會看到上面的兩個選項 “Windows XP Media Center Edition” 及 “ubuntu”。

Reference from http://ying.homedns.org/wp/2007/12/286/

沒有留言:

張貼留言

How to use simple speedtest in RaspberryPi CLI

  pi@ChunchaiRPI2:/tmp $  wget -O speedtest-cli https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py --2023-06-26 10:4...