在不同的硬盘上进行双启动

在不同的硬盘上进行双启动

我在一块硬盘上安装了 Windows XP Professional,在另一块硬盘上安装了 Ubuntu 10.10。启动时,计算机完全跳过 grub 菜单,直接进入 10.10。

我尝试在安装了 Windows 硬盘的情况下运行 os-prober,然后更新 grub,但没有作用。

有任何想法吗?

我已经更改了启动顺序,以便装有 xp 的 HDD 位于第一位置,但计算机仍然启动到 linux。

我尝试运行 grub-install /dev/sda 并得到这个

/usr/sbin/grub-setup: warn: Sector 32 is already in use by FlexNet; avoiding it.  This software may cause boot or other problems in future.  Please ask its authors not to store data in the boot track..
/usr/sbin/grub-setup: warn: Sector 33 is already in use by FlexNet; avoiding it.  This software may cause boot or other problems in future.  Please ask its authors not to store data in the boot track..
Installation finished. No error reported

我使用磁盘实用程序检查了一下,我的 xp 硬盘的代码是 sdb,所以我运行了 camand grub-install /dev/sdb,结果给了我这个

Installation finished. No error reported.

所以我重新启动了但它仍然不起作用。

还有其他想法吗?

附加信息

gedit /boot/grub/grub.cfg:

#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
  set have_grubenv=true
  load_env
fi
set default="0"
if [ "${prev_saved_entry}" ]; then
  set saved_entry="${prev_saved_entry}"
  save_env saved_entry
  set prev_saved_entry=
  save_env prev_saved_entry
  set boot_once=true
fi

function savedefault {
  if [ -z "${boot_once}" ]; then
    saved_entry="${chosen}"
    save_env saved_entry
  fi
}

function recordfail {
  set recordfail=1
  if [ -n "${have_grubenv}" ]; then if [ -z "${boot_once}" ]; then save_env recordfail; fi; fi
}

function load_video {
  insmod vbe
  insmod vga
}

insmod part_msdos
insmod ext2
set root='(hd0,msdos1)'
search --no-floppy --fs-uuid --set d682c9bd-dd89-4827-9802-a1f921ebe21c
if loadfont /usr/share/grub/unicode.pf2 ; then
  set gfxmode=640x480
  load_video
  insmod gfxterm
fi
terminal_output gfxterm
insmod part_msdos
insmod ext2
set root='(hd0,msdos1)'
search --no-floppy --fs-uuid --set d682c9bd-dd89-4827-9802-a1f921ebe21c
set locale_dir=($root)/boot/grub/locale
set lang=en
insmod gettext
if [ "${recordfail}" = 1 ]; then
  set timeout=-1
