LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Help with grub (https://www.linuxquestions.org/questions/linux-newbie-8/help-with-grub-333423/)

Fisknils 06-14-2005 07:59 AM

Help with grub
 
I recently installed Ubuntu 5.04 i386 on my (only working) desktop computer in the hopes of learning a thing or two about linux, whilst I planned to use dualboot with my Windows XP partition.

The Problem:

In Windows (before installing ubuntu), my windows installation was located on D:\. Not C:\ as it's usually installed on, but I wanted to keep it that way due to the fact that D:\ was my SATA disc.

So I formatted C:\ and E:\ (which was located on the same ATA disc) and installed ubuntu without too much problems. But after 24 hours or so when I wanted to go back to windows, I found that grub couldn't locate my windows installation. This might be because the boot.ini was located on C:\ (I admit it was kinda stupid to install ubuntu without hesitation and without looking one or two things up)

So I do a little trial-and-error in grub, and find that the NTFS partition which I successfully mount in ubuntu (with windows on it) (/dev/sda1) can't be found in grub. I try to edit the line which specifies the harddrive selection and press tab (to find whatever partitions are available), but can only find the hd0, hd1 and fd0 partitions.
Also, during the load of linux, I can't mount the sd1 drive as it's supposed to. Is this due to the SATA drivers only being loaded during the boot of X?
If so, how would I go about to fix it?
I've tried googling, but I dont find anything useful, and I simply dont have time to google all day to find the right answer, so I'm turning to you. What on earth should I do?

Thanks in advance.

JimBass 06-14-2005 08:17 AM

Grub and linux number the partitions differently, grub usually is 1 less that linux. Grub's hd0 is very likely /dev/sda1, and hd1 is /dev/sda2 or /dev/sdb depending on how you have the partitions set. If you post your /boot/grub/menu.lst file, we can probably help you to find the right syntax to boot into XP, unless the boot.ini file is gone as you have said.

Peace,
JimBass

Fisknils 06-14-2005 08:23 AM

Thank you for your quick reply.
Here's the menu.lst as you asked. The last entry is an attempt from my side to add Windows XP to grub.

Code:

root@niffe:/boot/grub # cat  boot/grub/menu.lst
cat: boot/grub/menu.lst: No such file or directory
root@niffe:/boot/grub # cat  /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'.
default        0

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

## 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 optons 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 specifiv 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=root=/dev/hdd1 ro

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

## 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

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

## nonaltoption boot targets option
## This option controls options to pass to only the
## primary kernel menu item.
## You can have ONLY one nonaltoptions line
# nonaltoptions=quiet splash

## 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

## ## End Default Options ##

title          Ubuntu, kernel 2.6.10-5-386
root            (hd0,0)
kernel          /boot/vmlinuz-2.6.10-5-386 root=/dev/hdd1 ro quiet splash
initrd          /boot/initrd.img-2.6.10-5-386
savedefault
boot

title          Ubuntu, kernel 2.6.10-5-386 (recovery mode)
root            (hd0,0)
kernel          /boot/vmlinuz-2.6.10-5-386 root=/dev/hdd1 ro single
initrd          /boot/initrd.img-2.6.10-5-386
savedefault
boot

title          Ubuntu, kernel memtest86+
root            (hd0,0)
kernel          /boot/memtest86+.bin
savedefault
boot

title          Microsoft Windows
root            (sda0,0)
savedefault
makeactive
chainloader    +1

### END DEBIAN AUTOMAGIC KERNELS LIST

And yes, I'm pretty sure the boot.ini was destroyed during the installation of ubuntu. (It's always stored in C:\, isn't it?)
Does that ruin all chances of retrieval?

0pal_t0ad 06-14-2005 08:29 AM

did windows boot after formatting C:\ and before installing ubuntu?

10xOXR 06-14-2005 08:45 AM

From what you've said, XP resides on a seperate SATA disk (D:\) and you also had C: and E: on you're master disk, which is where Linux is now installed.

That would make Windows location (hd1,0) and the grub.conf file to read:

Code:

title          Microsoft Windows
root            (hd1,0)
savedefault
makeactive
chainloader    +1

Windows does keep some of it's boot info on the C:\ drive even though you installed it to D:\ so it is likely that you have deleted you're boot.ini file, but this isn't a problem really, you could just make a new one with the following(ish!) contents:

Code:

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


Fisknils 06-14-2005 11:41 AM

Quote:

Originally posted by 0pal_t0ad
did windows boot after formatting C:\ and before installing ubuntu?
I formatted C:\ using ubuntus installer.

Quote:

Originally posted by 10xOXR
Windows does keep some of it's boot info on the C:\ drive even though you installed it to D:\ so it is likely that you have deleted you're boot.ini file, but this isn't a problem really, you could just make a new one with the following(ish!) contents:
Do I actually *need* the boot.ini file in order to boot windows? Because when I write in what you said in menu.lst, windows doesn't load. Something more happens than nothing though. It locks up. So I'd guess something is going on.

Anyways. Thanks to your help I think I've located the problem, to which I have no answer as how to solve; there is no boot.ini on the windows system disc. How do I create it? (note that the windows system disc is NTFS)

rkrishna 08-02-2005 01:37 PM

use ur windows cd
 
fix the mbr using windows cd

booting to repair mode with xp cd, apply command fixmbr
now when u reboot u can c the windows grub
tehn
boot to linux if u have boot disks.. good or
by a live cd or the same disk u used to install
chroot if needed
tehn

#grubinstall /dev/hda %reinstall grub to mbr
this will install grub to mbr
edit the grub.conf or menu.lst if needed


All times are GMT -5. The time now is 08:02 PM.