LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-12-2009, 07:27 PM   #1
SBFree
Member
 
Registered: Nov 2004
Distribution: Ubuntu
Posts: 70

Rep: Reputation: 15
Grub Boot error 22


I installed Ubuntu 8.04 in the unpartioned space on a drive with WinXP. I get a grub menu offering to boot Ubuntu but it generates error 22. WinXP doesn't boot either. I used the live cd to look at /boot/grub/menu.lst & the terminal to look at my devices. They appear as:

--------------------------------------------------------------------------------
ubuntu@ubuntu:~$ sudo fdisk -l

Disk /dev/sda: 80.0 GB, 80032038912 bytes
255 heads, 63 sectors/track, 9730 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x408549ed

Device Boot Start End Blocks Id System
/dev/sda1 * 1 9729 78148161 7 HPFS/NTFS

Disk /dev/sdb: 80.0 GB, 80032038912 bytes
255 heads, 63 sectors/track, 9730 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x408549ed

Device Boot Start End Blocks Id System
/dev/sdb1 * 1 9729 78148161 7 HPFS/NTFS

Disk /dev/sdc: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x4ec64ec6

Device Boot Start End Blocks Id System
/dev/sdc1 * 1 3134 25173823+ 7 HPFS/NTFS
/dev/sdc2 3135 9729 52974337+ f W95 Ext'd (LBA)
/dev/sdc5 3135 4473 10755486 7 HPFS/NTFS
/dev/sdc6 4474 9508 40443606 83 Linux
/dev/sdc7 9509 9729 1775151 82 Linux swap / Solaris

Disk /dev/sdd: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x4f064f06

Device Boot Start End Blocks Id System
/dev/sdd1 * 1 14593 117218241 7 HPFS/NTFS
ubuntu@ubuntu:~$



## ## End Default Options ##

title Ubuntu 8.04.1, kernel 2.6.24-19-generic
root (hd2,5)
kernel /boot/vmlinuz-2.6.24-19-generic root=UUID=e5485f3e-23c8-460b-9b40-3ba7d884be69 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 (hd2,5)
kernel /boot/vmlinuz-2.6.24-19-generic root=UUID=e5485f3e-23c8-460b-9b40-3ba7d884be69 ro single
initrd /boot/initrd.img-2.6.24-19-generic