else
  set timeout=10
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/05_debian_theme ###
set menu_color_normal=white/black
set menu_color_highlight=black/light-gray
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/10_linux ###
menuentry 'Ubuntu, with Linux 2.6.35-28-generic' --class ubuntu --class gnu-linux --class gnu --class os {
    recordfail
    insmod part_msdos
    insmod ext2
    set root='(hd0,msdos1)'
    search --no-floppy --fs-uuid --set d682c9bd-dd89-4827-9802-a1f921ebe21c
    linux   /boot/vmlinuz-2.6.35-28-generic root=UUID=d682c9bd-dd89-4827-9802-a1f921ebe21c ro   quiet splash
    initrd  /boot/initrd.img-2.6.35-28-generic
}
menuentry 'Ubuntu, with Linux 2.6.35-28-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
    recordfail
    insmod part_msdos
    insmod ext2
    set root='(hd0,msdos1)'
    search --no-floppy --fs-uuid --set d682c9bd-dd89-4827-9802-a1f921ebe21c
    echo    'Loading Linux 2.6.35-28-generic ...'
    linux   /boot/vmlinuz-2.6.35-28-generic root=UUID=d682c9bd-dd89-4827-9802-a1f921ebe21c ro single 
    echo    'Loading initial ramdisk ...'
    initrd  /boot/initrd.img-2.6.35-28-generic
}
menuentry 'Ubuntu, with Linux 2.6.35-22-generic' --class ubuntu --class gnu-linux --class gnu --class os {
    recordfail
    insmod part_msdos
    insmod ext2
    set root='(hd0,msdos1)'
    search --no-floppy --fs-uuid --set d682c9bd-dd89-4827-9802-a1f921ebe21c
    linux   /boot/vmlinuz-2.6.35-22-generic root=UUID=d682c9bd-dd89-4827-9802-a1f921ebe21c ro   quiet splash
    initrd  /boot/initrd.img-2.6.35-22-generic
}
menuentry 'Ubuntu, with Linux 2.6.35-22-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
    recordfail
    insmod part_msdos
    insmod ext2
    set root='(hd0,msdos1)'
    search --no-floppy --fs-uuid --set d682c9bd-dd89-4827-9802-a1f921ebe21c
    echo    'Loading Linux 2.6.35-22-generic ...'
    linux   /boot/vmlinuz-2.6.35-22-generic root=UUID=d682c9bd-dd89-4827-9802-a1f921ebe21c ro single 
    echo    'Loading initial ramdisk ...'
    initrd  /boot/initrd.img-2.6.35-22-generic
}
### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/20_memtest86+ ###
menuentry "Memory test (memtest86+)" {
    insmod part_msdos
    insmod ext2
    set root='(hd0,msdos1)'
    search --no-floppy --fs-uuid --set d682c9bd-dd89-4827-9802-a1f921ebe21c
    linux16 /boot/memtest86+.bin
}
menuentry "Memory test (memtest86+, serial console 115200)" {
    insmod part_msdos
    insmod ext2
    set root='(hd0,msdos1)'
    search --no-floppy --fs-uuid --set d682c9bd-dd89-4827-9802-a1f921ebe21c
    linux16 /boot/memtest86+.bin console=ttyS0,115200n8
}
### END /etc/grub.d/20_memtest86+ ###

### BEGIN /etc/grub.d/30_os-prober ###
if [ "x${timeout}" != "x-1" ]; then
  if keystatus; then
    if keystatus --shift; then
      set timeout=-1
    else
      set timeout=0
    fi
  else
    if sleep --interruptible 3 ; then
      set timeout=0
    fi
  fi
fi
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###

### BEGIN /etc/grub.d/41_custom ###
if [ -f  $prefix/custom.cfg ]; then
  source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###

sudo fdisk-l:

Disk /dev/sda: 80.1 GB, 80060424192 bytes
255 heads, 63 sectors/track, 9733 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0008a483

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1        9352    75112448   83  Linux
/dev/sda2            9352        9734     3068929    5  Extended
/dev/sda5            9352        9734     3068928   82  Linux swap / Solaris

Disk /dev/sdb: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xc5d6c5d6

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1       60800   488375968+   7  HPFS/NTFS

命令 blkid

/dev/sda1: UUID="d682c9bd-dd89-4827-9802-a1f921ebe21c" TYPE="ext4" 
/dev/sda5: UUID="09e9c2cb-d903-4f0b-a181-536951845231" TYPE="swap" 
/dev/sdb1: UUID="B21844EB1844AFE1" TYPE="ntfs"

sudo os-prober

(没有什么)

  Boot Info Script 0.55    dated February 15th, 2010                    

============================= Boot Info Summary: ==============================

 => Grub 2 is installed in the MBR of /dev/sda and looks on the same drive in 
    partition #1 for (,msdos1)/boot/grub.
 => Grub 2 is installed in the MBR of /dev/sdb and looks on the same drive in 
    partition #1 for (,msdos1)/boot/grub.

sda1: _________________________________________________________________________

    File system:       ext4
    Boot sector type:  -
    Boot sector info:  
    Operating System:  Ubuntu 10.10
    Boot files/dirs:   /boot/grub/grub.cfg /etc/fstab /boot/grub/core.img

sda2: _________________________________________________________________________

    File system:       Extended Partition
    Boot sector type:  Unknown
    Boot sector info:  

sda5: _________________________________________________________________________

    File system:       swap
    Boot sector type:  -
    Boot sector info:  

sdb1: _________________________________________________________________________

    File system:       ntfs
    Boot sector type:  Windows XP
    Boot sector info:  No errors found in the Boot Parameter Block.
    Operating System:  Windows XP
    Boot files/dirs:   

=========================== Drive/Partition Info: =============================

Drive: sda ___________________ _____________________________________________________

Disk /dev/sda: 80.1 GB, 80060424192 bytes
255 heads, 63 sectors/track, 9733 cylinders, total 156368016 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes

Partition  Boot         Start           End          Size  Id System

/dev/sda1    *          2,048   150,226,943   150,224,896  83 Linux
/dev/sda2         150,228,990   156,366,847     6,137,858   5 Extended
/dev/sda5         150,228,992   156,366,847     6,137,856  82 Linux swap / Solaris


Drive: sdb ___________________ _____________________________________________________

Disk /dev/sdb: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes

Partition  Boot         Start           End          Size  Id System

/dev/sdb1    *             63   976,751,999   976,751,937   7 HPFS/NTFS


blkid -c /dev/null: ____________________________________________________________

Device           UUID                                   TYPE       LABEL                         

/dev/sda1        d682c9bd-dd89-4827-9802-a1f921ebe21c   ext4                                     
/dev/sda2: PTTYPE="dos" 
/dev/sda5        09e9c2cb-d903-4f0b-a181-536951845231   swap                                     
/dev/sda: PTTYPE="dos" 
/dev/sdb1        B21844EB1844AFE1                       ntfs                                     
/dev/sdb: PTTYPE="dos" 

============================ "mount | grep ^/dev  output: ===========================

Device           Mount_Point              Type       Options

/dev/sda1        /                        ext4       (rw,errors=remount-ro,commit=0)


=========================== sda1/boot/grub/grub.cfg: ===========================

#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
  set have_grubenv=true
  load_env
fi
set default="0"
if [ "${prev_saved_entry}" ]; then
  set saved_entry="${prev_saved_entry}"
  save_env saved_entry
  set prev_saved_entry=
  save_env prev_saved_entry
  set boot_once=true
fi

function savedefault {
  if [ -z "${boot_once}" ]; then
    saved_entry="${chosen}"
    save_env saved_entry
  fi
}

function recordfail {
  set recordfail=1
  if [ -n "${have_grubenv}" ]; then if [ -z "${boot_once}" ]; then save_env recordfail; fi; fi
}

function load_video {
  insmod vbe
  insmod vga
}

insmod part_msdos
insmod ext2
set root='(hd0,msdos1)'
search --no-floppy --fs-uuid --set d682c9bd-dd89-4827-9802-a1f921ebe21c
if loadfont /usr/share/grub/unicode.pf2 ; then
  set gfxmode=640x480
  load_video
  insmod gfxterm
fi
terminal_output gfxterm
insmod part_msdos
insmod ext2
set root='(hd0,msdos1)'
search --no-floppy --fs-uuid --set d682c9bd-dd89-4827-9802-a1f921ebe21c
set locale_dir=($root)/boot/grub/locale
set lang=en
insmod gettext
if [ "${recordfail}" = 1 ]; then
  set timeout=-1
