Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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:
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
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:
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
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.
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 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.
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
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:
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
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:
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.
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.
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
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
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
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)
# 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
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
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:
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:
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.