LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 01-27-2005, 07:36 PM   #31
Ekpyrotic
Member
 
Registered: Jul 2003
Distribution: Mandrake, Debian, Fedora, Gentoo (almost)
Posts: 57

Original Poster
Rep: Reputation: 15

Sadly I can't do that. Remember I'm booting of Knoppix here; prior to chrooting, everything above /mnt is read only.
 
Old 01-27-2005, 07:38 PM   #32
uberNUT69
Member
 
Registered: Jan 2005
Location: Tasmania
Distribution: Xen Debian Lenny/Sid
Posts: 578

Rep: Reputation: 30
Quote:
Originally posted by Ekpyrotic
Ok, do either of you have any thoughts on the following two things:

1) hda5 automagically debootabalizing itself

2) hda5 showing up as being last modified in 1998

??

Oh, and by the way, thanks a lot for all your help so far.
1 => hda4???
2 => dunno

np
 
Old 01-27-2005, 07:39 PM   #33
Ekpyrotic
Member
 
Registered: Jul 2003
Distribution: Mandrake, Debian, Fedora, Gentoo (almost)
Posts: 57

Original Poster
Rep: Reputation: 15
knoppix@ttyp1[knoppix]$ pkgdatadir=/mnt/hda5/boot/grub /mnt/hda5/sbin/grub-install --recheck --root-directory=/mnt/hda5 /dev/hda
/usr/share/grub/i386-redhat/stage1: Not found.
knoppix@ttyp1[knoppix]$


Grrrr....

knoppix@ttyp1[knoppix]$ mkdir -p /usr/share/grub/i386-redhat
mkdir: cannot create directory `/usr/share/grub': Read-only file system

See above post.
 
Old 01-27-2005, 07:43 PM   #34
Dark_Helmet
Senior Member
 
Registered: Jan 2003
Posts: 2,786

Rep: Reputation: 374Reputation: 374Reputation: 374Reputation: 374
1) don't think it's a problem. We're trying to install to the first sector of the hard drive, not the first sector of hda5. hda5 would need to be bootable if the only boot loader available was the first sector of hda5.

2) no idea...

Let me look at the script some more to see about the pkgdatadir thing. It might require a quick edit.
 
Old 01-27-2005, 07:43 PM   #35
uberNUT69
Member
 
Registered: Jan 2005
Location: Tasmania
Distribution: Xen Debian Lenny/Sid
Posts: 578

Rep: Reputation: 30
like I said, you haven't chrooted to hda5 (AFAICT)
(see http://wiki.truffula.net/truffula/in...neLinuxSystems)
eg. chroot /mnt/hda5
_then_ run grub-install without the /mnt/hda5 prefix
 
Old 01-27-2005, 07:49 PM   #36
Ekpyrotic
Member
 
Registered: Jul 2003
Distribution: Mandrake, Debian, Fedora, Gentoo (almost)
Posts: 57

Original Poster
Rep: Reputation: 15
Tried that waaaay back at the beginning. Tried it again, just to make sure:

root@ttyp1[knoppix]# chroot /mnt/hda5
[root@Knoppix /]# grub-install --recheck /dev/hda
Probing devices to guess BIOS drives. This may take a long time.
/dev/hda: Not found or not a block device.
[root@Knoppix /]#
 
Old 01-27-2005, 07:51 PM   #37
Dark_Helmet
Senior Member
 
Registered: Jan 2003
Posts: 2,786

Rep: Reputation: 374Reputation: 374Reputation: 374Reputation: 374
I was suggesting that he not chroot because if he does (and if his system uses udev), then there won't be a /dev/hda5 device file because the udev daemon is not available. That could be causing the problem. Essentially, I'm trying to get the grub-install script to use the Knoppix device files for IO access, but force it to use only the files located on hda5.

If the non-chroot route is still something worth trying, then execute this command:
Code:
sed -i.backup 's@pkgdatadir=.\+@pkgdatadir=/mnt/hda5/boot/grub@' /mnt/hda5/sbin/grub-install
Note, this will actually change the script, but it will create a backup in the same directory. If you give this a try, and it doesn't work, then replace the modified one with the backup.

To verify it changed the file, do:
Code:
grep "pkgdatadir=" /mnt/hda5/sbin/grub-install
If it looks good, then run :
Code:
/mnt/hda5/usr/sbin/grub-install --recheck --root-directory=/mnt/hda5 /dev/hda

Last edited by Dark_Helmet; 01-27-2005 at 07:59 PM.
 
Old 01-27-2005, 07:55 PM   #38
Ekpyrotic
Member
 
Registered: Jul 2003
Distribution: Mandrake, Debian, Fedora, Gentoo (almost)
Posts: 57

Original Poster
Rep: Reputation: 15
Okay, just so you're aware, my grub is located in /mnt/hda5/boot/grub and my grub-install is in /mnt/hda5/sbin . I assume your patch will still work. I'm trying it now.
 
Old 01-27-2005, 07:58 PM   #39
Dark_Helmet
Senior Member
 
Registered: Jan 2003
Posts: 2,786

Rep: Reputation: 374Reputation: 374Reputation: 374Reputation: 374
Yeah, sorry, the command would need to be changed to reflect that. I'll go back and edit it. I honestly just had a mental lapse and forgot the /boot part.
 
Old 01-27-2005, 07:59 PM   #40
Ekpyrotic
Member
 
Registered: Jul 2003
Distribution: Mandrake, Debian, Fedora, Gentoo (almost)
Posts: 57

Original Poster
Rep: Reputation: 15
Using my slightly altered version of your instructions:

root@ttyp2[knoppix]# sed -i.backup 's@pkgdatadir=.\+@pkgdatadir=/mnt/hda5/boot/grub@' /mnt/hda5/sbin/grub-install
root@ttyp2[knoppix]# grep "pkgdatadir=" /mnt/hda5/sbin/grub-install
pkgdatadir=/mnt/hda5/boot/grub
root@ttyp2[knoppix]# /mnt/hda5/sbin/grub-install --recheck --root-directory=/mnt/hda5 /dev/hda
cp: cannot stat `/mnt/hda5/boot/grub/stage1': No such file or directory
 
Old 01-27-2005, 08:01 PM   #41
Ekpyrotic
Member
 
Registered: Jul 2003
Distribution: Mandrake, Debian, Fedora, Gentoo (almost)
Posts: 57

Original Poster
Rep: Reputation: 15
Oh Goodness me!!!!! Reading the output from that last attempt, I acted on a whim and checked up on something. What do you make of this????

root@ttyp2[knoppix]# cd /mnt/hda5/boot/grub
root@ttyp2[grub]# ls
device.map grub.conf grub.conf~ menu.lst splash.xpm.gz

It's like I somehow deleted everything in the grub directory.

And sure enough!

root@ttyp2[grub]# chroot /mnt/hda5
[root@Knoppix /]# grub-install --recheck /dev/hda
/mnt/hda5/boot/grub/stage1: Not found.
[root@Knoppix /]#

No wonder it couldn't find Stage 1, it no longer exists! How on earth did we do that?

Last edited by Ekpyrotic; 01-27-2005 at 08:02 PM.
 
Old 01-27-2005, 08:05 PM   #42
Dark_Helmet
Senior Member
 
Registered: Jan 2003
Posts: 2,786

Rep: Reputation: 374Reputation: 374Reputation: 374Reputation: 374
I went to go look at the grub-install script, and they did something I don't agree with... The script deletes the files in the grub installation directory, before it copies them over. If you give me a minute or two, I can have my web server post the stage files you need (unless you have them elsewhere on your system). I have the same version of grub, so the files will be fine to copy over.

Also, do a
Code:
find /mnt/hda5 -type f -name "stage1"
You probably still have them on your system in a share directory. That directory is what pkgdatadir should have been.

Last edited by Dark_Helmet; 01-27-2005 at 08:07 PM.
 
Old 01-27-2005, 08:07 PM   #43
Ekpyrotic
Member
 
Registered: Jul 2003
Distribution: Mandrake, Debian, Fedora, Gentoo (almost)
Posts: 57

Original Poster
Rep: Reputation: 15
Oh yes, please post them on your webserver.

And by the way, if we resolve this I will post ANYTHING you want on my webserver from now until eternity.

I 'touch'ed /dev/hda5, so we've gotten rid of that weird 1998 reference:

root@ttyp1[knoppix]# ls -l /dev | grep "hda5"
brw------- 1 root root 3, 5 Jan 28 02:11 hda5

Last edited by Ekpyrotic; 01-27-2005 at 08:13 PM.
 
Old 01-27-2005, 08:16 PM   #44
Ekpyrotic
Member
 
Registered: Jul 2003
Distribution: Mandrake, Debian, Fedora, Gentoo (almost)
Posts: 57

Original Poster
Rep: Reputation: 15
I assume this is what you mean:

root@ttyp1[mnt]# ls /mnt/hda5/usr/share/grub
i386-redhat

So, how should I repatch, rerun grub-install?
 
Old 01-27-2005, 08:24 PM   #45
Ekpyrotic
Member
 
Registered: Jul 2003
Distribution: Mandrake, Debian, Fedora, Gentoo (almost)
Posts: 57

Original Poster
Rep: Reputation: 15
PROBLEM SOLVED!!!! I think:

After applying the new and updated patch:

root@ttyp2[/]# /mnt/hda5/sbin/grub-install --recheck --root-directory=/mnt/hda5 /dev/hda
Probing devices to guess BIOS drives. This may take a long time.
Installation finished. No error reported.
This is the contents of the device map /mnt/hda5/boot/grub/device.map.
Check if this is correct or not. If any of the lines is incorrect,
fix it and re-run the script `grub-install'.

(fd0) /dev/fd0
(hd0) /dev/hda
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Error 21: Selected disk does not exist satimis Linux From Scratch 2 08-04-2005 02:35 PM
Grub Error 17: Cannot mount selected partition and other Grub problems Sebastian Naitsabes Linux - General 1 07-05-2005 08:33 AM
Grub SuSe, XP, Redhat Error 17: Cannot mount selected partiton hrg Linux - Laptop and Netbook 1 07-16-2004 04:34 PM
Grub SuSe, XP, Redhat Error 17: Cannot mount selected partiton hrg Linux - General 1 07-16-2004 09:14 AM
grub jamming when windows selected nikd Linux - Newbie 10 11-22-2003 01:42 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 09:37 AM.

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
Open Source Consulting | Domain Registration