LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Mandriva
User Name
Password
Mandriva This Forum is for the discussion of Mandriva (Mandrake) Linux.

Notices


Reply
  Search this Thread
Old 11-16-2005, 06:26 PM   #1
iklesteve
LQ Newbie
 
Registered: Sep 2003
Posts: 8

Rep: Reputation: 0
Mdk 2006 - GRUB installation problems


I've just built a new machine (AMD 64X2 4400, Asus K8N-SLI deluxe) and am having trouble getting GRUB to install.

I've got Mandriva 2006 "free" x68_64 edition, which seems to install OK, until it tries to install the bootloader. Although there are no error messages at this point, it is clear that GRUB hasn't been installed at all, as nothing is added to the MBR of the boot partition.

My system has 2x200GB SATA drives, configured in a mirror RAID using the onboard nForce raid controller. The drivers for this are installed without problem at the start of Mandriva installtion. I am planning on using BootIt as my main boot manager (it has some useful features as I will also be running 32/64bit versions of Windows) so my drive is partioned as follows:

Code:
Primary: BootIt partition (FAT) 8Mb
Primary: Win_64 partition (NTFS) 10Gb
Primary: Win_32 partition (NTFS) 10Gb
Extended:
    /boot (ext2) 100Mb
    swap (swap) 4Gb
    / (ext2) 1Gb
    /home (ext2) 10Gb
    /tmp (ext2) 10Gb
    /var (ext2) 10Gb
    /usr (ext2) 30Gb

    [Some extra FAT-32 drives for general use here]
When prompted by the install I opt to install GRUB on the first sector of the root partition (side note: this is "/boot" right? not "/"), but have tried also to install to fd0.

When running in rescue mode and trying to reinstall GRUB, I get the following message:
Code:
Installing driver for sata_nv <snip>....
=> found a Mandriva Linux root partiiton on /dev/sda7
=> type ext2, version 'Mandriva Linux release 2006.0 (Official) for x86_64

<snip>
Installing boot loader...
running: sh /boot/grub/install.sh 2> SCALAR(0xf8aff0) with root /mnt

GNU GRUB <snip>

grub> root (hd0,4)
Error 21: Selected disk does not exist
grub> setup (hd0,4)
Error 12: Invalid device requested
grub> quit
I've tried reinstalling (about 10 times) with different disk configurations but always get the same message. Having said that, it did once load correctly (about the 2nd time I installed it) but then booting failed with some initrd problems. Now it won't even get that far.

So, does anyone have any ideas about what could be causing this and how to rectify it? I think it may be because of the RAID - my drives appear to be sitting in /dev/mapper/nvidia_cdhfeddc1 etc, should they not be referenced as /dev/sdc[x]? I'm new to both RAID and SATA on linux.....

I've a few years experience running linux on both desktop and server environments but this level of detail is a bit new to me so I apologise if I ask newbie questions!

Please help if you can - I'm itching to get the dual-core power flowing!

i.s
 
Old 11-16-2005, 06:37 PM   #2
purelithium
Member
 
Registered: Oct 2005
Location: Canada
Distribution: Mandriva 2006.0
Posts: 390

Rep: Reputation: 30
Your problem is probably the fact that your /boot partition is on the raid array. a /boot partition should be located on a non-raid partition, as bootloaders get confused by raid.
 
Old 11-16-2005, 08:47 PM   #3
iklesteve
LQ Newbie
 
Registered: Sep 2003
Posts: 8

Original Poster
Rep: Reputation: 0
Thanks for the reply - I tried adding an old IDE drive to my box and moving the /boot partition across to that. Still get the same error messages when trying to install GRUB and the drive is not bootable.
i.s
 
Old 11-16-2005, 10:35 PM   #4
purelithium
Member
 
Registered: Oct 2005
Location: Canada
Distribution: Mandriva 2006.0
Posts: 390

Rep: Reputation: 30
Hmm... why do you insist on using grub, why not just use Lilo? Since you'll be using BootIt for the bootloader anyway, why not stick with the mandriva standard?

I've had no problems with Lilo.
 
Old 11-17-2005, 02:23 AM   #5
spitfire5c
LQ Newbie
 
Registered: Nov 2005
Distribution: Ubuntu, SuSE + Others
Posts: 23

