Author Topic: (Solved) Grub messed up - not booting Windows  (Read 1463 times)

Offline Hallvor

  • Sr. Member
  • ****
  • Posts: 304
(Solved) Grub messed up - not booting Windows
« on: January 29, 2010, 02:35:02 PM »
My netbook was working just perfectly yesterday, but I just had to mess with it until it broke.

This is an Acer Aspire One A 150 that came with Windows XP. I defragmented the drive and shrinked the windows partition.

I then installed PCLinuxOS, but it didn`t suspend properly. So I gave Debian a spin. Not a good idea. Basically it left everything unbootable from Grub. Now I am back on PCLinuxOS, and though it works, I would like to be able to boot into Windows as well. But something is wrong. I get a grub 15 error, that basically means that Grub can`t see the partition.

Here are my partitions:

Code: [Select]
[root@localhost ~]# df
Filesystem            Size  Used Avail Use% Mounted on
/dev/root             489M  1.7M  487M   1% /
/dev/sda1             3.8G  1.6G  2.2G  42% /mnt/win_c
/dev/sdb1             5.9G  3.8G  2.1G  65% /mnt/win_d
/dev/sdb6              20G  2.2G   17G  12% /mnt/sdb6
/dev/sdb7             101G  188M   96G   1% /mnt/sdb7
[root@localhost ~]# /sbin/fdisk -l

Disk /dev/sda: 4008 MB, 4008706048 bytes <---- this is just the USB stick I am booting from.
5 heads, 32 sectors/track, 48934 cylinders
Units = cylinders of 160 * 512 = 81920 bytes
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *          51       48935     3910720    b  W95 FAT32

Disk /dev/sdb: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x11a8ba38

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *           1         764     6136798+  12  Compaq diagnostics
/dev/sdb2             765        3240    19888470    7  HPFS/NTFS
/dev/sdb3            3241       19457   130263052+   5  Extended
/dev/sdb5            3241        3514     2200873+  82  Linux swap / Solaris
/dev/sdb6            3515        6112    20868403+  83  Linux
/dev/sdb7            6113       19457   107193681   83  Linux
[root@localhost ~]#

I am not sure what sdb1 is. sdb2 and sdb3 is probably a Windows recovery partition and the Windows partition - but I don`t know which is what. sdb5 is swap, sdb6 is PCLinuxOS and sdb7 is just an empty data partition.

Any ideas?



« Last Edit: January 30, 2010, 02:07:51 PM by Hallvor »

Offline Old-Polack

  • Administrator
  • Super Villain
  • *****
  • Posts: 11521
  • ----IOFLU----
Re: Grub messed up - not booting Windows
« Reply #1 on: January 29, 2010, 03:40:58 PM »
My netbook was working just perfectly yesterday, but I just had to mess with it until it broke.

This is an Acer Aspire One A 150 that came with Windows XP. I defragmented the drive and shrinked the windows partition.

I then installed PCLinuxOS, but it didn`t suspend properly. So I gave Debian a spin. Not a good idea. Basically it left everything unbootable from Grub. Now I am back on PCLinuxOS, and though it works, I would like to be able to boot into Windows as well. But something is wrong. I get a grub 15 error, that basically means that Grub can`t see the partition.

Here are my partitions:

Code: [Select]
[root@localhost ~]# df
Filesystem            Size  Used Avail Use% Mounted on
/dev/root             489M  1.7M  487M   1% /
/dev/sda1             3.8G  1.6G  2.2G  42% /mnt/win_c
/dev/sdb1             5.9G  3.8G  2.1G  65% /mnt/win_d
/dev/sdb6              20G  2.2G   17G  12% /mnt/sdb6
/dev/sdb7             101G  188M   96G   1% /mnt/sdb7
[root@localhost ~]# /sbin/fdisk -l

Disk /dev/sda: 4008 MB, 4008706048 bytes <---- this is just the USB stick I am booting from.
5 heads, 32 sectors/track, 48934 cylinders
Units = cylinders of 160 * 512 = 81920 bytes
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *          51       48935     3910720    b  W95 FAT32

Disk /dev/sdb: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x11a8ba38

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *           1         764     6136798+  12  Compaq diagnostics
/dev/sdb2             765        3240    19888470    7  HPFS/NTFS
/dev/sdb3            3241       19457   130263052+   5  Extended
/dev/sdb5            3241        3514     2200873+  82  Linux swap / Solaris
/dev/sdb6            3515        6112    20868403+  83  Linux
/dev/sdb7            6113       19457   107193681   83  Linux
[root@localhost ~]#

I am not sure what sdb1 is. sdb2 and sdb3 is probably a Windows recovery partition and the Windows partition - but I don`t know which is what. sdb5 is swap, sdb6 is PCLinuxOS and sdb7 is just an empty data partition.

Any ideas?


It would be more likely that /dev/sdb1 is your recovery partition, because it says it is, /dev/sdb2 is your Windows installation, which should be flagged active/bootable, but isn't, and dev/sdb3 is the extended partition, that acts as a container for the logical partitions it contains... /dev/sdb5 - /dev/sdb7.

If /dev/sdb6 is the Linux / partition, you need to mount it, most likely at /mnt/sdb6 on your liveUSB key, and cat /mnt/sdb6/boot/grub/menu.lst to show us it's contents.

[root@localhost ~]# mount /dev/sdb6          <Enter>

[root@localhost ~]# cat /mnt/sdb6/boot/grub/menu.lst            <Enter>

Post your results.
Old-Polack

Of what use be there for joy, if not for the sharing thereof?



Lest we forget...

Offline Hallvor

  • Sr. Member
  • ****
  • Posts: 304
Re: Grub messed up - not booting Windows
« Reply #2 on: January 29, 2010, 04:28:09 PM »
Thank you. I did a reinstall and I am able to boot the recovery partition called Windows1 (where you only can restore the factory defaults), but not Windows.

Code: [Select]
[root@localhost ~]# cat /mnt/sdb6/boot/grub/menu.lst
timeout 10
color black/cyan yellow/cyan
default 0

title linux
kernel (hd0,5)/boot/vmlinuz BOOT_IMAGE=linux root=UUID=9c67842c-d28c-4cfc-80ec-65b6df5746e4  acpi=on resume=UUID=2f230b89-7587-4654-8d08-3de676d34398
initrd (hd0,5)/boot/initrd.img

title failsafe
kernel (hd0,5)/boot/vmlinuz BOOT_IMAGE=failsafe root=UUID=9c67842c-d28c-4cfc-80ec-65b6df5746e4  failsafe acpi=on
initrd (hd0,5)/boot/initrd.img

title windows
root (hd1,0)
map (0x81) (0x80)
map (0x80) (0x81)
makeactive
chainloader +1

title windows1
root (hd0,0)
makeactive
chainloader +1
[root@localhost ~]#
« Last Edit: January 29, 2010, 04:37:27 PM by old-polack »

Offline Old-Polack

  • Administrator
  • Super Villain
  • *****
  • Posts: 11521
  • ----IOFLU----
Re: Grub messed up - not booting Windows
« Reply #3 on: January 29, 2010, 04:43:21 PM »
Thank you. I did a reinstall and I am able to boot the recovery partition called Windows1 (where you only can restore the factory defaults), but not Windows.

Code: [Select]
[root@localhost ~]# cat /mnt/sdb6/boot/grub/menu.lst
timeout 10
color black/cyan yellow/cyan
default 0

title linux
kernel (hd0,5)/boot/vmlinuz BOOT_IMAGE=linux root=UUID=9c67842c-d28c-4cfc-80ec-65b6df5746e4  acpi=on resume=UUID=2f230b89-7587-4654-8d08-3de676d34398
initrd (hd0,5)/boot/initrd.img

title failsafe
kernel (hd0,5)/boot/vmlinuz BOOT_IMAGE=failsafe root=UUID=9c67842c-d28c-4cfc-80ec-65b6df5746e4  failsafe acpi=on
initrd (hd0,5)/boot/initrd.img

title windows
root (hd1,0)
map (0x81) (0x80)
map (0x80) (0x81)
makeactive
chainloader +1

title windows1
root (hd0,0)
makeactive
chainloader +1
[root@localhost ~]#


Your Windows stanza should be;

title Windows
rootnoverify (hd0,1)
makeactive
chainloader +1


What you have in your menu.lst, currently, is the Windows stanza for having Windows on the first partition of a second hard drive.
Old-Polack

Of what use be there for joy, if not for the sharing thereof?



Lest we forget...

Offline Hallvor

  • Sr. Member
  • ****
  • Posts: 304
Re: Grub messed up - not booting Windows
« Reply #4 on: January 30, 2010, 12:50:23 AM »
Thank you. I am making progress. But grub now gives me a "Filesystem type unknown" error and tells me to push ctrl+alt+delete.

I did search the web for a solution, but I must be too thick. Is it possible with a little handholding so solve this?

Thanks again.

Edit: Found this and will try the solution there and report back.

http://www.pclinuxos.com/forum/index.php/topic,62760.0.html
« Last Edit: January 30, 2010, 01:08:04 AM by Hallvor »

Offline Hallvor

  • Sr. Member
  • ****
  • Posts: 304
Re: Grub messed up - not booting Windows
« Reply #5 on: January 30, 2010, 01:29:04 AM »
That didn`t solve the problem. I now get a disk read error:

Code: [Select]
Booting 'windows'

rootnoverify (hd0,1)
map (0x81) (0x80)
map (0x80) (0x81)
makeactive
chainloader +1

A disk read error occurred
Press Ctrl+Alt+Del to restart

I don`t understand it. I even made a system recovery without any error.
« Last Edit: January 30, 2010, 01:37:36 AM by Hallvor »

Offline Was_Just19

  • Hero Member
  • *****
  • Posts: 6852
  • MLU
Re: Grub messed up - not booting Windows
« Reply #6 on: January 30, 2010, 03:32:06 AM »

Your Windows stanza should be;

title Windows
rootnoverify (hd0,1)
makeactive
chainloader +1


What you have in your menu.lst, currently, is the Windows stanza for having Windows on the first partition of a second hard drive.

I don't use Windows but would it not be necessary to mark this partition as bootable first to allow Windows to boot?

Offline Hallvor

  • Sr. Member
  • ****
  • Posts: 304
Re: (Solved) Grub messed up - not booting Windows
« Reply #7 on: January 30, 2010, 02:07:07 PM »
Solved it by changing the grub entry to

Code: [Select]
title Microsoft Windows
root (hd0,1)
savedefault
makeactive
chainloader +1

And then it booted!!! :)

Offline Old-Polack

  • Administrator
  • Super Villain
  • *****
  • Posts: 11521
  • ----IOFLU----
Re: Grub messed up - not booting Windows
« Reply #8 on: January 30, 2010, 02:16:41 PM »
That didn`t solve the problem. I now get a disk read error:

Code: [Select]
Booting 'windows'

rootnoverify (hd0,1)
map (0x81) (0x80)
map (0x80) (0x81)
makeactive
chainloader +1

A disk read error occurred
Press Ctrl+Alt+Del to restart

I don`t understand it. I even made a system recovery without any error.

That doesn't work because of the remapping done by the map lines. They are only used when Windows is on a separate drive, not on the same drive with Linux.
Old-Polack

Of what use be there for joy, if not for the sharing thereof?



Lest we forget...

Offline Old-Polack

  • Administrator
  • Super Villain
  • *****
  • Posts: 11521
  • ----IOFLU----
Re: (Solved) Grub messed up - not booting Windows
« Reply #9 on: January 30, 2010, 02:19:52 PM »
Solved it by changing the grub entry to

Code: [Select]
title Microsoft Windows
root (hd0,1)
savedefault
makeactive
chainloader +1

And then it booted!!! :)

Which is, except for the savedefault line, the stanza I gave you. The savedefault line has nothing to do with finding the right partition and booting it. The other lines do that.
Old-Polack

Of what use be there for joy, if not for the sharing thereof?



Lest we forget...

Offline Hallvor

  • Sr. Member
  • ****
  • Posts: 304
Re: (Solved) Grub messed up - not booting Windows
« Reply #10 on: January 30, 2010, 02:26:32 PM »
Man, I am blind. I only noticed the change in the noverify line. Good thing I am not working with computers for a living.

Thanks for your help and patience.  :D

Offline Old-Polack

  • Administrator
  • Super Villain
  • *****
  • Posts: 11521
  • ----IOFLU----
Re: (Solved) Grub messed up - not booting Windows
« Reply #11 on: January 30, 2010, 02:30:51 PM »
Man, I am blind. I only noticed the change in the noverify line. Good thing I am not working with computers for a living.

Thanks for your help and patience.  :D

Just as long as you are not working as an artillery spotter, while I'm anywhere down range, calling for a support barrage. ;D ;D ;D

The rootnoverify line is to keep grub from trying to read the ntfs file system, which it can't do, and reporting an error because of that. Sometimes root (hdn,n) works, other times rootnoverify is necessary. Better to include it and avoid the problem.
« Last Edit: January 30, 2010, 02:35:22 PM by old-polack »
Old-Polack

Of what use be there for joy, if not for the sharing thereof?



Lest we forget...

Offline Hallvor

  • Sr. Member
  • ****
  • Posts: 304
Re: (Solved) Grub messed up - not booting Windows
« Reply #12 on: January 30, 2010, 02:34:26 PM »
 :D :D :D