Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Grub! (SOLVED)
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
aproan
Guru
Guru


Joined: 30 Apr 2005
Posts: 415

PostPosted: Fri Feb 09, 2007 12:59 am    Post subject: Grub! (SOLVED) Reply with quote

well, this is my scheme.
I had 1 sata HD and had it with both windows and linux.
Yesterday I bought an IDE HD and installed windows on it.

However, my GRUB got erased from the MBR. I am trying to get into my /dev/sda3 (where everything is) or my /dev/sda1 (where /boot is) to be able to get grub up and running.

I've tried the livecd and the minimal install and both stop, halt, working at "sata_sil loading..."

So I tried "gentoo nodetect" but this will make my drives be not detected and therefore i cannot chroot into it, and thus do grub-install.

This is what I planned on doing:
Code:

# mount /dev/sda3 /mnt/gentoo

# mount -t proc /proc /mnt/gentoo/proc

# mount -o bind /dev /mnt/gentoo/dev


# chroot /mnt/gentoo /bin/bash

# grub-install /dev/sda3
by the way should I mount /dev/sda1 (my /boot)?

Last edited by aproan on Tue Feb 13, 2007 8:46 pm; edited 1 time in total
Back to top
View user's profile Send private message
desultory
Bodhisattva
Bodhisattva


Joined: 04 Nov 2005
Posts: 9410

PostPosted: Fri Feb 09, 2007 4:07 am    Post subject: Reply with quote

Do you have access to other live CDs which can access the filesystem types used by your installed system?
Back to top
View user's profile Send private message
aproan
Guru
Guru


Joined: 30 Apr 2005
Posts: 415

PostPosted: Fri Feb 09, 2007 5:08 am    Post subject: Reply with quote

let me know what livecd I should download.

I have tried Knoppix and it doesn't chroot. This is probably because my knoppix is not a 64 bit knoppix, what livecds are there for amd64's you would suggest?

Is there a way to solve my problem using a floppy? Via knoppix I can read my grub.conf if that is worth something.
Back to top
View user's profile Send private message
desultory
Bodhisattva
Bodhisattva


Joined: 04 Nov 2005
Posts: 9410

PostPosted: Fri Feb 09, 2007 9:10 am    Post subject: Reply with quote

aproan wrote:
I have tried Knoppix and it doesn't chroot. This is probably because my knoppix is not a 64 bit knoppix, what livecds are there for amd64's you would suggest?
If you are unable to boot the Gentoo amd64 live CDs on that machine, it would be worth trying a Fedora amd64 rescue CD or perhaps an Ubuntu amd64 install CD.

aproan wrote:
Is there a way to solve my problem using a floppy?
If you have access to one with grub installed on it, then it would be quite easy to solve this with a floppy.

aproan wrote:
Via knoppix I can read my grub.conf if that is worth something.
Presently that is not worth much, but it might be of use later.
Back to top
View user's profile Send private message
aproan
Guru
Guru


Joined: 30 Apr 2005
Posts: 415

PostPosted: Mon Feb 12, 2007 6:16 pm    Post subject: Reply with quote

i tried Ubuntu amd64 install cd. I try the "starting" options and it freezes, the loader seems to be loading forever, but my machine is not reading anything.

I am not sure what to do now, you mentioned
Quote:
If you have access to one with grub installed on it, then it would be quite easy to solve this with a floppy.


How can I install grub into a floppy, from a windows xp machine?

btw, what do you guys think the problem might be, I just connected an IDE hard drive.
Back to top
View user's profile Send private message
whig
l33t
l33t


Joined: 27 Nov 2004
Posts: 973
Location: New Zealand

PostPosted: Mon Feb 12, 2007 6:49 pm    Post subject: Reply with quote

Adding a hard drive can upset the order the _bios_ sees the drives, which causes grub (and booting generally) to be confused. The bios may have the option to either boot the sata or ide drive as the first to try.

A 32 bit knoppix can make a grub floppy - refer grub homepage.
Back to top
View user's profile Send private message
aproan
Guru
Guru


Joined: 30 Apr 2005
Posts: 415

PostPosted: Mon Feb 12, 2007 8:09 pm    Post subject: Reply with quote

http://www.gnu.org/software/grub/manual/html_node/Creating-a-GRUB-boot-floppy.html

So I should boot knoppix, and then do

Code:
     # cd /usr/lib/grub/i386-pc
     # dd if=stage1 of=/dev/fd0 bs=512 count=1
     1+0 records in
     1+0 records out
     # dd if=stage2 of=/dev/fd0 bs=512 seek=1
     153+1 records in
     153+1 records out
     #


