LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Grub question (https://www.linuxquestions.org/questions/linux-newbie-8/grub-question-685246/)

Mol_Bolom 11-21-2008 03:08 PM

Grub question
 
I'm not exactly sure how to label this thread, but I have been fighting with my USB flash drive for quite some time. I've damaged the partition table, fixed the partition table, frugal installed Puppy 4.1.1 on it which worked the first time, removed Puppy, tried to install grub (no go), used lilo -M /dev/sda which returned no errors, used grub-install hd3 which did install grub (with no kernel, just reboots over and over and over).

This time I installed Puppy 4.1.1 onto a hard drive, then copied the files to the USB drive, then tried to install grub, which would constantly complain that there was no kernel. In a last ditch effort I searched through the internet one more time, and this time found out what find does, so I used it "find /boot/vmlinuz" to which it only found the kernels on my hard drives and didn't show anything for my USB.

So why did it not find the USB? Does it not read the USB or would it be that my BIOS probably doesn't allow grub to read the USB? (This computer does boot from the USB, I had booted Puppy when I frugal installed it.

syg00 11-21-2008 03:31 PM

Try "find /boot/stage2" - or "find /boot/grub/stage2". Use what that returns that represents the USB for the "root" command, then issue the "setup". I personally never use the install-grub wrapper.

Mol_Bolom 11-21-2008 03:41 PM

Thanks...

I tried it, however, it only returned my first hard drive (hd0,1).

<Edit>

Checked the drive with gparted and fdisk, everything looks good. ext2 file system and it's bootable...

syg00 11-21-2008 06:21 PM

That says to me grub can't probe it - i.e. it's not being exposed by the BIOS as a bootable drive. BTW, having the boot flag set is irrelevant if that's what your last comment was referring to.

As for your frugal install, are you sure that it was actually booting from the MBR on the USB, and not from the normal MBR ?. I mean really sure. The evidence thus far doesn't agree with such a supposition.

Mol_Bolom 11-21-2008 08:52 PM

Quote:

That says to me grub can't probe it - i.e. it's not being exposed by the BIOS as a bootable drive. BTW, having the boot flag set is irrelevant if that's what your last comment was referring to.
Nah, just writing it just in case it would need to be known.

Quote:

As for your frugal install, are you sure that it was actually booting from the MBR on the USB, and not from the normal MBR ?. I mean really sure. The evidence thus far doesn't agree with such a supposition.
Yes, I am 100% sure. My MBR on two of my HD's is lilo not grub with a nice little pinguin interface. When I loaded the frugal installed puppy, it didn't run any boot loader, it just booted directly up into Puppy, not even the loader that puppy has on the LiveCD. Also, when I did have the frugal installed, I had selected the mbr.bin to be installed to the boot record. When I had grub installed on it, all I got was a prompt that said GRUB then it would reboot the computer.

As for using syslinux, I tried that to no avail, also, but I'm really trying to get grub up and running for there's a few things that I want to experiment with it. Kind of thinking it's just not possible. Maybe I just either need to buy a newer flash drive.

I do have a copy of the boot record on a save file after I installed grub, which of course there wasn't a boot loader, but none the less I have it, and I am trying to find out how to read the C code of fdisk and grub .97 to see how I could go about using C or even freebasic to write a boot loader directly to the boot record, but whew, that's way over my head, at least for now...But I'm still working on it...

syg00 11-21-2008 09:30 PM

Quote:

Originally Posted by Mol_Bolom (Post 3350547)
When I had grub installed on it, all I got was a prompt that said GRUB then it would reboot the computer.

Why didn't you say that earlier ...
Just noticed the following from your first post
Quote:

used grub-install hd3 which did install grub (with no kernel, just reboots over and over and over).
I missed that.
So grub is getting into the USB - should be bootable, I tested on an old 256Meg a couple of weeks back without problems.

You need to copy the /boot (all of it) to the usb, cd over to it, then try "[sudo] grub" from there. Then do the {find, root, setup} thing.

Mol_Bolom 11-21-2008 10:05 PM

Have the files there. Made sure they were there before starting to do this...However, I'll try it from Zenwalk and see what happens. I'll copy the Puppy linux grub files to another dir and copy the one I downloaded and installed on Zenwalk, and give it a try...Fingers crossed...

<Edit> Just went to the directory the USB is loaded under in Puppy real quick and tried find, didn't work. Now I'll reboot and load Zenwalk...

<Edit again> I don't know why I didn't think about it before, but I tried find again before doing anything else, and it just hit me, it's not even showing that the partition that I installed Puppy 4.1.1 to is there, either...These are the directories that "have" a vmlinuz on them (using the hd naming that Zenwalk uses for the drives); /dev/sda2, /dev/sdb2, /dev/sdc1, /dev/sdd1. The only ones that grub is returning are (hd0,1) and (hd2,0) which should be sda2 and sdc1. sdb2 (HD) and sdd1 (USB) are the Puppy linux installations...

<3rd edit> Ok, this is really getting wierd...Just went into sdb2 to look at the Puppy files...They're not there...Nothing's there. When I copied the files from that drive to the USB drive earlier today, Thunar showed that nothing moved or was deleted from the HD...Everything seemed like it was still there...Anyway...I'm going to reinstall Puppy and see if I can't figure out what's going on...

<Hopefully the last edit> Reinstalled Puppy twice, the first time clicked on Boot from USB, did not work. Second time, installed and tried to install grub to MBR of USB, again, did not work. However, to my amazement, the selection I made in lilo to boot up puppy from sdb2 worked this time, where as the first time the kernel failed...So, I think I may have found what the problem was, it didn't correctly install vmlinuz...So I'll give this a try again...

<Follow Up>
Downloaded Slax 6.x.x ran the instlilo.sh which I presume by what it stated it installed lilo as my boot record on the USB drive. Wish it was grub, but eh, at least I know it works now. I'd probably keep slax, however, I really really hate KDE, wish it had either openbox, xfce, or even jwm, but eh, it works.


All times are GMT -5. The time now is 11:11 PM.