Rep: Reputation: 15
Hi
As far as the rescue mode not finding the disk goes, your problem may be related to not specifying the correct harddrive/partition number.

For example, its possible that if you're using IDE devices (e,g, PATA drive), the master device on the primary IDE channel may be seen as hd0 and if you have both the master and slave in use then the slave device may be hd1. This being the case, your SATA disk would be hd1 (if only Primary/master IDE in use) or hd2 (if both Primary/master and primary/slave in use). If you are also using the Secondary IDE channel then the SATA drive maybe hd3 or hd4. In your particular case it looks like your SATA drive is hd2

Also, you said you opted for Grub to install to the root partition but in "rescue mode" you are telling grub to setup to /boot (i.e partition 4).
Now, I'm not sure where Mandriva installs the bootloader when you say 'to root' but normally root means exactly what it says (i.e "/") which in your case is partition 6 (in Grub terminology).

So, my best guess is you should specify (hd2,6) ---- but remember what I said re IDE channels above

As far as not being able to boot, you'll need to make sure you've specified the correct partition to boot in BootIt (sorry I don't know this program so can't help with that). If it still doesn't work, you should check your grub config file "menu.lst" -- paste a copy in this thread if u need help

Probably as clear as mud but hope something I've mentioned helps....

Lastly, just so you know, there is only one MBR on a disk

Cheers
Ian

Last edited by spitfire5c; 11-18-2005 at 10:04 AM.
 
Old 11-17-2005, 07:47 PM   #6
iklesteve
LQ Newbie
 
Registered: Sep 2003
Posts: 8

Original Poster
Rep: Reputation: 0
OK, I'm just going to swallow my pride and put myself on the line in the hope that I'm making some stupid mistake and someone can help!

My (limited) knowledge of bootloaders is that every partition on the disk (or at least every primary partition) has a boot sector that contains info on how to boot the OS and part of Grub is installed on the boot sector of /boot. (Right/Wrong??)

There is also an MBR per disk that specifies which partition to boot from. (Right/Wrong??)

Spitfire - I think you're on the right track, I'm pretty sure the errors I'm getting are due to the wrong disk being referenced. If it helps my full disk layout is this:

I have 2 IDE channels - the primary has a DVD-RW as master and a DVD-ROM as slave. The secondary has a HDD which contains (only) the /boot partition.

I also have 2 SATA controllers, each with 4 channels. My SATA disks are connected to one of these controllers but I don't know if it's the first or second controller as linux sees it.

I'm new to GRUB so unsure of exactly how to control/install it - I've tried running /sbin/grub-install from rescue mode with a number of parameters but just get messages such as "/dev/hdc does not have any corresponding BIOS device" and "/sbin/grub-install: line 356: sed: command not found". Since putting my /boot partition on a seperate IDE drive, grub seems to install even less than it would before - /boot only contains a "lost+found" directory and a keyboard mapping!

purelithium: I'd quite happily use LILO if it was offered to me - the installer only offers GRUB with/without a GUI, am I missing something?

Will continue to play about tomorrow and let you know if I crack anything. In the meantime if anyone can see something I'm doing wrong (no matter how stupid!) please let me know!

Thanks for the help so far - I know I'm so close and yet so far.....

i.s
 
Old 11-17-2005, 07:59 PM   #7
purelithium
Member
 
Registered: Oct 2005
Location: Canada
Distribution: Mandriva 2006.0
Posts: 390

Rep: Reputation: 30
That's strange. i've never had Grub with Mandriva, always lilo....

Sorry, I don't know enough to help you any further.
 
Old 11-17-2005, 09:08 PM   #8
spitfire5c
LQ Newbie
 
Registered: Nov 2005
Distribution: Ubuntu, SuSE + Others
Posts: 23

Rep: Reputation: 15
Hi

In answer to your questions:
Yes each disk has a single MBR and yes each partition has a Boot Sector.
The partiton table normally contains information (i.e its start sector etc) for upto four primary partitions or three primary plus an extended partition (I say "normally" because some 3rd party boot loaders can make "changes" to allow >4 partitions).
The partition table also flags which partition is the currently active partition. In your case, I assume the active partition will be the one with BootIt installed.

With regard to your statement/query "Grub is installed on the boot sector of /boot", I don't think it is! As I said before, I think it's on your root partition.

Did you try telling BootIt to boot from the"/" partition instead of "/boot"??