??
Back to top
View user's profile Send private message
whig
l33t
l33t


Joined: 27 Nov 2004
Posts: 973
Location: New Zealand

PostPosted: Tue Feb 13, 2007 12:50 am    Post subject: Reply with quote

stage1 and stage2 are more likely to be on your /dev/sda1 (knoppix will have a mountpoint for it).
Back to top
View user's profile Send private message
aproan
Guru
Guru


Joined: 30 Apr 2005
Posts: 415

PostPosted: Tue Feb 13, 2007 2:19 am    Post subject: Reply with quote

ok. i've got the floppy up and running. however, i am now presented with a command line interface of GRUB, which I have never used. I can get my grub.conf but i am still not sure how to get this working.

My plan is to get into my linux system and then do the grub-install, by the way i've been able to check, by using fdisk, that my /dev/sda1 doesn't have the star to become a "booting" partition.
Back to top
View user's profile Send private message
whig
l33t
l33t


Joined: 27 Nov 2004
Posts: 973
Location: New Zealand

PostPosted: Tue Feb 13, 2007 2:34 am    Post subject: Reply with quote

If you can get a grub command line you are just about there :)

> kernel (hd1,0)/boot/kernel_image root=/dev/sda3 ...

The hd1 might not be accurate - grub has tab completion - definitely use tab completion to check what you enter. kernel_image is the filename of your last good kernel.

... indicates other options (like initrd, if any).

Once that command line is right do a

> boot

(got to say, all this could be avoidable if the sata disk is set to be the boot disk, in bios.)

Good luck!
Back to top
View user's profile Send private message
aproan
Guru
Guru


Joined: 30 Apr 2005
Posts: 415

PostPosted: Tue Feb 13, 2007 5:17 pm    Post subject: Reply with quote

after a lot of trial and error i've been able to get into my linux system.

I noticed I had a very big mistake, my /dev/sda1 in fdisk didn't have the boot "tag" (*).

However, now I can use grub to get into Linux but not into Windows! I am not sure what to do, and I have tried changing the (hdX,0) where X has been 0,1.

Below are my fdisks and followed by my grub.conf if you can give me any idea on how to fix it ill really appreciate it.

Code:
Disk /dev/hdc: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hdc1   *           1        9727    78132096    c  W95 FAT32 (LBA)
/dev/hdc2            9728       14593    39086145    f  W95 Ext'd (LBA)
/dev/hdc5            9728       14593    39086113+   b  W95 FAT32

Code:

Disk /dev/sda: 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/sda1   *        4864        4896      265072+  83  Linux
/dev/sda2            4897        5409     4120672+  82  Linux swap / Solaris
/dev/sda3            5410        9726    34676302+  83  Linux


Code:

default 0
timeout 30
splashimage=(hd0,0)/grub/splash.xpm.gz

title=Gentoo Linux 2.6.18-gentoo-r6
root (hd0,0)
kernel /boot/kernel-genkernel-x86_64-2.6.18-gentoo-r6 root=/dev/ram0 init=/linuxrc ramdisk=8192 real_root=/dev/sda3
initrd /boot/initramfs-genkernel-x86_64-2.6.18-gentoo-r6

title=Windows XP SP2
rootnoverify (hd1,0)
makeactive
chainloader +1
Back to top
View user's profile Send private message
whig
l33t
l33t


Joined: 27 Nov 2004
Posts: 973
Location: New Zealand

PostPosted: Tue Feb 13, 2007 7:36 pm    Post subject: Reply with quote

Snippet from the grub site,
Quote:
4.2.6 DOS/Windows

GRUB cannot boot DOS or Windows directly, so you must chain-load them (see Chain-loading). However, their boot loaders have some critical deficiencies, so it may not work to just chain-load them. To overcome the problems, GRUB provides you with two helper functions.

If you have installed DOS (or Windows) on a non-first hard disk, you have to use the disk swapping technique, because that OS cannot boot from any disks but the first one. The workaround used in GRUB is the command map (see map), like this:

grub> map (hd0) (hd1)
grub> map (hd1) (hd0)

This performs a virtual swap between your first and second hard drive.

Caution: This is effective only if DOS (or Windows) uses BIOS to access the swapped disks. If that OS uses a special driver for the disks, this probably won't work.
(I haven't needed to use the map command myself)
Back to top
View user's profile Send private message
aproan
Guru
Guru


Joined: 30 Apr 2005
Posts: 415

PostPosted: Tue Feb 13, 2007 8:45 pm    Post subject: Reply with quote

fixed. thanks a lot.

hoping to see what comes new with Grub 2.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum