LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
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 06-14-2005, 08:59 AM   #1
Fisknils
LQ Newbie
 
Registered: Jun 2005
Location: Karlstad, Sweden
Distribution: Debian
Posts: 12

Rep: Reputation: 0
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.
 
Old 06-14-2005, 09:17 AM   #2
JimBass
Senior Member
 
Registered: Oct 2003
Location: New York City
Distribution: Debian Sid 2.6.32
Posts: 2,100

Rep: Reputation: 49
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
 
Old 06-14-2005, 09:23 AM   #3
Fisknils
LQ Newbie
 
Registered: Jun 2005
Location: Karlstad, Sweden
Distribution: Debian
Posts: 12

Original Poster
Rep: Reputation: 0
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?
 
Old 06-14-2005, 09:29 AM   #4
0pal_t0ad
Member
 
Registered: Feb 2004
Location: Southampton, England
Distribution: Laptop:Gentoo-i686-2.6.9-r9 Desktop:Slackware10 2.4.26
Posts: 298

Rep: Reputation: 30
did windows boot after formatting C:\ and before installing ubuntu?
 
Old 06-14-2005, 09:45 AM   #5
10xOXR
Member
 
Registered: Nov 2003
Location: Scotland
Distribution: Gentoo 2005.0
Posts: 49

Rep: Reputation: 15
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
 
Old 06-14-2005, 12:41 PM   #6
Fisknils
LQ Newbie
 
Registered: Jun 2005
Location: Karlstad, Sweden
Distribution: Debian
Posts: 12

Original Poster
Rep: Reputation: 0
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)
 
Old 08-02-2005, 02:37 PM   #7
rkrishna
Member
 
Registered: Mar 2005
Location: chennai(madras), India
Distribution: slackware ofcourse
Posts: 654

Rep: Reputation: 32
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

Last edited by rkrishna; 08-03-2005 at 11:24 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Setting password on grub, wha to do after changing default values in /boot/grub/menu. sarajevo Linux - Security 1 08-17-2005 09:01 PM
Grub Error 17: Cannot mount selected partition and other Grub problems Sebastian Naitsabes Linux - General 1 07-05-2005 09:33 AM
Grub setup problem (/boot/grub/stage1 not found) davidas Debian 2 04-28-2004 09:13 PM
Why grub prompt after installing Grub inder Debian woody 3.0r2? velan Debian 1 04-20-2004 05:55 AM
1st HDD = RH9.0 (grub) ... How do I modify grub when adding 2nd hard disk ? Onyx^ Linux - Software 1 09-05-2003 10:16 AM


All times are GMT -5. The time now is 10:53 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration