LinuxQuestions.org
Visit Jeremy's Blog.
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 04-11-2008, 09:56 AM   #1
matsyuf
Member
 
Registered: Mar 2007
Posts: 95

Rep: Reputation: 15
Re: GRUB


Hello,

I have 2 Hard Disks, One HDD has 2 partitions, C: and D:, C: i installed Windows XP and the second HDD i installed Debian. My windows xp had a problem and I re-install OS, now my GRUB disappeared. Am not having trouble restoring it. I have tried the steps below;-

With Knoppix-
root@ttyp1[boot]# mount /dev/hbd1 /mnt
root@ttyp1[boot]# chroot /mnt
Knoppix:/# apt-get --reinstall install grub

After this i rebooted.

But it didnt workout,I thought maybe i could edit menu.lst but i dont have grub in boot

root@ttyp1[boot]# cd /boot
root@ttyp1[boot]# ls

yet

root@ttyp1[boot]# whereis grub
grub: /sbin/grub /lib/grub /usr/share/man/man8/grub.8.gz

My fdisk -l look like ;-

root@ttyp1[boot]# fdisk -l

Disk /dev/hda: 80.0 GB, 80000000000 bytes
255 heads, 63 sectors/track, 9726 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hda1 * 1 2432 19535008+ 7 HPFS/NTFS
/dev/hda2 2433 9726 58589055 f W95 Ext'd (LBA)
/dev/hda5 2433 9726 58589023+ b W95 FAT32

Disk /dev/hdb: 41.1 GB, 41110142976 bytes
255 heads, 63 sectors/track, 4998 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hdb1 * 1 4806 38604163+ 83 Linux
/dev/hdb2 4807 4998 1542240 5 Extended
/dev/hdb5 4807 4998 1542208+ 82 Linux swap
root@ttyp1[boot]#

WHat can i do to restore grub.

I also tried

root@ttyp1[boot]# grub

grub>
root (hd1,0)
Filesystem type is ext2fs, partition type 0x83

grub>
setup (hd1)
Checking if "/boot/grub/stage1" exists... yes
Checking if "/boot/grub/stage2" exists... yes
Checking if "/boot/grub/e2fs_stage1_5" exists... yes
Running "embed /boot/grub/e2fs_stage1_5 (hd1)"... 16 sectors are
embedded.
succeeded
Running "install /boot/grub/stage1 (hd1) (hd1)1+16 p (hd1,0)/boot
/grub/stage2 /boot/grub/menu.lst"... succeeded
Done.

grub>
quit

and then rebooted

Again this didnt work out.
 
Old 04-11-2008, 10:39 AM   #2
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728
You have Windows on hda1 (grub sees this as hd0,0)

You have Linux on hdb1 (grub sees this as hd1,0)

You need GRUB to be in the mbr on the first drive--ie hda (grub hd0)

So:
grub
root (hd1,0) (this tells grub where it's config files are)
setup (hd0) (this puts grub on the mbr of the first drive)
 
Old 04-11-2008, 10:55 AM   #3
yancek
Guru
 
Registered: Apr 2008
Distribution: PCLinux, Slackware
Posts: 5,072

Rep: Reputation: 804Reputation: 804Reputation: 804Reputation: 804Reputation: 804Reputation: 804Reputation: 804
The last part of your post clearly shows Grub is there but it is on the second drive (hdb). You re-installed XP and it has overwritten your Grub from hda. You can change settings in BIOS to boot hdb as first drive (master)and hda as second (slave). You will need an entry as below in your menu.lst if you do this.

title Windows XP
rootnoverify (hd1,0)
map (hd0) (hd1)
map (hd1) (hd0)
chainloader +1

You could also install Grub to your mbr on your current hda with xp by following the process you indicated with a change of drive:

grub>root (hd0,0)
grub>setup (hd0)
grub>quit


Your entry for windows xp in menu.lst should then be:
title Win XP
rootnoverify (hd0,0)
makeactive
chainloader +1
boot
 
Old 04-15-2008, 10:56 AM   #4
matsyuf
Member
 
Registered: Mar 2007
Posts: 95

Original Poster
Rep: Reputation: 15
Hello

am still having trouble restoring my GRUB, the problem is that I cant find menu.lst because in boot i cant find grub in boot

root@ttyp1[boot]# ls

i think maybe my problem is editing menu.lst which i cant find coz in boot i dont have grub.

Please help
 
Old 04-15-2008, 02:01 PM   #5
SilverBear2006
Member
 
Registered: Oct 2006
Location: Great Lakes region, North America
Distribution: Mepis 7.0, Mepis 8.0, ArchLinux, Pardus 2008, Kubuntu 8.04, Ubuntu 8.10
Posts: 69

Rep: Reputation: 16
Quote:
Originally Posted by matsyuf View Post
Hello

am still having trouble restoring my GRUB, the problem is that I cant find menu.lst because in boot i cant find grub in boot

root@ttyp1[boot]# ls

i think maybe my problem is editing menu.lst which i cant find coz in boot i dont have grub.

Please help
I think --from what you've said-- that you have GRUB installed on your second HDD, which seems to be the master drive on IDE channel 1. The problem is that your computer boots from the master drive, IDE channel 0.

The file menu.lst is located here on your Debian root filesystem.
/boot/grub/menu.lst.

When you are in the system prompt while running Knoppix, you are in a RAM disk with a Knoppix root filesystem. In order to locate your Debian filesystem you need to mount the correct partition --hdb1?--

Then at the Knoppix prompt, you should be able to issue this command

Code:
cd /mnt/hdb1
If that worked, and you are now in your Debian root partition, this command should show you all the normal Linux directories, /bin /boot /dev and all the rest:
Code:
ls -l
If it looks something like this, you're getting close:
Code:
bash-3.2# ls -l
total 92
drwxr-xr-x   2 root root 4096 2008-04-04 14:05 bin
drwxr-xr-x   4 root root 4096 2008-04-04 14:05 boot
drwxr-xr-x  19 root root    0 2008-04-15 10:19 dev
drwxr-xr-x  47 root root 8192 2008-04-15 11:24 etc
drwxr-xr-x   4 root root   16 2008-04-04 22:01 home
drwxr-xr-x   6 root root 4096 2008-04-07 12:18 lib
drwxr-xr-x   5 root root   56 2008-04-15 10:19 media
drwxr-xr-x  39 root root 4096 2008-04-15 10:03 mnt
drwxr-xr-x   6 root root   32 2008-04-07 12:40 opt
dr-xr-xr-x 132 root root    0 2008-04-15 06:19 proc
drwxr-x---   6 root root 4096 2008-04-15 10:28 root
drwxr-xr-x   2 root root 4096 2008-04-10 00:14 sbin
drwxr-xr-x   2 root root    1 2008-03-10 18:20 srv
drwxr-xr-x  12 root root    0 2008-04-15 06:19 sys
drwxrwxrwt  12 root root 4096 2008-04-15 13:01 tmp
drwxr-xr-x  12 root root   88 2008-04-10 00:19 usr
drwxr-xr-x  12 root root   88 2008-04-04 14:05 var
At this point
Code:
cd boot/grub
Will log you into the GRUB subdirectory of /boot. When you type ls -l again, you should see this, or something similar that lists GRUB files, including menu.lst

Code:
bash-3.2# ls -l
total 308
-rw-r--r-- 1 root root   8024 2008-03-18 06:15 e2fs_stage1_5
-rw-r--r-- 1 root root   7864 2008-03-18 06:15 fat_stage1_5
-rw-r--r-- 1 root root   7112 2008-03-18 06:15 ffs_stage1_5
-rw-r--r-- 1 root root   7108 2008-03-18 06:15 iso9660_stage1_5
-rw-r--r-- 1 root root   8576 2008-03-18 06:15 jfs_stage1_5
-rw-r--r-- 1 root root   1449 2008-04-06 18:18 menu.lst
-rw-r--r-- 1 root root   7296 2008-03-18 06:15 minix_stage1_5
-rw-r--r-- 1 root root   9604 2008-03-18 06:15 reiserfs_stage1_5
-rw-r--r-- 1 root root    512 2008-03-18 06:15 stage1
-rw-r--r-- 1 root root 100390 2008-03-18 06:15 stage2
-rw-r--r-- 1 root root 100390 2008-03-18 06:15 stage2_eltorito
-rw-r--r-- 1 root root   7452 2008-03-18 06:15 ufs2_stage1_5
-rw-r--r-- 1 root root   6680 2008-03-18 06:15 vstafs_stage1_5
-rw-r--r-- 1 root root   9264 2008-03-18 06:15 xfs_stage1_5
At this point, maybe you can get yancek's advice to work for you.

good luck,
SilverBear
 
  


Reply

Tags
grub, has, trouble


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
grub failed to load linux (grub think ext3 partition as fat) khairilthegreat Linux - Newbie 7 08-09-2007 01:12 PM
GRUB menu.lst/grub.conf file with multiple partitions dasy2k1 Linux - General 1 04-19-2007 09:42 AM
/grub/menu.lst file disappeared but computer still boots (grub) rrrssssss Linux - General 5 04-08-2007 10:02 AM
Booting my new ubuntu install = "GRUB GRUB GRUB GRUB GRUB" etc. dissolved soul Ubuntu 2 01-13-2007 01:55 PM
can some fc4 user mail his grub.conf and tell me how can i make this grub read this amolgupta Linux - Software 1 03-15-2006 05:04 AM


All times are GMT -5. The time now is 06:35 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration