GRUB + Windows 7 = Restart

Questions about Grub, UEFI,the liveCD and the installer
Forum rules
Before you post please read how to get help
Post Reply
MaTi
Level 1
Level 1
Posts: 5
Joined: Mon May 14, 2012 4:15 pm

GRUB + Windows 7 = Restart

Post by MaTi »

I installed Linux Mint 12 x64 today, on the same hard disk as my Widnows 7 installation. While booting into Linux works fine, whenever I select Windows 7 in GRUB menu it just restarts my computer. No errors - nothing. Resintalling default Windows 7 bootlader from Windows DVD allows me to boot Windows again, so my Windows installation is definetly still intact.

I have two hard disks:
first - connected to 5th SATA port, on which both OSes are installed
second - connected to 6th SATA port, with no OSes. Disconnecting this drive does not solve the problem.

Earlier today I have also installed Fedora 16, and had exactly the same problem, so it is most likely GRUB-related issue.

Output from "fdisk -l":

Code: Select all

Disk /dev/sda: 250.1 GB, 250058268160 bytes
255 heads, 63 sectors/track, 30401 cylinders, total 488395055 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xd82bfef4

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *   381802496   488392703    53295104    7  HPFS/NTFS/exFAT
/dev/sda2           16126   381802495   190893185    f  W95 Ext'd (LBA)
/dev/sda5           16128   161196209    80590041    7  HPFS/NTFS/exFAT
/dev/sda6       161196273   273265649    56034688+   7  HPFS/NTFS/exFAT
/dev/sda7       273265713   336754529    31744408+   7  HPFS/NTFS/exFAT
/dev/sda8       336754688   342614015     2929664   82  Linux swap / Solaris
/dev/sda9       342616064   381802495    19593216   83  Linux

Partition table entries are not in disk order

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
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xd69b6171

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *       16065   976768064   488376000    f  W95 Ext'd (LBA)
/dev/sdb5           16128   322360289   161172081    7  HPFS/NTFS/exFAT
/dev/sdb6       322360353   649572209   163605928+   7  HPFS/NTFS/exFAT
/dev/sdb7       649572273   976768064   163597896    7  HPFS/NTFS/exFAT
My grub.cfg:

Code: Select all

#
# 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 video_bochs
  insmod video_cirrus
}

insmod part_msdos
insmod ext2
set root='(hd0,msdos9)'
search --no-floppy --fs-uuid --set=root 00f8b30a-bcf5-4fcc-9b29-4263855cace6
if loadfont /usr/share/grub/unicode.pf2 ; then
  set gfxmode=auto
  load_video
  insmod gfxterm
  insmod part_msdos
  insmod ext2
  set root='(hd0,msdos9)'
  search --no-floppy --fs-uuid --set=root 00f8b30a-bcf5-4fcc-9b29-4263855cace6
  set locale_dir=($root)/boot/grub/locale
  set lang=en_US
  insmod gettext
fi
terminal_output gfxterm
if [ "${recordfail}" = 1 ]; then
  set timeout=10
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
if background_color 0,0,0; then
  clear
fi
### END /etc/grub.d/05_debian_theme ###

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

### BEGIN /etc/grub.d/10_linux ###
if [ ${recordfail} != 1 ]; then
  if [ -e ${prefix}/gfxblacklist.txt ]; then
    if hwmatch ${prefix}/gfxblacklist.txt 3; then
      if [ ${match} = 0 ]; then
        set linux_gfx_mode=keep
      else
        set linux_gfx_mode=text
      fi
    else
      set linux_gfx_mode=text
    fi
  else
    set linux_gfx_mode=keep
  fi
else
  set linux_gfx_mode=text