else
  set timeout=10
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/05_debian_theme ###
set menu_color_normal=white/black
set menu_color_highlight=black/light-gray
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/10_linux ###
menuentry 'Ubuntu, with Linux 2.6.35-28-generic' --class ubuntu --class gnu-linux --class gnu --class os {
    recordfail
    insmod part_msdos
    insmod ext2
    set root='(hd0,msdos1)'
    search --no-floppy --fs-uuid --set d682c9bd-dd89-4827-9802-a1f921ebe21c
    linux   /boot/vmlinuz-2.6.35-28-generic root=UUID=d682c9bd-dd89-4827-9802-a1f921ebe21c ro   quiet splash
    initrd  /boot/initrd.img-2.6.35-28-generic
}
menuentry 'Ubuntu, with Linux 2.6.35-28-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
    recordfail
    insmod part_msdos
    insmod ext2
    set root='(hd0,msdos1)'
    search --no-floppy --fs-uuid --set d682c9bd-dd89-4827-9802-a1f921ebe21c
    echo    'Loading Linux 2.6.35-28-generic ...'
    linux   /boot/vmlinuz-2.6.35-28-generic root=UUID=d682c9bd-dd89-4827-9802-a1f921ebe21c ro single 
    echo    'Loading initial ramdisk ...'
    initrd  /boot/initrd.img-2.6.35-28-generic
}
menuentry 'Ubuntu, with Linux 2.6.35-22-generic' --class ubuntu --class gnu-linux --class gnu --class os {
    recordfail
    insmod part_msdos
    insmod ext2
    set root='(hd0,msdos1)'
    search --no-floppy --fs-uuid --set d682c9bd-dd89-4827-9802-a1f921ebe21c
    linux   /boot/vmlinuz-2.6.35-22-generic root=UUID=d682c9bd-dd89-4827-9802-a1f921ebe21c ro   quiet splash
    initrd  /boot/initrd.img-2.6.35-22-generic
}
menuentry 'Ubuntu, with Linux 2.6.35-22-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
    recordfail
    insmod part_msdos
    insmod ext2
    set root='(hd0,msdos1)'
    search --no-floppy --fs-uuid --set d682c9bd-dd89-4827-9802-a1f921ebe21c
    echo    'Loading Linux 2.6.35-22-generic ...'
    linux   /boot/vmlinuz-2.6.35-22-generic root=UUID=d682c9bd-dd89-4827-9802-a1f921ebe21c ro single 
    echo    'Loading initial ramdisk ...'
    initrd  /boot/initrd.img-2.6.35-22-generic
}
### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/20_memtest86+ ###
menuentry "Memory test (memtest86+)" {
    insmod part_msdos
    insmod ext2
    set root='(hd0,msdos1)'
    search --no-floppy --fs-uuid --set d682c9bd-dd89-4827-9802-a1f921ebe21c
    linux16 /boot/memtest86+.bin
}
menuentry "Memory test (memtest86+, serial console 115200)" {
    insmod part_msdos
    insmod ext2
    set root='(hd0,msdos1)'
    search --no-floppy --fs-uuid --set d682c9bd-dd89-4827-9802-a1f921ebe21c
    linux16 /boot/memtest86+.bin console=ttyS0,115200n8
}
### END /etc/grub.d/20_memtest86+ ###

### BEGIN /etc/grub.d/30_os-prober ###
if [ "x${timeout}" != "x-1" ]; then
  if keystatus; then
    if keystatus --shift; then
      set timeout=-1
    else
      set timeout=0
    fi
  else
    if sleep --interruptible 3 ; then
      set timeout=0
    fi
  fi
fi
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.
menuentry "Windows XP" {
set root=(hd1,1)
chainloader (hd1,1)+1
}
### END /etc/grub.d/40_custom ###

### BEGIN /etc/grub.d/41_custom ###
if [ -f  $prefix/custom.cfg ]; then
  source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###

=============================== sda1/etc/fstab: ===============================

# /etc/fstab: static file system information.
#
# Use 'blkid -o value -s UUID' to print the universally unique identifier
# for a device; this may be used with UUID= as a more robust way to name
# devices that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
proc            /proc           proc    nodev,noexec,nosuid 0       0
/dev/sda1       /               ext4    errors=remount-ro 0       1
# swap was on /dev/sda5 during installation
UUID=09e9c2cb-d903-4f0b-a181-536951845231 none            swap    sw              0       0

=================== sda1: Location of files loaded by Grub: ===================


  51.7GB: boot/grub/core.img
  58.5GB: boot/grub/grub.cfg
   1.2GB: boot/initrd.img-2.6.35-22-generic
   1.3GB: boot/initrd.img-2.6.35-28-generic
  58.2GB: boot/vmlinuz-2.6.35-22-generic
  51.7GB: boot/vmlinuz-2.6.35-28-generic
   1.3GB: initrd.img
   1.2GB: initrd.img.old
  51.7GB: vmlinuz
  58.2GB: vmlinuz.old
=========================== Unknown MBRs/Boot Sectors/etc =======================

Unknown BootLoader  on sda2

00000000  d9 ed 13 ab ff a8 33 8c  01 b2 47 99 e1 4a b1 f1  |......3...G..J..|
00000010  69 5f a7 29 a4 1a 03 9e  31 b9 45 02 71 e6 58 78  |i_.)....1.E.q.Xx|
00000020  3d f6 ee 7b 3e 33 1b 82  c6 7d cf 1a c8 e7 bc 2f  |=..{>3...}...../|
00000030  b9 e1 70 75 cf 18 aa e7  d5 7e 3c f1 b4 e7 9e 3a  |..pu.....~<....:|
00000040  55 38 f1 b4 ee 78 59 0b  5e f7 3c 4c 57 73 9c 2a  |U8...xY.^.<LWs.*|
00000050  28 f1 19 ed 11 9c b2 19  e2 80 92 1c 7b 84 ee 0b  |(...........{...|
00000060  e2 c0 ac af 0a 50 42 b9  cf 0c dc 2c 20 77 85 dc  |.....PB...., w..|
00000070  8f 70 5f 7b 84 9b a1 f7  8c 2d ee 70 5c ae f7 39  |.p_{.....-.p\..9|
00000080  63 f7 09 8a ec 79 4c ed  9f cc ad 3c f8 1b 47 7d  |c....yL....<..G}|
00000090  3f 97 d5 16 cb 29 45 38  25 61 36 08 de 10 93 0f  |?....)E8%a6.....|
000000a0  95 4f ea 54 f9 89 ff f1  bf 9a cc bb fd b6 22 b1  |.O.T..........".|
000000b0  65 08 05 21 78 19 46 b0  24 7e fb de d4 b3 ba d6  |e..!x.F.$~......|
000000c0  ec 11 65 82 ee 10 1d 12  04 91 da 6d 67 47 ea 9b  |..e........mgG..|
000000d0  6f b0 aa fb cb 67 10 64  86 e8 26 85 fb f9 50 77  |o....g.d..&...Pw|
000000e0  9d 13 9b 9e d9 11 f3 a1  50 1b 11 b7 93 79 9f ab  |........P....y..|
000000f0  c1 b6 86 0f 35 ed d4 9f  dc f8 db bd ed 45 3a 68  |....5........E:h|
00000100  54 68 4a 1d d1 fc b8 c9  72 b4 d7 7b 60 e7 39 2f  |ThJ.....r..{`.9/|
00000110  2a 0a 4e 52 72 52 c6 e2  2a 55 6a 2a e1 82 40 71  |*.NRrR..*Uj*..@q|
00000120  11 11 e0 53 d6 ff 1b a9  c6 65 df 1e b7 15 6f a2  |...S.....e....o.|
00000130  15 02 a4 6d 19 b7 78 57  a6 ee 9e 36 08 7d 6f 7c  |...m..xW...6.}o||
00000140  fd f7 7c d5 40 ff 0f c7  97 dc aa 00 ce 8b bb dc  |..|.@...........|
00000150  e2 eb 1c 50 74 d8 14 cc  9a d6 5c a2 ab f2 67 f9  |...Pt.....\...g.|
00000160  58 ed 43 79 0e 78 7a 5c  a6 f8 7b e8 05 4e 62 8a  |X.Cy.xz\..{..Nb.|
00000170  0a 5f 22 ee a6 38 b9 e1  32 45 97 08 cc 75 66 c6  |._"..8..2E...uf.|
00000180  b3 a2 2d 89 a1 e9 95 21  28 53 fd dd be b1 b2 a2  |..-....!(S......|
00000190  78 3f a3 c9 3d e3 31 54  88 cf 78 0d e1 21 a8 74  |x?..=.1T..x..!.t|
000001a0  06 60 9d 21 c6 7a 24 e1  cc 28 f8 98 e0 99 e3 fc  |.`.!.z$..(......|
000001b0  fa 8b eb d5 56 03 20 b8  54 ba c6 ee 9f 57 00 fe  |....V. .T....W..|
000001c0  ff ff 82 fe ff ff 02 00  00 00 00 a8 5d 00 00 00  |............]...|
000001d0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*
000001f0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 55 aa  |..............U.|
00000200

答案1

Grub 必须安装在计算机的硬盘上靴子,无论您要运行哪种操作系统。这意味着在 BIOS 中设置为第一启动设备的硬盘。

您的 BIOS 可能设置为启动您的“二手”驱动器,其中 Ubuntu 可能是启动分区,从而完全跳过 grub。

因此,我的提示是:

  • 进入 BIOS。通常这意味着在启动时按 DEL 或 F2 或其他键。正确的键取决于您的计算机/品牌/型号。通常当 PC 启动时,会出现类似“按 XXX 进行 BIOS 设置”的文本

  • 在 BIOS 设置屏幕上,尝试找到您的启动选项。它们的位置也取决于您的计算机/品牌/型号。确保选择您的第一个硬盘作为您的第一个启动设备。保存设置并退出。

  • 现在,在该硬盘上安装 grub(通常是 /dev/sda)。如下所示:

    grub 安装 /dev/sda

  • 如果在切换硬盘启动顺序后无法启动 Ubuntu,请改回以前的设置(这样您就可以重新启动 Ubuntu)。现在您的第一个硬盘(具有 XP 分区的硬盘)可能已经启动/dev/sbd。只需使用上述命令替换星展银行为了安全数据库。现在返回 BIOS 并再次更改启动顺序

如果需要,我可以为您提供更详细的说明。请告诉我您的计算机(或主板)品牌和型号,以便我可以指导您使用 BIOS 键和菜单。此外,请发布以下内容:

gedit /boot/grub/grub.cfg
sudo fdisk -l
sudo blkid

希望有帮助!

更新:

从您发布的所有文件中,我有两个理论:

1- grub-install 警告提示我实际上没有安装。阅读这里有关 FlexNet 和 Grub 的精彩解释。FlexNet 看起来像一个许可证管理器,具有反盗版保护功能,可将数据写入 grub 用于其多重引导代码的 MBR 空间中。因此,您的 XP 中可能有一些依赖于 FlexNet 的软件,而 Grub 拒绝覆盖它,因此拒绝自行安装。同一链接包含有关如何修复该问题的信息。

如果 MBR 上未安装 grub,您的硬盘将以传统方式启动:第一个硬盘中标记为可启动的分区。这意味着 Ubuntu(检查 fdisk 的 /dev/sda1 是否标记为启动分区)

2- 另外,您的 grub.cfg 不会显示 Windows XP,好像 os-prober 没有找到它。(请查看您的### BEGIN /etc/grub.d/30_os-prober ###部分。它应该是这样的(只是一个例子):

### BEGIN /etc/grub.d/30_os-prober ###
menuentry "Microsoft Windows XP Professional (on /dev/sdb1)" {
    savedefault
    insmod part_msdos
    insmod ntfs
    set root='(hd1,msdos1)'
    search --no-floppy --fs-uuid --set 485083315dc8e22a
    drivemap -s (hd1) ${root}
    chainloader +1
}
### END /etc/grub.d/30_os-prober ###

相反,您的系统没有菜单项。不知何故,grub 在扫描您的驱动器时没有“找到”您的 XP 分区,或者认为它不是一个有效的操作系统。

因此,由于 grub 菜单除了 Ubuntu 之外没有其他操作系统,它会自动跳过菜单并直接启动到您的第一个(也是唯一的,根据他的说法)操作系统。您可以在 POST 后立即按住 SHIFT 键来强制 grub 显示菜单。但是,同样,它只会有 Ubuntu(和 memtest、以前的内核和恢复模式),而不是 XP。


因此,要么 grub 未安装(当它找到 FlexNet 并静默中止时,它会重新安装),要么已安装,但由于只有 Ubuntu,它会绕过菜单。或者两者兼而有之。任何一种都可以使 Ubuntu 启动。

现在让我们检查并修正这两个理论:

1

  • grub 是否真的安装在了 上/dev/sda?启动时按住 SHIFT,菜单就会显示出来,而不会被绕过。如果没有显示,则 grub 实际上没有安装。通过从 MBR 中删除 FlexNet 代码来执行此操作(上面的同一链接有操作说明)。然后安装 grub 并检查是否没有警告。

  • 请记住,从 MBR 中擦除 FlexNet 将导致其依赖的软件无法运行

2

您的 XP 安装有效吗?在单操作系统环境中,它是否可以在没有 grub 的情况下启动?不知何故,grub 的 OS Prober 不这么认为。让我们测试一下:

  • 在 Ubuntu 中,使用 gParted 将其分区标记为 BOOT(右键单击分区 -> 标志 -> 选中 BOOT)

  • 另外,尝试安装您的 XP 分区(在 Nautilus 中双击它)并检查它是否正常。查看它的boot.ini文件。应该是这样的:

    [引导加载程序] 超时 = 30 默认值 = 多 (0) 磁盘 (0) rdisk (0) 分区 (1) \WINDOWS [操作系统] 多 (0) 磁盘 (0) rdisk (0) 分区 (1) \WINDOWS="Microsoft Windows XP Professional" /noexecute=optin /fastdetect /usepmtimer

  • 断开 Ubuntu HD。只保留 XP。设置 BIOS 以启动它。尝试看看 XP 是否能工作(可能现在还不行,但谁知道呢?)

  • 使用任何 Windows 可启动 CD/USB/软盘,使用视窗(不是 Linux!)fdisk /mbr清除 grub。不要担心,grub 只需要放在 /dev/sda(您的第一个硬盘)中,因为完成后它将返回到 /dev/sdb,所以该硬盘上不需要 grub。

  • 现在试试。它应该可以工作。不行?然后使用 XP 启动 CD 修复该安装。如果这是您唯一连接的 HD,并且 XP 是唯一的操作系统,分区标记为启动,具有清理过的 MBR 和修复过的安装,它必须启动,否则以后 grub 将无法为您提供太多帮助...

成功了?太棒了!重新连接另一个(Ubuntu)硬盘,像以前一样设置它(在 BIOS 中作为启动硬盘),启动 Ubuntu 并grub-install /dev/sda再次运行。操作系统探测器现在应该可以检测到 XP,并且列表中有 2 个操作系统,启动时将显示菜单。

哇,答案好长啊。你还有很多作业要做。希望一切顺利。祝你好运!

答案2

sdb1: ______________________________________________________________________

    File system:       ntfs
    Boot sector type:  Windows XP
    Boot sector info:  No errors found in the Boot Parameter Block.
    Operating System:  Windows XP
    Boot files/dirs:   

以上部分来自您的启动信息脚本输出。对于有效的 Windows XP 安装,最后一行应该是

    Boot files/dirs:   /boot.ini /ntldr /NTDETECT.COM

您的 Windows 分区似乎没有 Windows 启动所需的文件。这就是 os-prober 未检测到任何 Windows 安装的原因,这也意味着 GRUB 无法执行任何操作来启动 Windows。

如果不知道这些文件丢失的原因,我无法帮助解决问题。你知道它们为什么会丢失吗?

答案3

从第二个硬盘启动(或者任何有 GRUB 的磁盘)

我的客用 PC 也遇到了同样的问题。当我打开它时,它就像任何单分区 PC 一样立即进入 XP。

当我想要 Ubuntu 时,我会在 POST 时进入启动选择,并选择我的第二个硬盘驱动器,然后加载 GRUB。

所以这实际上取决于您如何在 MBR 等帐户中进行设置。

相关内容