title Ubuntu 8.04.1, memtest86+
root (hd2,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/sdc1
title Microsoft Windows XP Professional
root (hd2,0)
savedefault
map (hd0) (hd2)
map (hd2) (hd0)
chainloader +1

----------------------------------------------

/dev/sda & /dev/sdb are a pair of drive in a raid array

/dev/sdc1 is (was) my WinXP boot partition

Any suggestions on how to get either or both partitions to boot?

Thanks.
Scott

Last edited by SBFree; 02-13-2009 at 09:57 AM. Reason: Did Reinstall wanted updated info
 
Old 02-12-2009, 07:51 PM   #2
watcher69b
Member
 
Registered: Nov 2007
Location: /home/watcher69b
Distribution: RH, Fedora & CentOS
Posts: 552

Rep: Reputation: 41
Just guessing but try changing
Quote:
title Microsoft Windows XP Professional
root (hd2,0)
savedefault
root (hd3,0)


linux may see /deb/sda and /dev/sdb
as 1 and 2 respectivly
 
Old 02-12-2009, 08:33 PM   #3
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,501

Rep: Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489
Your entries for Ubuntu and xp look correct. Did you change drive boot priority during/after install. It's a little unusual to have boot for xp and Ubuntu on your third hard drive. When you installed Ubuntu, did you accept the default for bootloader. That would have installed stage1 to sda. The Grub error 22 is:

Quote:
No such partition
This error is returned if a partition is requested in the device part of a device- or full file name which isn't on the selected disk.
So Grub stage1 is looking for stage2 on the wrong partition. Login to a terminal and run the command: sudo grub (get a grub prompt: grub>) then run commands:

geometry (hd0)
geometry (hd1)
geometry (hd2)
geometry (hd3)

This should give you partition information for all drives as seen from Grub. Post output here.
 
Old 02-13-2009, 10:06 AM   #4
SBFree
Member
 
Registered: Nov 2004
Distribution: Ubuntu
Posts: 70

Original Poster
Rep: Reputation: 15
Grub Error

I reinstalled Ubuntu and updated the first post but have the same problem. I did not change the boot disk priority in the bios after install. I did not accept the default place to load the boot loader during install but choose /dev/sdc. I think I could have choosen /dev/sdc1 as well as any partition on that drive. Running the geometry commands gives the following results:

grub> geometry (hd0)
drive 0x80: C/H/S = 9730/255/63, The number of sectors = 156312576, /dev/sda
Partition num: 0, Filesystem type unknown, partition type 0x7

grub> geometry (hd1)
drive 0x81: C/H/S = 9730/255/63, The number of sectors = 156312576, /dev/sdb
Partition num: 0, Filesystem type unknown, partition type 0x7

grub> geometry (hd2)
drive 0x82: C/H/S = 9729/255/63, The number of sectors = 156301488, /dev/sdc
Partition num: 0, Filesystem type unknown, partition type 0x7
Partition num: 4, Filesystem type unknown, partition type 0x7
Partition num: 5, Filesystem type is ext2fs, partition type 0x83
Partition num: 6, Filesystem type unknown, partition type 0x82

grub> geometry (hd3)
drive 0x83: C/H/S = 14593/255/63, The number of sectors = 234441648, /dev/sdd
Partition num: 0, Filesystem type unknown, partition type 0x7

Thanks, I find working with grub difficult, and think I am just trying commands without a complete understanding. Any insights are appreciated. If I reinstall, where should I ask that boot info be loaded? Thanks again.
Scott
 
Old 02-13-2009, 10:25 AM   #5
CJS
Member
 
Registered: May 2008
Location: California, USA
Distribution: Ubuntu 8.10
Posts: 247

Rep: Reputation: 49
If you chose to put Grub in the MBR of your sdc drive by selecting "/dev/sdc" under the "Advanced" button near the end of the installation, probably all you need to do is change your BIOS boot order to boot the sdc drive first, and you should be able to boot into Ubuntu. If for some reason that doesn't work, it would help I think to get a clearer of your setup related to booting, so how about booting your Ubuntu Live CD, download the Boot Info Script to the Live CD desktop, and do:
Code:
sudo bash ~/Desktop/boot_info_script*.sh
That will create a "RESULTS.txt" file in the same directory from where the script is run, namely your desktop; please copy/paste the contents of the RESULTS.txt file to your next post, highlight the copied text, and click the pound/hash sign # graphic in the forum message box so that the text will get "code" tags put around it. The results of that script will help clarify your setup and hopefully what the solution to your booting problem might be.
 
Old 02-13-2009, 02:26 PM   #6
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,501

Rep: Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489
Quote:
I did not accept the default place to load the boot loader during install but choose /dev/sdc
If you chose the root partition of sdc it won't work. You need to put it in the mbr of that drive and have sdc as first in boot priority.
 
Old 02-13-2009, 02:27 PM   #7
SBFree
Member
 
Registered: Nov 2004
Distribution: Ubuntu
Posts: 70

Original Poster
Rep: Reputation: 15
Grub Boot error 22

Thanks for the thoughts. The bios already boots sdc and then I get the menu for Ubuntu, Ubuntu Recovery, ect. Selecting Ubuntu results in the Grub Boot error 22. Selecting WinXP results in missing NTLDR.

I'll get the info from the Boot Info Script and get back with another post.

Thanks,
Scott
 
Old 02-13-2009, 03:18 PM   #8
Duck2006
Member
 
Registered: Sep 2006
Distribution: Ubuntu 8.04 Hardy Heron LST
Posts: 346

Rep: Reputation: 33
Quote:
Originally Posted by SBFree View Post
Thanks for the thoughts. The bios already boots sdc and then I get the menu for Ubuntu, Ubuntu Recovery, ect. Selecting Ubuntu results in the Grub Boot error 22. Selecting WinXP results in missing NTLDR.

I'll get the info from the Boot Info Script and get back with another post.

Thanks,
Scott
Have you tryed reinstalling grub again.

http://users.bigpond.net.au/hermanzone/p15.htm
 
Old 02-13-2009, 04:14 PM   #9
SBFree
Member
 
Registered: Nov 2004
Distribution: Ubuntu
Posts: 70

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by CJS View Post
If you chose to put Grub in the MBR of your sdc drive by selecting "/dev/sdc" under the "Advanced" button near the end of the installation, probably all you need to do is change your BIOS boot order to boot the sdc drive first, and you should be able to boot into Ubuntu. If for some reason that doesn't work, it would help I think to get a clearer of your setup related to booting, so how about booting your Ubuntu Live CD, download the Boot Info Script to the Live CD desktop, and do:
Code:
sudo bash ~/Desktop/boot_info_script*.sh
That will create a "RESULTS.txt" file in the same directory from where the script is run, namely your desktop; please copy/paste the contents of the RESULTS.txt file to your next post, highlight the copied text, and click the pound/hash sign # graphic in the forum message box so that the text will get "code" tags put around it. The results of that script will help clarify your setup and hopefully what the solution to your booting problem might be.
Hi CJS!

I ran boot_info_script024.sh . It's going to take me some time to digest it's output. It is pasted below: Updated Boot Info output in post below - old copy removed

Last edited by SBFree; 02-15-2009 at 10:03 AM. Reason: Updated in post below
 
Old 02-13-2009, 04:25 PM   #10
CJS
Member
 
Registered: May 2008
Location: California, USA
Distribution: Ubuntu 8.10
Posts: 247

Rep: Reputation: 49
Unfortunately it looks like you must have chose to install Grub to "/dev/sdc1", which is the boot sector of your Windows NTFS partition, because that's where Grub is installed right now; you won't be able to mount/boot/access the sdc1 partition until you fix the boot sector. So first, how about booting your Windows Install CD, go to the "recovery console" and do:
Code:
map
That will give the drive letters for all your partitions, choose the drive letter for the sdc1 Windows partition and do:
Code:
fixboot X:
But replace X with the letter of the sdc1 partition. Next boot your Live CD, open a terminal (Applications > Accessories > Terminal) and do:
Code:
sudo grub
grub> root (hd2,2)
grub> setup (hd2)
grub> quit
That should install Grub to the MBR of your sdc Ubuntu drive. Then do:
Code:
sudo mount /dev/sdc3 /mnt && gksudo gedit /mnt/boot/grub/menu.lst
And change all your Ubuntu entries to use (hd0,2) instead of (hd2,2) similar to:
Code:
title Ubuntu 8.04.1, kernel 2.6.24-19-generic
root (hd0,2)
kernel /boot/vmlinuz-2.6.24-19-generic root=UUID=1810926a-e822-4e03-81f5-00abed35934d ro quiet splash
initrd /boot/initrd.img-2.6.24-19-generic
quiet
Also change the "#groot..." line to use (hd0,2):
Code:
# groot=(hd0,2)
And lastly, change your Windows entry at the bottom of the menu.lst to be:
Code:
title Microsoft Windows XP Professional
root (hd0,0)
chainloader +1
Finally reboot, make sure your BIOS is set to boot the sdc drive, and let us know how far you get. We can work from there.
 
Old 02-13-2009, 07:09 PM   #11
SBFree
Member
 
Registered: Nov 2004
Distribution: Ubuntu
Posts: 70

Original Poster
Rep: Reputation: 15
Grub Boot error

Thanks CJS:
Almost there. Ubuntu boots, WinXP brings up the bad shut down screen with the choice of starting in Safe Mode / Last Known Good Config / Normal start. Choosing any reboots machine. Trying to boot in safe mode starts to load drivers but after a page or so reboots like the others.

I do not understand the reference to hd0 and having the bios set to boot from sdc. hd0 should be one of the drives in my RAID array, hd2 is where both WinXP & Linux reside.

My old menu.lst had the lines
savedefault
map (hd0) (hd2)
map (hd2) (hd0)
between the lines with root & chainloader for the section that offers to boot WinXP. Your example leaves these out so I removed them.

Any further insights? Thanks so much for taking me this far.
Scott
 
Old 02-13-2009, 07:47 PM   #12
CJS
Member
 
Registered: May 2008
Location: California, USA
Distribution: Ubuntu 8.10
Posts: 247

Rep: Reputation: 49
Quote:
Originally Posted by SBFree View Post
I do not understand the reference to hd0 and having the bios set to boot from sdc. hd0 should be one of the drives in my RAID array, hd2 is where both WinXP & Linux reside.
That's unfortunately one of the great misconceptions about Grub, i.e. that on start up (hd0) is sda, (hd1) is sdb, (hd2) is sdc, etc: that is only true when you are running Grub commands in linux. But the Grub you get on start up is totally different; on start up, Grub sees the order of drives as your BIOS boot order so that:
Code:
(hd0) = 1st boot drive
(hd1) = 2nd boot drive
(hd2) = 3rd boot drive
...etc.
So the order of drives on start up is solely determined by how you order your drives in the BIOS boot order--it has nothing to do with how linux orders the drives as sda, sdb, sdc, etc. Therefore, if you boot your sdc drive on start up, it is the 1st boot drive or (hd0).

But about your Windows problem, I think the first place I would start would be to boot your Windows Install CD, go to the "recovery console" again, and do:
Code:
chkdsk /r
And run that as many times as it takes until it reports no errors. Also, I think it would be good to have "testdisk" check if your Windows boot sector needs further repairing; to do that, first make sure the Ubuntu Universe repository is enabled in System > Admin > Software Sources, and then download and run testdisk with the following commands:
Code:
sudo apt-get install testdisk
sudo testdisk
After starting testdisk, choose "No log", choose the correct HDD and "Proceed", choose "Intel", choose "Advanced", select the Windows partition, choose "Boot", then choose "Rebuild BS"; if testdisk gives you a warning that the "Extrapolated boot sector and current boot sector are different", then choose "Write". After you are done doing the "Rebuild BS" in testdisk, reboot and let me know exactly what happens when you boot Windows XP from the Grub menu. Or if testdisk says the boot sectors are identical and doesn't give you an option to "Rebuild BS", let me know, and we can work from there.
 
Old 02-14-2009, 04:24 AM   #13
SBFree
Member
 
Registered: Nov 2004
Distribution: Ubuntu
Posts: 70

Original Poster
Rep: Reputation: 15
Grub Boot Error

Thanks CJS - Finding out about the Boot Info Script was incredibly informative. Thanks for explaining about the disk naming in grub, it clears up my misunderstanding. I have to work a day shift & midnight shift coming up here so I'll be leaving the planet till Monday afternoon. I'll have to get back to this problem then.
 
Old 02-15-2009, 10:15 AM   #14
SBFree
Member
 
Registered: Nov 2004
Distribution: Ubuntu
Posts: 70

Original Poster
Rep: Reputation: 15
Grub Boot Error

Hi CJS
I ran testdisk and the Extrapolated boot sect and current were different. After Writing the reboot gave system in the same state. Ubuntu boots, WinXP crashes and reboots machine. I couldn't let this rest before working and did a quick zero fill in the drive with a Seagate utility. I repartitioned with one less partition, restored WinXP from an image. Booted fine, installed Ubuntu and edited menu.lst as above taking into account there was one less partition, same result. Reran testdisk, Extrapolated & boot sectors were the same. No change in behavior. I used imaging software to rewrite MBR & track 0 from the WinXP image and WinXP boots from Windows loader but Grub menu doesn't appear. I reran boot_info_script and pasted below. Could boot loaders on other drives that I didn't mean to put there be messing things up? Off to work for a bit. Thanks in advance for any thoughts.

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

=> Grub0.97 is installed in the MBR of /dev/sda and looks on boot drive #3 in
partition #6 for /boot/grub/stage2 and /boot/grub/menu.lst.
=> Windows is installed in the MBR of /dev/sdb
=> Windows is installed in the MBR of /dev/sdc
=> No known boot loader is installed in the MBR of /dev/sdd

sda1: _________________________________________________________________________

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

sdb1: _________________________________________________________________________

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

sdc1: _________________________________________________________________________

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: /boot.ini /ntldr /NTDETECT.COM

sdc2: _________________________________________________________________________

File system: ext3
Boot sector type: Grub
Boot sector info: Grub0.97 is installed in the boot sector of sdc2 and
looks at sector 59258499 of the same hard drive for
the stage2 file. A stage2 file is at this location on
/dev/sdc. Stage2 looks on partition #2 for
/boot/grub/menu.lst.
Operating System: Ubuntu 8.04.1
Boot files/dirs: /boot/grub/menu.lst /etc/fstab

sdc3: _________________________________________________________________________

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

sdd1: _________________________________________________________________________

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

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

Drive sda: _____________________________________________________________________

Disk /dev/sda: 80.0 GB, 80032038912 bytes
255 heads, 63 sectors/track, 9730 cylinders, total 156312576 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0x408549ed

Partition Boot Start End Size Id System

/dev/sda1 * 63 156,296,384 156,296,322 7 HPFS/NTFS


Drive sdb: _____________________________________________________________________

Disk /dev/sdb: 80.0 GB, 80032038912 bytes
255 heads, 63 sectors/track, 9730 cylinders, total 156312576 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0x408549ed

Partition Boot Start End Size Id System

/dev/sdb1 * 63 156,296,384 156,296,322 7 HPFS/NTFS


Drive sdc: _____________________________________________________________________

Disk /dev/sdc: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders, total 156301488 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0x4ec64ec6

Partition Boot Start End Size Id System

/dev/sdc1 * 63 42,202,754 42,202,692 7 HPFS/NTFS
/dev/sdc2 42,202,755 84,598,289 42,395,535 83 Linux
/dev/sdc3 84,598,290 89,482,049 4,883,760 82 Linux swap / Solaris


Drive sdd: _____________________________________________________________________

Disk /dev/sdd: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders, total 234441648 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0x4f064f06

Partition Boot Start End Size Id System

/dev/sdd1 * 63 234,436,544 234,436,482 7 HPFS/NTFS


blkid -c /dev/null: ____________________________________________________________

/dev/sda1: UUID="3CA417C8A4178414" LABEL="Mirror" TYPE="ntfs"
/dev/sdb1: UUID="3CA417C8A4178414" LABEL="Mirror" TYPE="ntfs"
/dev/sdc1: UUID="A2A0137CA013565F" TYPE="ntfs"
/dev/sdc2: UUID="8114ec58-1854-4709-a45a-251312c3c0f2" SEC_TYPE="ext2" TYPE="ext3"
/dev/sdc3: TYPE="swap" UUID="4bcde86d-82be-4c3b-95d1-6bc672d0e251"
/dev/sdd1: UUID="66F0FEC4F0FE998F" LABEL="TrayA" TYPE="ntfs"
/dev/loop0: TYPE="squashfs"

=============================== "mount" output: ===============================

proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
tmpfs on /lib/modules/2.6.24-19-generic/volatile type tmpfs (rw,mode=0755)
tmpfs on /lib/modules/2.6.24-19-generic/volatile type tmpfs (rw,mode=0755)
varrun on /var/run type tmpfs (rw,noexec,nosuid,nodev,mode=0755)
varlock on /var/lock type tmpfs (rw,noexec,nosuid,nodev,mode=1777)
udev on /dev type tmpfs (rw,mode=0755)
devshm on /dev/shm type tmpfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev)
gvfs-fuse-daemon on /home/ubuntu/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,user=ubuntu)

================================ sdc1/boot.ini: ================================

[boot loader]
timeout=30
default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS
[operating systems]
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Professional" /fastdetect /NoExecute=OptIn

=========================== sdc2/boot/grub/menu.lst: ===========================

# 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=8114ec58-1854-4709-a45a-251312c3c0f2 ro

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

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

## 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,1)
kernel /boot/vmlinuz-2.6.24-19-generic root=UUID=8114ec58-1854-4709-a45a-251312c3c0f2 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,1)
kernel /boot/vmlinuz-2.6.24-19-generic root=UUID=8114ec58-1854-4709-a45a-251312c3c0f2 ro single
initrd /boot/initrd.img-2.6.24-19-generic

title Ubuntu 8.04.1, memtest86+
root (hd0,1)
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/sdc1
title Microsoft Windows XP Professional
root (hd0,0)
chainloader +1


=============================== sdc2/etc/fstab: ===============================

# /etc/fstab: static file system information.
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
# /dev/sdc2
UUID=8114ec58-1854-4709-a45a-251312c3c0f2 / ext3 relatime,errors=remount-ro 0 1
# /dev/sdc3
UUID=4bcde86d-82be-4c3b-95d1-6bc672d0e251 none swap sw 0 0
/dev/scd0 /media/cdrom0 udf,iso9660 user,noauto,exec,utf8 0 0
/dev/fd0 /media/floppy0 auto rw,user,noauto,exec,utf8 0 0

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