fi
export linux_gfx_mode
if [ "$linux_gfx_mode" != "text" ]; then load_video; fi
menuentry 'Linux Mint 12 64-bit, 3.0.0-12-generic (/dev/sda9)' --class linuxmint --class gnu-linux --class gnu --class os {
	recordfail
	set gfxpayload=$linux_gfx_mode
	insmod gzio
	insmod part_msdos
	insmod ext2
	set root='(hd0,msdos9)'
	search --no-floppy --fs-uuid --set=root 00f8b30a-bcf5-4fcc-9b29-4263855cace6
	linux	/boot/vmlinuz-3.0.0-12-generic root=UUID=00f8b30a-bcf5-4fcc-9b29-4263855cace6 ro   quiet splash vt.handoff=7
	initrd	/boot/initrd.img-3.0.0-12-generic
}
menuentry 'Linux Mint 12 64-bit, 3.0.0-12-generic (/dev/sda9) -- recovery mode' --class linuxmint --class gnu-linux --class gnu --class os {
	recordfail
	insmod gzio
	insmod part_msdos
	insmod ext2
	set root='(hd0,msdos9)'
	search --no-floppy --fs-uuid --set=root 00f8b30a-bcf5-4fcc-9b29-4263855cace6
	echo	'Loading Linux 3.0.0-12-generic ...'
	linux	/boot/vmlinuz-3.0.0-12-generic root=UUID=00f8b30a-bcf5-4fcc-9b29-4263855cace6 ro recovery nomodeset 
	echo	'Loading initial ramdisk ...'
	initrd	/boot/initrd.img-3.0.0-12-generic
}
### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/10_lupin ###
### END /etc/grub.d/10_lupin ###

### 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,msdos9)'
	search --no-floppy --fs-uuid --set=root 00f8b30a-bcf5-4fcc-9b29-4263855cace6
	linux16	/boot/memtest86+.bin
}
menuentry "Memory test (memtest86+, serial console 115200)" {
	insmod part_msdos
	insmod ext2
	set root='(hd0,msdos9)'
	search --no-floppy --fs-uuid --set=root 00f8b30a-bcf5-4fcc-9b29-4263855cace6
	linux16	/boot/memtest86+.bin console=ttyS0,115200n8
}
### END /etc/grub.d/20_memtest86+ ###

### BEGIN /etc/grub.d/30_os-prober ###
menuentry "Windows 7 (loader) (on /dev/sda1)" --class windows --class os {
	insmod part_msdos
	insmod ntfs
	set root='(hd0,msdos1)'
	search --no-floppy --fs-uuid --set=root 6AF80BDAF80BA403
	chainloader +1
}
### 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 ###
I have no idea how to solve this problem. Thank you in advance for any help.
HughT
Level 5
Level 5
Posts: 625
Joined: Thu Oct 20, 2011 1:54 pm
Location: England

Re: GRUB + Windows 7 = Restart

Post by HughT »

have you tried

Code: Select all

sudo update-grub
Please Edit your post title and add [SOLVED] once your question is resolved.
MaTi
Level 1
Level 1
Posts: 5
Joined: Mon May 14, 2012 4:15 pm

Re: GRUB + Windows 7 = Restart

Post by MaTi »

I haven't, but after I executed it now the problem still persists. Here is the output from update-grub:

Code: Select all

Generating grub.cfg ...
Found linux image: /boot/vmlinuz-3.0.0-12-generic
Found initrd image: /boot/initrd.img-3.0.0-12-generic
Found memtest86+ image: /boot/memtest86+.bin
Found Windows 7 (loader) on /dev/sda1
done
mintybits
Level 6
Level 6
Posts: 1123
Joined: Fri Jan 27, 2012 5:09 pm

Re: GRUB + Windows 7 = Restart

Post by mintybits »

I assume you installed grub to sda? Try recovering Windows MBR again and then installing grub to sdb. Then boot sdb.
This will avoid any problems that may be arising in the MBR area.
MaTi
Level 1
Level 1
Posts: 5
Joined: Mon May 14, 2012 4:15 pm

Re: GRUB + Windows 7 = Restart

Post by MaTi »

How do I do that? Doesn't GRUB need to be installed on the same partition as Mint?
User avatar
Shibblet
Level 2
Level 2
Posts: 55
Joined: Thu Feb 10, 2011 6:29 pm

Re: GRUB + Windows 7 = Restart

Post by Shibblet »

Check my post here about how to install for Windows 7.
My "Second" option works the best for me.

http://forums.linuxmint.com/viewtopic.php?f=46&t=102097
Holy Cripes on Toast!
Attention is the currency of internet forums. - ticopelp
MaTi
Level 1
Level 1
Posts: 5
Joined: Mon May 14, 2012 4:15 pm

Re: GRUB + Windows 7 = Restart

Post by MaTi »

That... was simple. Thanks a lot, EasyBCD worked like a charm.
User avatar
Shibblet
Level 2
Level 2
Posts: 55
Joined: Thu Feb 10, 2011 6:29 pm

Re: GRUB + Windows 7 = Restart

Post by Shibblet »

MaTi wrote:That... was simple. Thanks a lot, EasyBCD worked like a charm.
Word my Brizzo.... (You're Welcome.)
Holy Cripes on Toast!
Attention is the currency of internet forums. - ticopelp
mintybits
Level 6
Level 6
Posts: 1123
Joined: Fri Jan 27, 2012 5:09 pm

Re: GRUB + Windows 7 = Restart

Post by mintybits »

MaTi wrote:How do I do that? Doesn't GRUB need to be installed on the same partition as Mint?
No. Grub can be installed to the MBR of any bootable device.
You select it in the "something else" section of the installer or if already running Mint by "sudo dpkg-reconfigure grub-pc".
mintybits
Level 6
Level 6
Posts: 1123
Joined: Fri Jan 27, 2012 5:09 pm

Re: GRUB + Windows 7 = Restart

Post by mintybits »

Shibblet wrote:Check my post here about how to install for Windows 7.
My "Second" option works the best for me.

http://forums.linuxmint.com/viewtopic.php?f=46&t=102097
Unfortunately, there is a reliability issue when Grub is installed to a PBR rather than the MBR. I have done this myself and it works perfectly for a while but if anything causes the sector location of grubs files in /boot to be moved, grub will stop working. It's a sort of unpredictable thing. If grub were updated, say, then it would probably break because any changes to its files will move them. It's a shame because this would otherwise be by far the best place to install it. :?
User avatar
Shibblet
Level 2
Level 2
Posts: 55
Joined: Thu Feb 10, 2011 6:29 pm

Re: GRUB + Windows 7 = Restart

Post by Shibblet »

mintybits wrote:
Shibblet wrote:Check my post here about how to install for Windows 7.
My "Second" option works the best for me.

http://forums.linuxmint.com/viewtopic.php?f=46&t=102097
Unfortunately, there is a reliability issue when Grub is installed to a PBR rather than the MBR. I have done this myself and it works perfectly for a while but if anything causes the sector location of grubs files in /boot to be moved, grub will stop working. It's a sort of unpredictable thing. If grub were updated, say, then it would probably break because any changes to its files will move them. It's a shame because this would otherwise be by far the best place to install it. :?
That's true. You can always make a /boot partition in your Linux partition, as well as a /swap and /home if you need to.
Holy Cripes on Toast!
Attention is the currency of internet forums. - ticopelp
mintybits
Level 6
Level 6
Posts: 1123
Joined: Fri Jan 27, 2012 5:09 pm

Re: GRUB + Windows 7 = Restart

Post by mintybits »

Shibblet wrote:
mintybits wrote:That's true. You can always make a /boot partition in your Linux partition, as well as a /swap and /home if you need to.
Unfortunately... :wink:
...it doesn't matter whether the boot directory is in root or in a separate partition. The problem is really with the ext file-system format. There are only two sectors of space before the fs starts, which is no where near enough for the full Grub, which consumes over 50 sectors (and over 62 if you add mdadm and LVM modules - which borks some peoples' new installs if their first partition starts at 63 which it will if they have used "Disk Utility" to make it!!! Nowadays, Windows starts at 2048). A Grub that fits in 2 sectors cannot read the ext fs so it must be told the sector where the /boot/core.img file starts. This is the same issue whether the boot is in a separate partition or not.

Now, not all linux fs formats have this limitation. reiserfs has plenty of space to fit a full grub and you can install Mint on reiserfs or make a separate boot partition in reiserfs. Problem solved? Erm...no. For reasons that are unknown to me the Grub designers deliberately prevent Grub from installing itself fully in a reiserfs partition. When I first found this out I had a Homer Simpson moment. I am supposing they didn't have the time to test it. But what a missed opportunity because then Grub would exist entirely inside a linux partition and would be perfectly reliable and would not mess with the MBR area of the disk.

Ironically, for GPT they have had to face this issue because there is no "no mans land" gap at the start of the disk and have defined a special grub boot partition which does not contain ext at all. I think it would be helpful if they made this possible in MBR disks too. I don't know why they haven't.
User avatar
Shibblet
Level 2
Level 2
Posts: 55
Joined: Thu Feb 10, 2011 6:29 pm

Re: GRUB + Windows 7 = Restart

Post by Shibblet »

mintybits wrote:...it doesn't matter whether the boot directory is in root or in a separate partition. The problem is really with the ext file-system format.
All I know, is I've never had issues with having grub installed into its own directory, and using EasyBCD to adjust the Windows Bootloader.
Holy Cripes on Toast!
Attention is the currency of internet forums. - ticopelp
Post Reply

Return to “Installation & Boot”