LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Can't boot Windows Xp from GRUB (https://www.linuxquestions.org/questions/linux-newbie-8/cant-boot-windows-xp-from-grub-667920/)

Ubuntu213 09-06-2008 04:04 AM

Can't boot Windows Xp from GRUB
 
Hello,
I'm a newbie in informatics and Linux.
I'd deleted a disk partition with Ubuntu in my machine and GRUB was installed there.
Since this, I had been unable to load GRUB.
I restored it using fdisk -l and then I updated menu.lst and fstab and finally Ubuntu runs ok from GRUB. (I'd installed my mistake linux in two different disk partitions).
However, I have another partition with FreeDOS and Windows Xp and both OSes doesn't boot.
When I try to run FreeDOS a message apperas telling me there is no kernel and when I try to start Windows appears the login screen with the Windows logo for an instant and then a blue screen and my laptop reboots.
I access both Windows Xp and FreeDOS through a sub menu inside FreeDOS option in GRUB selection screen.

This is my menu.lst output:
Code:

# menu.lst - See: grub(8), info grub, update-grub(8)
#            grub-install(8), grub-floppy(8),
#            grub-md5-crypt, /usr/share/doc/grub
#            and /usr/share/doc/grub-doc/.

## default num
# Set the default entry to the entry number NUM. Numbering starts from 0, and
# the entry number 0 is the default if the command is not used.
#
# You can specify 'saved' instead of a number. In this case, the default entry
# is the entry saved with the command 'savedefault'.
# WARNING: If you are using dmraid do not use 'savedefault' or your
# array will desync and will not let you boot your system.
default                0

## timeout sec
# Set a timeout, in SEC seconds, before automatically booting the default entry
# (normally the first entry defined).
timeout                10

## hiddenmenu
# Hides the menu by default (press ESC to see the menu)
#hiddenmenu

# Pretty colours
#color cyan/blue white/blue

## password ['--md5'] passwd
# If used in the first section of a menu file, disable all interactive editing
# control (menu entry editor and command-line)  and entries protected by the
# command 'lock'
# e.g. password topsecret
#      password --md5 $1$gLhU0/$aW78kHK1QfV3P2b2znUoe/
# password topsecret

#
# examples
#
# title                Windows 95/98/NT/2000
# root                (hd0,0)
# makeactive
# chainloader        +1
#
# title                Linux
# root                (hd0,1)
# kernel        /vmlinuz root=/dev/hda2 ro
#

#
# Put static boot stanzas before and/or after AUTOMAGIC KERNEL LIST

### BEGIN AUTOMAGIC KERNELS LIST
## lines between the AUTOMAGIC KERNELS LIST markers will be modified
## by the debian update-grub script except for the default options below

## DO NOT UNCOMMENT THEM, Just edit them to your needs

## ## Start Default Options ##
## default kernel options
## default kernel options for automagic boot options
## If you want special options for specific kernels use kopt_x_y_z
## where x.y.z is kernel version. Minor versions can be omitted.
## e.g. kopt=root=/dev/hda1 ro
##      kopt_2_6_8=root=/dev/hdc1 ro
##      kopt_2_6_8_2_686=root=/dev/hdc2 ro
# kopt=root=UUID=ebafbbfd-15dc-48fe-9007-a8b9c11f6561 ro

## Setup crashdump menu entries
## e.g. crashdump=1
# crashdump=0

## default grub root device
## e.g. groot=(hd0,0)
# groot=(hd0,5)

## should update-grub create alternative automagic boot options
## e.g. alternative=true
##      alternative=false
# alternative=true

## should update-grub lock alternative automagic boot options
## e.g. lockalternative=true
##      lockalternative=false
# lockalternative=false

## additional options to use with the default boot option, but not with the
## alternatives
## e.g. defoptions=vga=791 resume=/dev/hda5
# defoptions=quiet splash

## should update-grub lock old automagic boot options
## e.g. lockold=false
##      lockold=true
# lockold=false

## Xen hypervisor options to use with the default Xen boot option
# xenhopt=

## Xen Linux kernel options to use with the default Xen boot option
# xenkopt=console=tty0

## altoption boot targets option
## multiple altoptions lines are allowed
## e.g. altoptions=(extra menu suffix) extra boot options
##      altoptions=(recovery) single
# altoptions=(recovery mode) single

## controls how many kernels should be put into the menu.lst
## only counts the first occurence of a kernel, not the
## alternative kernel options
## e.g. howmany=all
##      howmany=7
# howmany=all

## should update-grub create memtest86 boot option
## e.g. memtest86=true
##      memtest86=false
# memtest86=true

## should update-grub adjust the value of the default booted system
## can be true or false
# updatedefaultentry=false

## should update-grub add savedefault to the default options
## can be true or false
# savedefault=false

## ## End Default Options ##

title                Ubuntu 8.04.1, kernel 2.6.24-19-generic
root                (hd0,5)
kernel                /boot/vmlinuz-2.6.24-19-generic root=UUID=ebafbbfd-15dc-48fe-9007-a8b9c11f6561 ro quiet splash
initrd                /boot/initrd.img-2.6.24-19-generic
quiet

title                Ubuntu 8.04.1, kernel 2.6.24-19-generic (recovery mode)
root                (hd0,5)
kernel                /boot/vmlinuz-2.6.24-19-generic root=UUID=ebafbbfd-15dc-48fe-9007-a8b9c11f6561 ro single
initrd                /boot/initrd.img-2.6.24-19-generic

title                Ubuntu 8.04.1, memtest86+
root                (hd0,5)
kernel                /boot/memtest86+.bin
quiet

### END DEBIAN AUTOMAGIC KERNELS LIST

# This is a divider, added to separate the menu items below from the Debian
# ones.
title                Other operating systems:
root


# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/sda1
title                FreeDOS
root                (hd0,0)
savedefault
makeactive
chainloader        +1


# This entry automatically added by the Debian installer for an existing
# linux installation on /dev/sda5.
title                Ubuntu 8.04.1, kernel 2.6.24-19-generic (on /dev/sda5)
root                (hd0,4)
kernel                /boot/vmlinuz-2.6.24-19-generic root=UUID=f30d3f49-0065-4a2a-8e7c-bee0209e3114 ro quiet splash
initrd                /boot/initrd.img-2.6.24-19-generic
savedefault
boot


# This entry automatically added by the Debian installer for an existing
# linux installation on /dev/sda5.
title                Ubuntu 8.04.1, kernel 2.6.24-19-generic (recovery mode) (on /dev/sda5)
root                (hd0,4)
kernel                /boot/vmlinuz-2.6.24-19-generic root=UUID=f30d3f49-0065-4a2a-8e7c-bee0209e3114 ro single
initrd                /boot/initrd.img-2.6.24-19-generic
savedefault
boot


# This entry automatically added by the Debian installer for an existing
# linux installation on /dev/sda5.
title                Ubuntu 8.04.1, memtest86+ (on /dev/sda5)
root                (hd0,4)
kernel                /boot/memtest86+.bin 
savedefault
boot

This is my fstab output:
Code:

# /etc/fstab: static file system information.
#
# <file system> <mount point>  <type>  <options>      <dump>  <pass>
proc            /proc          proc    defaults        0      0
# /dev/sda7
UUID=ebafbbfd-15dc-48fe-9007-a8b9c11f6561 /              ext3    relatime,errors=remount-ro 0      1
# /dev/sda8
UUID=32ea0950-e984-4748-9171-ecbdbcc5de53 none            swap    sw              0      0
/dev/scd0      /media/cdrom0  udf,iso9660 user,noauto,exec,utf8 0      0

Thanks in advance.

Simon Bridge 09-06-2008 05:49 AM

[quote]Hello,[quote]Gudday - it helps if you edit your profile to show your distro and location. Thanks.
Quote:

I'm a newbie in informatics and Linux.
I'd deleted a disk partition with Ubuntu in my machine and GRUB was installed there.
Which Ubuntu?
[quote]Since this, I had been unable to load GRUB.[quote]Yep - deleting GRUB will do that.
Quote:

I restored it using fdisk -l
Restored what? GRUB? The partition? How would that command be expected to restore anything deleted?
Quote:

and then I updated menu.lst and fstab and finally Ubuntu runs ok from GRUB.
How did you go about updating these files?[quote] (I'd installed my mistake linux in two different disk partitions).[quote]Better tell us about your partitioning scheme. Please post the output of fdisk -l.
Quote:

However, I have another partition with FreeDOS and Windows Xp and both OSes doesn't boot.
Both on the same partition?!
Quote:

When I try to run FreeDOS a message apperas telling me there is no kernel
Quote exact message.
Quote:

and when I try to start Windows appears the login screen with the Windows logo for an instant and then a blue screen and my laptop reboots.
BSOD? Or just blue? But you got past the splash screen?
Quote:

I access both Windows Xp and FreeDOS through a sub menu inside FreeDOS option in GRUB selection screen.
OK - lets look at the code...

fstab only shows root and swap - presumably for ubuntu. What is the output of fdisk -l?

Code:

title                Ubuntu 8.04.1, kernel 2.6.24-19-generic
root                (hd0,5)

... this is telling me to expect ubuntu boot directory on sda6, fstab reports ubuntu root on sda7 and does not display sda6.

Code:

# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/sda1
title                FreeDOS
root                (hd0,0)
savedefault
makeactive
chainloader        +1

... that root line should read "rootnoverify" - AFAIK: FreeDOS does not have a unix kernel. Is FreeDOS really in sda1? Windows usually likes to be there.

You have two sets of entries for Ubuntu, in two places. If you have only one installation of Ubuntu, delete the entries which do not apply.

There is no entry for Windows in the menu.lst supplied.

The information supplied is not consistent. Please correct this.

Ubuntu213 09-06-2008 10:17 AM

Hello,

Quote:

Which Ubuntu?
I use Ubuntu 8.04 Hardy Heron.

Quote:

Restored what? GRUB? The partition? How would that command be expected to restore anything deleted?
Quote:

How did you go about updating these files? (I'd installed my mistake linux in two different disk partitions). Better tell us about your partitioning scheme. Please post the output of fdisk -l.
I'm sorry, I used fdisk -l in order to know what partition I have Ubuntu installed. I have it installed in hd(0,5).
Then I typed...
Code:

sudo grub
root (hd0, 5)
setup (hd0)
quit

...in order to make GRUB work again (GURB had error 22). The message before type this was "GRUB loading, please wait... Error 22".

This is my fdisk -l output:
Code:

Disk /dev/sda: 250.0 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x7b3dd090

  Device Boot      Start        End      Blocks  Id  System
/dev/sda1  *          1      12158    97659103+  c  W95 FAT32 (LBA)
/dev/sda2          12159      30401  146536897+  5  Extended
/dev/sda5          29656      30401    5992213+  82  Linux swap / Solaris
/dev/sda6          12159      29655  140544589+  83  Linux

Partition table entries are not in disk order

Quote:

Both on the same partition?!
I bought my laptop with both Windows XP Professional and FreeDOS installed so I assumed Xp and FreeDOS are located in the same disk partition. I'm a newbie in informatics and I can be wrong.
However I don't mind if I cannot run FreeDOS again, actually I've never used it. I'm principally interested in be able to use Windows again.

Quote:

Quote exact message.
The exact message when I try to load FreeDOS is "loading FreeDOS No KERNEL SYS".

Quote:

BSOD? Or just blue? But you got past the splash screen?
The blue screen appears for a very small amount of time and I'm totally unable to read it but there are some text in it and a row of numbers in the last line. I'd never got this blue screen.

Quote:

fstab reports Ubuntu root on sda7 and does not display sda6.
How to fix it?

Quote:

... that root line should read "rootnoverify" - AFAIK: FreeDOS does not have a unix kernel. Is FreeDOS really in sda1? Windows usually likes to be there.
Code:

# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/sda1
title                FreeDOS
root                (hd0,0)
savedefault
makeactive
chainloader        +1

I will change root for rootnoverify and I will post what happens.

Quote:

You have two sets of entries for Ubuntu, in two places. If you have only one installation of Ubuntu, delete the entries which do not apply.

There is no entry for Windows in the menu.lst supplied.
I will delete them and post menu.lst output. I dunno how ro make a correctly a Windows entry.

Thanks

Ubuntu213 09-06-2008 10:30 AM

This is menu.lst with unneeded entries deleted.

Code:

# menu.lst - See: grub(8), info grub, update-grub(8)
#            grub-install(8), grub-floppy(8),
#            grub-md5-crypt, /usr/share/doc/grub
#            and /usr/share/doc/grub-doc/.

## default num
# Set the default entry to the entry number NUM. Numbering starts from 0, and
# the entry number 0 is the default if the command is not used.
#
# You can specify 'saved' instead of a number. In this case, the default entry
# is the entry saved with the command 'savedefault'.
# WARNING: If you are using dmraid do not use 'savedefault' or your
# array will desync and will not let you boot your system.
default                0

## timeout sec
# Set a timeout, in SEC seconds, before automatically booting the default entry
# (normally the first entry defined).
timeout                10

## hiddenmenu
# Hides the menu by default (press ESC to see the menu)
#hiddenmenu

# Pretty colours
#color cyan/blue white/blue

## password ['--md5'] passwd
# If used in the first section of a menu file, disable all interactive editing
# control (menu entry editor and command-line)  and entries protected by the
# command 'lock'
# e.g. password topsecret
#      password --md5 $1$gLhU0/$aW78kHK1QfV3P2b2znUoe/
# password topsecret

#
# examples
#
# title                Windows 95/98/NT/2000
# root                (hd0,0)
# makeactive
# chainloader        +1
#
# title                Linux
# root                (hd0,1)
# kernel        /vmlinuz root=/dev/hda2 ro
#

#
# Put static boot stanzas before and/or after AUTOMAGIC KERNEL LIST

### BEGIN AUTOMAGIC KERNELS LIST
## lines between the AUTOMAGIC KERNELS LIST markers will be modified
## by the debian update-grub script except for the default options below

## DO NOT UNCOMMENT THEM, Just edit them to your needs

## ## Start Default Options ##
## default kernel options
## default kernel options for automagic boot options
## If you want special options for specific kernels use kopt_x_y_z
## where x.y.z is kernel version. Minor versions can be omitted.
## e.g. kopt=root=/dev/hda1 ro
##      kopt_2_6_8=root=/dev/hdc1 ro
##      kopt_2_6_8_2_686=root=/dev/hdc2 ro
# kopt=root=UUID=ebafbbfd-15dc-48fe-9007-a8b9c11f6561 ro

## Setup crashdump menu entries
## e.g. crashdump=1
# crashdump=0

## default grub root device
## e.g. groot=(hd0,0)
# groot=(hd0,5)

## should update-grub create alternative automagic boot options
## e.g. alternative=true
##      alternative=false
# alternative=true

## should update-grub lock alternative automagic boot options
## e.g. lockalternative=true
##      lockalternative=false
# lockalternative=false

## additional options to use with the default boot option, but not with the
## alternatives
## e.g. defoptions=vga=791 resume=/dev/hda5
# defoptions=quiet splash

## should update-grub lock old automagic boot options
## e.g. lockold=false
##      lockold=true
# lockold=false

## Xen hypervisor options to use with the default Xen boot option
# xenhopt=

## Xen Linux kernel options to use with the default Xen boot option
# xenkopt=console=tty0

## altoption boot targets option
## multiple altoptions lines are allowed
## e.g. altoptions=(extra menu suffix) extra boot options
##      altoptions=(recovery) single
# altoptions=(recovery mode) single

## controls how many kernels should be put into the menu.lst
## only counts the first occurence of a kernel, not the
## alternative kernel options
## e.g. howmany=all
##      howmany=7
# howmany=all

## should update-grub create memtest86 boot option
## e.g. memtest86=true
##      memtest86=false
# memtest86=true

## should update-grub adjust the value of the default booted system
## can be true or false
# updatedefaultentry=false

## should update-grub add savedefault to the default options
## can be true or false
# savedefault=false

## ## End Default Options ##

title                Ubuntu 8.04.1, kernel 2.6.24-19-generic
root                (hd0,5)
kernel                /boot/vmlinuz-2.6.24-19-generic root=UUID=ebafbbfd-15dc-48fe-9007-a8b9c11f6561 ro quiet splash
initrd                /boot/initrd.img-2.6.24-19-generic
quiet

title                Ubuntu 8.04.1, kernel 2.6.24-19-generic (recovery mode)
root                (hd0,5)
kernel                /boot/vmlinuz-2.6.24-19-generic root=UUID=ebafbbfd-15dc-48fe-9007-a8b9c11f6561 ro single
initrd                /boot/initrd.img-2.6.24-19-generic

title                Ubuntu 8.04.1, memtest86+
root                (hd0,5)
kernel                /boot/memtest86+.bin
quiet

### END DEBIAN AUTOMAGIC KERNELS LIST

# This is a divider, added to separate the menu items below from the Debian
# ones.
title                Other operating systems:
root


# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/sda1
title                FreeDOS
rootnoverify                (hd0,0)
savedefault
makeactive
chainloader        +1

Quote:

... that root line should read "rootnoverify" - AFAIK: FreeDOS does not have a unix kernel. Is FreeDOS really in sda1? Windows usually likes to be there.
I've made the change but it have not solved the problem and when I try to use FreeDOS appears the same message again ("loading FreeDOS No KERNEL SYS").

Thanks

Simon Bridge 09-11-2008 12:53 AM

[url=http://en.wikipedia.org/wiki/Blue_Screen_of_Death]This is what a BSOD looks like.[/quote]

Looking at fstab -l output, sda1 a fat32 partition, which would normally be Windows XP. The following entry should boot WinXP happily.

title Windows XP
root (hd0,0)
savedefault
makeactive
chainloader +1

Though I'd normally prefer a rootnoverify but, apparently, grub is smart enough these days.

savedefault is only needed if you want XP to be the default boot option. Recommend you try doing your routine work in Ubuntu and do a special boot only for those annoying 'dows-only things. It will quickly become a preference. (I take it there is no problem booting and running ubuntu?)

The puzzle is that this entry is identical to your one for freedos. (The title makes no difference). That GRUB entry will set the root partition to sda1 (C:\) then pass the boot process to whatever is there to catch it.

I suspect there is a bootloader there which would normally allow you to choose between XP and FreeDOS - is this correct?

Ubuntu213 09-12-2008 05:24 AM

Quote:

I suspect there is a bootloader there which would normally allow you to choose between XP and FreeDOS - is this correct?
You're right there were a bootloader (NTFS) in Windows and FreeDos partition. So the problem was in NTFS (it was not a GRUB issue).
I've had to format the partition and reinstall Windows.
Thanks everybody.

Simon Bridge 09-12-2008 12:08 PM

Niggle - NTFS is not a bootloader. It's a file-system.
But... well done on your solution. I think...


All times are GMT -5. The time now is 04:39 PM.