Witam. Dotychczas na komputerze miałem zainstalowanego Windowsa 7 Home Premium (trzy partycje podstawowe - zastrzeżona przez system, systemowa oraz przeznaczona na dane). Niestety byłem zmuszony utworzyć dodatkową partycję (podstawową) przeznaczoną na Windowsa XP Home Edition. Po zainstalowaniu program rozruchowy Windowsa XP oczywiście nie widzi siódemki. Dlatego utworzyłem trzy partycje logiczne na Debiana (/, /home, swap), który w trakcie instalacji odnalazł niby Windowsa 7. Niestety, owa siódemka to tak naprawdę XP. W jaki sposób mogę dodać Windowsa 7 do GRUBa?
Nie mam Windowsa 7 zainstalowanego, więc Ci nie pomogę. Jedyne, co moge polecić, to wyszukać w internecie to, jak odpalić Windowsa 7 z GRUB-a 2 i wyedytować odpowiednie pliki konfiguracyjne. Jeżeli nie będziesz aktualizować Debiana, to możesz wyedytować /boot/grub2/grub.cfg.
Próbowałem dodać system poprzez edycję pliku /etc/grub.d/40_custom, wpisując następującą zawartość:
#!/bin/sh
exec tail -n +3 $0
# 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 7"
{
set root=(hd0,5)
chainloader +1
}
Niestety, przy próbie startu z tej opcji, wyświetla się błąd dotyczący fragmentu “set root=(hd0”.
Ile i jakich partycji (systemów) masz ostatecznie.
Łącznie mam 4 partycje podstawowe (wszystkie NTFS, na jednej z nich Windows 7 HP, a innej Windows XP HE) i jedną rozszerzoną z trzema logicznymi (dwa razy ext4, swap).
Z tego, co kojarzę, to Linux dopuszcza cztery partycje bezpośrednio zaszyte w MBR, z czego jedna może być rozszerzona. Zastanawiam się, jak to osiągnąłeś, bo chyba MBR ma miejsce tylko na cztery partycje. Masz MBR-a czy coś innego?
Pokaż może tutaj cały plik /boot/grub2/grub.cfg - nie będziemy go edytować - tylko chcę zobaczyć jego zawartość, bo np. może jakiś moduł być wczytywany w innych opcjach rozruchu, który musi być wczytany również w tym.
W /boot/grub2/i386-pc mam dwa moduły: ntfscomp.mod ntfs.mod. Pewnie jeden lub drugi musi zostać załadowany.
Oto wynik skryptu:
Boot Info Script 0.61 [1 April 2012]
============================= Boot Info Summary: ===============================
= Grub2 (v1.99) is installed in the MBR of /dev/sda and looks at sector 1 of
the same hard drive for core.img. core.img is at this location and looks
in partition 135 for .
sda1: __________________________________________________________________________
File system: ntfs
Boot sector type: Windows XP: NTFS
Boot sector info: No errors found in the Boot Parameter Block.
Operating System:
Boot files: /boot.ini /bootmgr /Boot/BCD /ntldr /NTDETECT.COM
sda2: __________________________________________________________________________
File system: ntfs
Boot sector type: Windows Vista/7: NTFS
Boot sector info: No errors found in the Boot Parameter Block.
Operating System: Windows 7
Boot files: /Windows/System32/winload.exe
sda3: __________________________________________________________________________
File system: ntfs
Boot sector type: Windows Vista/7: NTFS
Boot sector info: No errors found in the Boot Parameter Block.
Operating System:
Boot files:
sda4: __________________________________________________________________________
File system: Extended Partition
Boot sector type: Unknown
Boot sector info:
sda5: __________________________________________________________________________
File system: ntfs
Boot sector type: Windows XP: NTFS
Boot sector info: According to the info in the boot sector, sda5 starts
at sector 63.
Operating System: Windows XP
Boot files:
sda6: __________________________________________________________________________
File system: ext4
Boot sector type: -
Boot sector info:
Operating System: Debian GNU/Linux 8
Boot files: /boot/grub/grub.cfg /etc/fstab
sda7: __________________________________________________________________________
File system: swap
Boot sector type: -
Boot sector info:
sda8: __________________________________________________________________________
File system: ext4
Boot sector type: -
Boot sector info:
Operating System:
Boot files:
============================ Drive/Partition Info: =============================
Drive: sda _____________________________________________________________________
Dysk /dev/sda: 465,8 GiB, bajtów: 500107862016, sektorów: 976773168
Jednostki: sektorów, czyli 1 * 512 = 512 bajtów
Rozmiar sektora (logiczny/fizyczny) w bajtach: 512 / 512
Rozmiar we/wy (minimalny/optymalny) w bajtach: 512 / 512
Partition Boot Start Sector End Sector # of Sectors Id System
/dev/sda1 * 2,048 206,847 204,800 7 NTFS / exFAT / HPFS
/dev/sda2 206,848 209,715,199 209,508,352 7 NTFS / exFAT / HPFS
/dev/sda3 209,715,200 894,849,023 685,133,824 7 NTFS / exFAT / HPFS
/dev/sda4 894,852,691 976,771,071 81,918,381 f W95 Extended (LBA)
/dev/sda5 894,852,693 915,335,504 20,482,812 7 NTFS / exFAT / HPFS
/dev/sda6 915,337,216 934,866,943 19,529,728 83 Linux
/dev/sda7 934,868,992 942,680,063 7,811,072 82 Linux swap / Solaris
/dev/sda8 942,682,112 976,771,071 34,088,960 83 Linux
"blkid" output: ________________________________________________________________
Device UUID TYPE LABEL
/dev/sda1 DA363F2C363F0951 ntfs Zastrzeżone przez system
/dev/sda2 FEC65323C652DC09 ntfs
/dev/sda3 98EE167FEE1655BA ntfs
/dev/sda5 2A58C40F58C3D829 ntfs
/dev/sda6 9cad1756-ebc3-4384-9a56-2e095a443e40 ext4
/dev/sda7 c1886648-108c-4be5-95d5-73a24dde154c swap
/dev/sda8 d2678f50-fb53-41f6-ab93-0ffbf4f3d6e6 ext4
================================ Mount points: =================================
Device Mount_Point Type Options
/dev/sda6 / ext4 (rw,relatime,errors=remount-ro,data=ordered)
/dev/sda8 /home ext4 (rw,relatime,data=ordered)
================================ sda1/boot.ini: ================================
--------------------------------------------------------------------------------
[boot loader]
timeout=30
default=multi(0)disk(0)rdisk(0)partition(4)\WINDOWS
[operating systems]
multi(0)disk(0)rdisk(0)partition(4)\WINDOWS="Microsoft Windows XP Home Edition" /noexecute=optin /fastdetect /usepmtimer
--------------------------------------------------------------------------------
=========================== sda6/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
if ["${next_entry}"] ; then
set default="${next_entry}"
set next_entry=
save_env next_entry
set boot_once=true
else
set default="0"
fi
if [x"${feature_menuentry_id}" = xy]; then
menuentry_id_option="--id"
else
menuentry_id_option=""
fi
export menuentry_id_option
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 load_video {
if [x$feature_all_video_module = xy]; then
insmod all_video
else
insmod efi_gop
insmod efi_uga
insmod ieee1275_fb
insmod vbe
insmod vga
insmod video_bochs
insmod video_cirrus
fi
}
if [x$feature_default_font_path = xy] ; then
font=unicode
else
insmod part_msdos
insmod ext2
set root='hd0,msdos6'
if [x$feature_platform_search_hint = xy]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos6 --hint-efi=hd0,msdos6 --hint-baremetal=ahci0,msdos6 9cad1756-ebc3-4384-9a56-2e095a443e40
else
search --no-floppy --fs-uuid --set=root 9cad1756-ebc3-4384-9a56-2e095a443e40
fi
font="/usr/share/grub/unicode.pf2"
fi
if loadfont $font ; then
set gfxmode=auto
load_video
insmod gfxterm
set locale_dir=$prefix/locale
set lang=pl_PL
insmod gettext
fi
terminal_output gfxterm
if ["${recordfail}" = 1] ; then
set timeout=-1
else
if [x$feature_timeout_style = xy] ; then
set timeout_style=menu
set timeout=5
# Fallback normal timeout code in case the timeout_style feature is
# unavailable.
else
set timeout=5
fi
fi
### END /etc/grub.d/00_header ###
### BEGIN /etc/grub.d/05_debian_theme ###
insmod part_msdos
insmod ext2
set root='hd0,msdos6'
if [x$feature_platform_search_hint = xy]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos6 --hint-efi=hd0,msdos6 --hint-baremetal=ahci0,msdos6 9cad1756-ebc3-4384-9a56-2e095a443e40
else
search --no-floppy --fs-uuid --set=root 9cad1756-ebc3-4384-9a56-2e095a443e40
fi
insmod png
if background_image /usr/share/images/desktop-base/lines-grub.png; then
set color_normal=white/black
set color_highlight=black/white
else
set menu_color_normal=cyan/blue
set menu_color_highlight=white/blue
fi
### END /etc/grub.d/05_debian_theme ###
### BEGIN /etc/grub.d/10_linux ###
function gfxmode {
set gfxpayload="${1}"
}
set linux_gfx_mode=
export linux_gfx_mode
menuentry 'Debian GNU/Linux' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-9cad1756-ebc3-4384-9a56-2e095a443e40' {
load_video
insmod gzio
if [x$grub_platform = xxen]; then insmod xzio; insmod lzopio; fi
insmod part_msdos
insmod ext2
set root='hd0,msdos6'
if [x$feature_platform_search_hint = xy]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos6 --hint-efi=hd0,msdos6 --hint-baremetal=ahci0,msdos6 9cad1756-ebc3-4384-9a56-2e095a443e40
else
search --no-floppy --fs-uuid --set=root 9cad1756-ebc3-4384-9a56-2e095a443e40
fi
echo 'Wczytywanie systemu Linux 3.16.0-4-amd64...'
linux /boot/vmlinuz-3.16.0-4-amd64 root=UUID=9cad1756-ebc3-4384-9a56-2e095a443e40 ro quiet
echo 'Wczytywanie początkowego dysku RAM...'
initrd /boot/initrd.img-3.16.0-4-amd64
}
submenu 'Opcje zaawansowane dla systemu Debian GNU/Linux' $menuentry_id_option 'gnulinux-advanced-9cad1756-ebc3-4384-9a56-2e095a443e40' {
menuentry 'Debian GNU/Linux, za pomocą systemu Linux 3.16.0-4-amd64' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.16.0-4-amd64-advanced-9cad1756-ebc3-4384-9a56-2e095a443e40' {
load_video
insmod gzio
if [x$grub_platform = xxen]; then insmod xzio; insmod lzopio; fi
insmod part_msdos
insmod ext2
set root='hd0,msdos6'
if [x$feature_platform_search_hint = xy]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos6 --hint-efi=hd0,msdos6 --hint-baremetal=ahci0,msdos6 9cad1756-ebc3-4384-9a56-2e095a443e40
else
search --no-floppy --fs-uuid --set=root 9cad1756-ebc3-4384-9a56-2e095a443e40
fi
echo 'Wczytywanie systemu Linux 3.16.0-4-amd64...'
linux /boot/vmlinuz-3.16.0-4-amd64 root=UUID=9cad1756-ebc3-4384-9a56-2e095a443e40 ro quiet
echo 'Wczytywanie początkowego dysku RAM...'
initrd /boot/initrd.img-3.16.0-4-amd64
}
menuentry 'Debian GNU/Linux, with Linux 3.16.0-4-amd64 (recovery mode)' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.16.0-4-amd64-recovery-9cad1756-ebc3-4384-9a56-2e095a443e40' {
load_video
insmod gzio
if [x$grub_platform = xxen]; then insmod xzio; insmod lzopio; fi
insmod part_msdos
insmod ext2
set root='hd0,msdos6'
if [x$feature_platform_search_hint = xy]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos6 --hint-efi=hd0,msdos6 --hint-baremetal=ahci0,msdos6 9cad1756-ebc3-4384-9a56-2e095a443e40
else
search --no-floppy --fs-uuid --set=root 9cad1756-ebc3-4384-9a56-2e095a443e40
fi
echo 'Wczytywanie systemu Linux 3.16.0-4-amd64...'
linux /boot/vmlinuz-3.16.0-4-amd64 root=UUID=9cad1756-ebc3-4384-9a56-2e095a443e40 ro single
echo 'Wczytywanie początkowego dysku RAM...'
initrd /boot/initrd.img-3.16.0-4-amd64
}
}
### END /etc/grub.d/10_linux ###
### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###
### BEGIN /etc/grub.d/30_os-prober ###
menuentry 'Windows 7 (loader) (na /dev/sda1)' --class windows --class os $menuentry_id_option 'osprober-chain-DA363F2C363F0951' {
insmod part_msdos
insmod ntfs
set root='hd0,msdos1'
if [x$feature_platform_search_hint = xy]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 DA363F2C363F0951
else
search --no-floppy --fs-uuid --set=root DA363F2C363F0951
fi
parttool ${root} hidden-
chainloader +1
}
### END /etc/grub.d/30_os-prober ###
### BEGIN /etc/grub.d/30_uefi-firmware ###
### END /etc/grub.d/30_uefi-firmware ###
### 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=(hd0, 5)
chainloader +1
}
### END /etc/grub.d/40_custom ###
### BEGIN /etc/grub.d/41_custom ###
if [-f ${config_directory}/custom.cfg]; then
source ${config_directory}/custom.cfg
elif [-z "${config_directory}" -a -f $prefix/custom.cfg]; then
source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###
--------------------------------------------------------------------------------
=============================== sda6/etc/fstab: ================================
--------------------------------------------------------------------------------
# /etc/fstab: static file system information.
#
# Use 'blkid' 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
# / was on /dev/sda6 during installation
UUID=9cad1756-ebc3-4384-9a56-2e095a443e40 / ext4 errors=remount-ro 0 1
# /home was on /dev/sda8 during installation
UUID=d2678f50-fb53-41f6-ab93-0ffbf4f3d6e6 /home ext4 defaults 0 2
# swap was on /dev/sda7 during installation
UUID=c1886648-108c-4be5-95d5-73a24dde154c none swap sw 0 0
/dev/sr0 /media/cdrom0 udf,iso9660 user,noauto 0 0
--------------------------------------------------------------------------------
=================== sda6: Location of files loaded by Grub: ====================
GiB - GB File Fragment(s)
======================== Unknown MBRs/Boot Sectors/etc: ========================
Unknown BootLoader on sda4
00000000 a3 22 82 a0 2c 02 9e 56 3e c0 60 34 db 26 30 8f |."..,..V.`4.0.|
00000010 91 ba e6 c2 c3 3f 13 86 dd 91 60 e0 e1 84 b0 da |.....?....`.....|
00000020 03 77 80 25 6a 6f 0e 80 7c 8c 6f 11 1b 6f c3 41 |.w.%jo..|.o..o.A|
00000030 4e c0 49 47 22 aa 5d 23 46 9d 34 68 32 69 8b 58 |N.IG".]#F.4h2i.X|
00000040 15 e3 94 c5 e6 c8 67 ec 8c 9a 74 bf 5f 45 bc c2 |......g...t._E..|
00000050 17 37 fa a5 31 2b 8f d4 0f 9a a4 3e bf 94 fc 7e |.7..1+........~|
00000060 c2 1c c8 ca 77 a1 3d 82 70 88 9a ef 90 13 88 1b |....w.=.p.......|
00000070 07 f1 a9 73 9d cd 15 53 cf 4b 2d c5 43 10 d7 f2 |...s...S.K-.C...|
00000080 2a 21 37 47 8b 52 48 75 56 da d5 e8 4f af a1 fd |*!7G.RHuV...O...|
00000090 a3 a6 a8 82 29 bb 3b b5 91 38 cb 8f 73 49 94 b1 |....).;..8..sI..|
000000a0 9b 59 53 8d f7 15 ca 64 45 cc 9f 7e 1b 7f 84 b9 |.YS....dE..~....|
000000b0 f0 87 ba 32 28 5a 1f a9 77 fd fd 03 3d df b3 b3 |...2(Z..w...=...|
000000c0 eb 07 41 09 c4 32 35 99 bc c1 60 b7 14 90 ff bd |..A..25...`.....|
000000d0 9d 95 ca b8 42 9f 0c 9e 7a b7 84 42 27 85 5b 2e |....B...z..B'.[.|
000000e0 83 6b 76 ec 00 66 31 bc dc ac 0b 6c 59 19 c7 67 |.kv..f1....lY..g|
000000f0 86 24 29 4c 0a 53 f4 62 1b 0b cd 1c a7 e9 9d c4 |.$)L.S.b........|
00000100 a4 5f 2e e2 ff 6c e9 17 25 93 fc 7e 3f 9d 10 19 |._...l..%..~?...|
00000110 03 3d eb 32 b0 67 aa 98 f3 a7 45 a9 60 cc e7 c4 |.=.2.g....E.`...|
00000120 bd 9d 91 f2 62 64 ee ee 0a ca 25 59 25 7c a3 c1 |....bd....%Y%|..|
00000130 4a e1 11 92 c0 7f da b6 63 9c 92 03 11 7f ec 95 |J.......c.......|
00000140 43 d2 b9 80 3c 66 29 06 c6 04 d1 ed 85 00 43 1a |C...f).......C.|
00000150 c9 03 42 c4 85 2d 4c 83 06 48 ae 52 59 4f 86 cf |..B..-L..H.RYO..|
00000160 03 28 ca 34 e9 99 9a ec dc 69 56 f3 74 7f b8 16 |.(.4.....iV.t...|
00000170 5a ab 94 0d f7 2a e6 80 c0 cf f3 50 d8 d7 9a eb |Z....*.....P....|
00000180 42 75 9b 3c bf dd 61 2a 75 45 b9 60 22 81 72 df |Bu...a*uE.`".r.|
00000190 ec 34 d1 e1 e9 be 69 a9 cb 4e b7 1d d8 20 9f 12 |.4....i..N... ..|
000001a0 f5 1e 30 f5 bc 75 de b5 6d 66 59 2c 16 43 75 c2 |..0..u..mfY,.Cu.|
000001b0 a7 13 7e 16 8e 1e ee 6f c1 c9 d1 98 d4 5c 00 01 |..~....o.....\..|
000001c0 c1 ff 07 fe ff ff 02 00 00 00 fc 8a 38 01 00 fe |............8...|
000001d0 ff ff 05 fe ff ff fe 8a 38 01 af 06 2a 01 00 00 |........8...*...|
000001e0 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
=============================== StdErr Messages: ===============================
cat: /tmp/BootInfo-7YyTHQon/Tmp_Log: Nie ma takiego pliku ani katalogu