If I read correctly, you seem to have added another drive into the mix. Your call, but I think you should take back out as it'll just confuse things.

Something useful would be to copy/paste your "menu.lst" file here for people to see (/boot/grub/menu.lst).

Ian
 
Old 11-18-2005, 07:46 AM   #9
iklesteve
LQ Newbie
 
Registered: Sep 2003
Posts: 8

Original Poster
Rep: Reputation: 0
Hi guys.

I've taken the other IDE disk out again now as suggested, it only seemed to confuse things more.

As requested, I've got the following files. They're taken from rescue mode, so the real path to them is /mnt/boot/grub/....

menu.lst:
Code:
timeout 10
color black/cyan yellow/cyan
shade 1
viewport 3 2 77 22
spashimage (hd0,4)/grub/mdv-grub_splash.xpm.gz
default 0

title linux
kernel hd(0,4)/vmlinuz root=/dev/mapper/nvidia_cdhfeddc7  resume=/dev/mapper/nvidia_cdhfeddc6
initrd hd(0,4)/initrd.img

title linux-nonfb
kernel hd(0,4)/vmlinuz root=/dev/mapper/nvidia_cdhfeddc7  resume=/dev/mapper/nvidia_cdhfeddc6 splash=silent vga=794
initrd hd(0,4)/initrd.img

title failsafe
kernel hd(0,4)/vmlinuz root=/dev/mapper/nvidia_cdhfeddc7  failsafe resume=/dev/mapper/nvidia_cdhfeddc6
initrd hd(0,4)/initrd.img
device.map:
Code:
(fd0) /dev/fd0
(hd0) /dev/mapper/nvidia_cdhfeddc
install.sh:
Code:
grub --device-map=/boot/grub/device.map --batch <<EOF
root (hd0,4)
setup (hd0,4)
quit
EOF
I hope something from this lot makes sense to someone!

I've tried BootIt pointing to "/" and "/boot" - neither partition is marked as bootable though, as GRUB always errors when installing.

Thanks again for the help.

i.s
 
Old 11-18-2005, 08:06 AM   #10
iklesteve
LQ Newbie
 
Registered: Sep 2003
Posts: 8

Original Poster
Rep: Reputation: 0
Hmm... might be getting somewhere. After posting the above, I started playing about (well, I can't break it more!) and changed the first line of /boot/grub/install.sh to:
Code:
grub --device-map=/mnt/boot/grub/device.map --batch <<EOF
Now, when running the "Reinstall bootloader" option from the rescue menu, I get the following:
Code:
Probing devices to guess BIOS drives. This may take a long time
<snip>
grub> root (hd0,4)
 Filesystem type is ext2fs, partition type 0x83
grub> setup (hd0,4)
 Checking if "/boot/grub/stage1" exists... no
 Checking if "/grub/stage1" exists... no

Error 15: File not found
grub> quit
There IS a file called stage1 in (/mnt)/boot/grub and I've even added symlinks from / in rescue mode to point to the files in /mnt, but it still wouldn't find them.
Any ideas now?

i.s
 
Old 11-18-2005, 09:21 AM   #11
spitfire5c
LQ Newbie
 
Registered: Nov 2005
Distribution: Ubuntu, SuSE + Others
Posts: 23

Rep: Reputation: 15
Hi
First off, is the script you mentioned the script that runs when you select "Reinstall bootloader" ?

Second thing is that, from the output snippet you gave in the last post, root is being set as (hd0,4) which is the same as in your first post but instead of the "Error 21: Selected disk does not exist" (as per 1st post) it now finds an ext2 filesystem. This doesn't make sense unless your disk config has changed. Are you sure you removed the HD you installed on the IDE channel?

Also can you post output of
Code:
df
Ian
 
Old 11-18-2005, 11:26 AM   #12
iklesteve
LQ Newbie
 
Registered: Sep 2003
Posts: 8

Original Poster
Rep: Reputation: 0
Will post the df output when I get home.

I'm not too sure what exactly happens when I select the reinstall bootloader option - it's one of the menu options on the splash screen for the rescue GUI. If I choose the "goto console" option there I can get to a console with my system mounted under /mnt.

My disk config is now exactly as it was in the first post - the only thing thats changed between the "selected disk does not exist" and the "Checking if /boot/grub/stage1 exists" messages is the change to the install.sh script. My guess here is that the device.map file can be used to define what (hd0) is - before it could not find that file so used the default (prob one of the IDE DVD drives) but now the map file redefines (hd0) as "/dev/mapper/nvidia_cdhfeddc". This is the drive in the RAID array, so (hd0,4) would be the 4th partition on this disk?? - ie "/boot"?

Will try repointing this to (hd0,6) as that should be the root partition - I assume that this is what it should be trying to find.

Will let you know how I get on!
 
Old 11-18-2005, 09:39 PM   #13
tinybit
Member
 
Registered: Jul 2005
Location: China
Distribution: Mandriva
Posts: 84

Rep: Reputation: 15
Try GRUB for DOS please. It is a cross-platform boot loader based on GNU GRUB. The GRUB.EXE can be started from DOS/Win9x; and GRLDR can be started from BOOT.INI of Windows NT/2K/XP/2003; and even more, the GRUB.EXE can be started from LINUX via the KEXEC tool.

By using GRUB.EXE or GRLDR, you don't have to touch your MBR. It is the safest way coexisting with DOS/Windows.

You needn't install GRUB for DOS. Just run GRUB.EXE from DOS, or append a line of "C:\GRLDR=START GRUB" into your BOOT.INI(restart and select the "START GRUB" menu item), that will do.

Download GRUB for DOS here: http://freshmeat.net/projects/grub4dos/
 
Old 11-21-2005, 04:40 AM   #14
iklesteve
LQ Newbie
 
Registered: Sep 2003
Posts: 8

Original Poster
Rep: Reputation: 0
Some progress!

I tried amending the install.sh script to:
Code:
root (hd0,6)
install(hd0,6)
and GRUB actually installed! The partition is now bootable, but when booting into it I get the message "grub: grub stage 1....." followed by some non-printable characters.

When GRUB is installed, I get the following output:
Code:
grub> root (hd0,6)
  File system type is ext2fs, partition type 0x83
grub> setup (hd0,6)
  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 (hd0,6)"... failed (this is not fatal)
  Running "embed /boot/grub/e2fs_stage1_5 (hd0,6)"... failed (this is not fatal)
  Running "install /boot/grub/stage1 (hd0,6) /boot/grub/stage2 p /boot/grub/menu.lst... succeeded
Done.
grub> quit
So - now it seems that GRUB is at least being installed, but it is not yet possible to run it.

As requested, my df output is:
Code:
Filesystem      1K-blocks       Used    Available       Use%    Mounted on
/dev/ram3       510952          21368   489584          5%      /
/dev/sda7       2016016         63856   1849748         4%      /mnt
tinybit: thanks for the info on GRUB4DOS - will give that ago once I've reinstalled my WinXP-64 partition.

Cheers,

i.s
 
Old 11-21-2005, 07:24 AM   #15
tinybit
Member
 
Registered: Jul 2005
Location: China
Distribution: Mandriva
Posts: 84

Rep: Reputation: 15
The similar problem repeatedly occur for the old "root+setup" manner. GRUB4DOS has introduced a new method. The new utility bootlace.com can be used to install GRLDR BOOT RECORD onto the MBR. Now that the old method doesn't work, please have a try with bootlace.com. Only two steps are needed:

1. Run bootlace.com to write the MBR of /dev/hda:

bootlace.com /dev/hda

(Note: bootlace.com can also be run under DOS: bootlace.com 0x80)

2. Copy the file GRLDR to the root dir of one of the supported filesystems, which are FAT12, FAT16, FAT32, EXT2, EXT3. (NTFS is OK only when you are lucky).

README.txt within GRUB4DOS has more details(with examples that you can follow).
 
  


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
nvraid -> cannot see raid 0 Mdk 2006 rdoucet Mandriva 0 10-23-2005 05:33 PM
Screen area acting funny in MDK 2006 Kramer Mandriva 13 10-13-2005 11:07 PM
MDK 10.1 Installation Problems thekowgomoo Mandriva 9 03-20-2005 10:19 AM
mdk 10.0 3rd installation cd problems tank3208 Mandriva 2 03-11-2004 12:47 PM
Wine Installation Problems on Mdk 9 dark_forests Linux - Software 4 09-01-2003 10:33 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Mandriva

All times are GMT -5. The time now is 11:11 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