30.4GB: boot/grub/menu.lst
30.3GB: boot/grub/stage2
30.3GB: boot/initrd.img-2.6.24-19-generic
30.3GB: boot/vmlinuz-2.6.24-19-generic
30.3GB: initrd.img
30.3GB: vmlinuz

=========================== Unknown MBRs/Boot Sectors/etc =======================

Unknown MBR on /dev/sdd

00000000 90 e9 7d 01 fa 33 c0 8e d0 8e c0 8e d8 bc 00 7c |..}..3.........||
00000010 8b f4 fb bf 00 06 b9 00 01 f3 a5 bb 20 06 ff e3 |............ ...|
00000020 90 90 be 7d 07 81 3c aa 55 75 11 e8 58 00 73 0c |...}..<.Uu..X.s.|
00000030 e8 65 00 72 07 e8 b1 00 72 3b eb 2c be 7d 07 c7 |.e.r....r;.,.}..|
00000040 04 00 00 ba 80 00 be be 07 b9 04 00 f6 04 80 75 |...............u|
00000050 07 83 c6 10 e2 f6 eb 1d 8a 74 01 8b 4c 02 bb 00 |.........t..L...|
00000060 7c b8 01 02 cd 13 72 0d 81 3e fe 7d 55 aa 75 05 ||.....r..>.}U.u.|
00000070 ea 00 7c 00 00 be 6a 07 ac 0a c0 74 fe bb 07 00 |..|...j....t....|
00000080 b4 0e cd 10 eb f2 bb 00 7e c6 07 13 c6 47 01 00 |........~....G..|
00000090 b2 80 b8 00 e0 cd 13 c3 bf 00 7e ba f0 01 b3 a0 |..........~.....|
000000a0 e8 84 00 72 0c b1 01 e8 48 00 72 05 e8 19 00 73 |...r....H.r....s|
000000b0 16 f6 c3 10 75 05 80 cb 10 eb e5 81 fa 70 01 74 |....u........p.t|
000000c0 05 ba 70 01 eb d8 f9 c3 81 bd fe 01 55 aa 75 17 |..p.........U.u.|
000000d0 8b 75 02 81 fe be 01 77 0e 03 f7 81 3c aa 55 75 |.u.....w....<.Uu|
000000e0 06 f6 44 02 01 75 01 f9 c3 bf 00 7c b1 0a e8 01 |..D..u.....|....|
000000f0 00 c3 52 57 83 c2 02 b0 01 ee 42 8a c1 ee 42 32 |..RW......B...B2|
00000100 c0 ee 42 ee 42 8a c3 ee 42 b0 20 ee e8 33 00 ec |..B.B...B. ..3..|
00000110 24 fd 3c 58 75 0d 83 ea 07 b9 00 01 fa f3 6d fb |$.<Xu.........m.|
00000120 f8 eb 01 f9 5f 5a c3 52 83 c2 07 ec a8 80 75 0f |...._Z.R......u.|
00000130 4a 8a c3 ee 42 ec 24 d0 3c 50 75 03 f8 eb 01 f9 |J...B.$.<Pu.....|
00000140 5a c3 51 8b 0e 6c 04 83 c1 12 81 c2 ff 01 ec 8a |Z.Q..l..........|
00000150 e0 80 e4 d8 80 fc 58 74 06 3b 0e 6c 04 75 ef 81 |......Xt.;.l.u..|
00000160 ea ff 01 b9 00 20 e2 fe 59 c3 0d 0a 45 72 72 6f |..... ..Y...Erro|
00000170 72 20 4c 6f 61 64 69 6e 67 20 4f 53 00 aa 55 00 |r Loading OS..U.|
00000180 00 e9 80 fe 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000190 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
000001a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
000001b0 00 00 00 00 00 00 00 00 06 4f 06 4f 00 00 80 01 |.........O.O....|
000001c0 01 00 07 fe 7f 00 3f 00 00 00 82 37 f9 0d 00 00 |......?....7....|
000001d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
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


=======Devices which don't seem to have a corresponding hard drive==============

sde .
sdf .
sdg .
sdh .
 
Old 02-15-2009, 10:35 AM   #15
CJS
Member
 
Registered: May 2008
Location: California, USA
Distribution: Ubuntu 8.10
Posts: 247

Rep: Reputation: 49
I've seen rare cases where Grub simply can't boot Windows despite having the correct entry for Windows in the menu.lst, and I think yours might be one of those cases. Currently you can boot straight into Windows OK, true? If so, in cases like yours it is usually easiest to just add Grub as a boot option in your Windows XP boot loader rather than the other way around. If that sounds OK with you, how about doing the following:
Code:
sudo mount /dev/sdc1 /mnt
sudo dd if=/dev/sdc2 of=/mnt/Grub.bin count=1
gksudo gedit /mnt/boot.ini
Then add the following line at the end of your boot.ini:
Code:
[boot loader]
timeout=30
default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS
[operating systems]
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Professional" /fastdetect /NoExecute=OptIn
C:\Grub.bin="Ubuntu Grub Menu"
Also, since gedit uses Unix style line endings (line feed) instead of a Windows style line ending (carriage return + line feed), it would be good to do the following to ensure your boot.ini has all the proper end-of-lines after modifying it with gedit:
Code:
sudo apt-get install tofrodos
sudo unix2dos /mnt/boot.ini
Then reboot, make sure you are still booting the sdc drive, and let me know if you get Grub as an option in your Windows boot menu OK. We can work from there.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Sofware RAID 1 + Fedora Core 3 + Boot Error L1 + GRUB 21 ERROR najeebsyed2 Linux - Hardware 0 10-25-2007 01:20 PM
GRUB Error 2 & boot partition questions - can't boot Thirteenth Zodiac Ubuntu 9 08-06-2007 12:21 PM
Gentoo-Im dumb and deleted /boot/boot Grub Says: Error 26 : Too many symbolic links smehi Linux - Software 5 06-24-2006 06:25 AM
Grub (error 17) won't boot after new motherboard/vid card.. boot disk anyone? r3dhatter Linux - Newbie 5 02-16-2005 06:52 PM
Grub Error: 26, Deleted /boot/boot link. smehi Linux - Newbie 2 04-06-2004 11:53 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration