Grub is messed up, but can't boot from USB. How to fix it?

Using applications, configuring, problems
Post Reply
Message
Author
SylaMirelle
Posts: 8
Joined: Sat 04 Aug 2007, 05:51

Grub is messed up, but can't boot from USB. How to fix it?

#1 Post by SylaMirelle »

I'm not quite sure if this is the correct place for such a thread, but it'll do.

Background:
I installed puppy onto a flash stick from someone else's computer, and after a bunch of fiddling, I finally got the thing to boot. Oh was I happy. I even nicknamed the thing Puppy Stick =] I'm so cheesy.
Shortly thereafter, I bought all the necessary components to build a new computer, as I had recently moved and left all but my hard drives behind as far as my previous computer went. Quite a nice box, too, but I won't get into it, as it doesn't belong in this thread. >.> I sound like I'm rambling.
Anyway, I installed xp64 on it and got everything working, and even made a separate partition for linux (yes, a swap too). I got my new computer set up and installed everything I wanted, made it work the way I wanted it, etc. I didn't do anything with the linux partitions, though. Today, however, I decided to install puppy to my HD so I could dual boot, and wouldn't have to use my Puppy Stick every time. Little did I know what a headache that decision was going to cause me.


Alright, enough rambling. Here's the juicy headache-inducing bits:

From my Puppy Stick, I installed Puppy to /dev/sda3 and used grub to add a bootloader with entires for XP64 and Puppy in the MBR (I hate floppies, and I wasn't about to give up my Puppy Stick), and had it put the grub data on sda3 like it wanted. I noticed it put a backup of the MBR on the same drive. Having a way to undo the changes made me feel rather safe.
Now, I removed my flash stick and rebooted. Grub came up, but neither option worked. Grub pointed the XP64 boot option to my flash stick (sdb1), and it put vmlinuz, etc in the wrong folder on sda3.
So I put my flash stick back in and booted using that and tried to resolve the problem. I mounted sda3 and put vmlinuz, etc in the proper folder, and tried booting again. didn't work.
Now, I put my flash stick back in and tried to boot, and got a very disturbing message saying that it could not boot.
After fiddling around, I figured out that it was looking for Pup_217.sfs on sda first, then going to hdb (dvd), and finally sdb where I was booting from.
So, every time I boot with the hard drive plugged in, it tries to boot from the version of puppy installed on sda3, and crashes.
If I unplug my hard drive, puppy boots fine from my flash stick, but I cannot access my hard drive (obviously) so I cannot restore my MBR or delete the puppy install.
If I leave the hard drive plugged in, Puppy won't boot.
If I plug in the hard drive after Puppy boots, it won't see the drive since it wasn't there at boot. Besides, doing that is a bad idea to begin with.

I mean, I could fdisk the whole drive to oblivion, but then I lose everything, and if I annihilate sda3, I lose the backup of my MBR, so neither of those two are viable options.


How in the world do I remedy this?



Edit: I found the problem, or at least I think I did.
in /initrd/pup_ro1/etc/rc.d/PUPSTATE it loads Pup_217.sfs from sda3 as well as a few others
PDEV1='sda3'
DEV1FS='ext3'
PUPSFS='ext3,sda3,/boot/pup_217.sfs'
Like I said, I think this is the problem, but I'm not sure, and let me say why: I have a copy of all my puppy stick files on another computer, and as soon as it refused to boot, I tried copying all of those back onto the stick. The problem didn't go away, even though I copied my original initrd.img over, which should have replaced this with the correct one, but didn't.

I'm really confused now. >.<'



PS: Yay, first post. (times about twenty edits -.-)

jonyo

#2 Post by jonyo »

I'd run live cd save file to HD & then spend time on sortin out the rest.

User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#3 Post by rcrsn51 »

SylaMirelle: Could you list the files that are currently in sda3? We also need to see your menu.lst file which should be on sda3 in the /boot/grub folder.

User avatar
Dougal
Posts: 2502
Joined: Wed 19 Oct 2005, 13:06
Location: Hell more grotesque than any medieval woodcut

Re: Boot problem

#4 Post by Dougal »

SylaMirelle wrote:I mean, I could fdisk the whole drive to oblivion, but then I lose everything, and if I annihilate sda3, I lose the backup of my MBR, so neither of those two are viable options.
No need to do anything drastic.
It's probably just the grub menu that needs fixing.
Boot the cd, then open the file /mnt/sda3/boot/grub/menu.lst and make sure the right partitions appear there.
In your case the entry should probably show "hd(0,2)" (for sda3).
What's the ugliest part of your body?
Some say your nose
Some say your toes
But I think it's your mind

User avatar
Flash
Official Dog Handler
Posts: 13071
Joined: Wed 04 May 2005, 16:04
Location: Arizona USA

#5 Post by Flash »

To refresh your memory, booting the CD with the "puppy pfix=ram" option will cause Puppy to load into RAM from the CD only, ignoring whatever pup_save files or Grub there might be on a hard disk drive (although it will mount a swap partition if it finds one.) Then you can mount the hard disk drive(s) and have your way with whatever is on them.

SylaMirelle
Posts: 8
Joined: Sat 04 Aug 2007, 05:51

#6 Post by SylaMirelle »

To refresh your memory, booting the CD with the "puppy pfix=ram" option will cause Puppy to load into RAM from the CD only, ignoring whatever pup_save files or Grub there might be on a hard disk drive (although it will mount a swap partition if it finds one.)
Though I do not have a Puppy CD, would I also be able to do that with my flash stick?


I did manage to get my computer to boot to XP by fiddling around in grub, though, so I can still use my computer, and I backed up the irreplacable data as well.
I feel -so- stupid.
Could you list the files that are currently in sda3? We also need to see your menu.lst file which should be on sda3 in the /boot/grub folder.
files on sda3 as i remember them:
/boot/vmlinuz
/boot/initrd
/boot/Pup_217.sfs
/boot/(grub data)
Some others I cannot remember

User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#7 Post by rcrsn51 »

Ordinarily, the pup_217.sfs file should be at the root of the drive and not in the /boot folder. Also you need to show us your menu.lst file to determine if the other files are in the right place.

SylaMirelle
Posts: 8
Joined: Sat 04 Aug 2007, 05:51

#8 Post by SylaMirelle »

That is sorta the problem: I can't boot puppy, as it always tries to boot from sda3, which crashes. I can load XP just fine, but XP cannot read sda3 because it is an ext3 fs.

I could look at the grub menu and list the info from there, but I don't think that is going to be of much use.

SylaMirelle
Posts: 8
Joined: Sat 04 Aug 2007, 05:51

#9 Post by SylaMirelle »

I think I'm going to format sda3 to kill the broken puppy install (plus grub data, too...), then boot from my flash stick, and reinstall grub to the MBR and save the data on my XP partition (if that works). If not, I'm going to save the data to sda3 again, but keep the partition empty.
Or I might get really crazy and try the whole thing all over again, since I know I can recover my computer if something goes wrong yet again.
~ Ash

SylaMirelle
Posts: 8
Joined: Sat 04 Aug 2007, 05:51

#10 Post by SylaMirelle »

Even though I doubt anyone is reading this, here's an update, albeit an unfortunate one:

I was going to wipe sda3 and re-install the grub bootloader from my puppy stick, but i ran into a slight problem: my motherboard stopped recognizing anything - ide, sata, usb - so I had to return it for a replacement. At the same time, I replaced my hd as it was also giving me problems (randomly not working until I plugged it into a different sata plug), so with both of those gone, my problem vanished too. Then again, so did my data.

So I'm on a new hd and mobo (well, same model anyway), and am in the process of setting everything up.


oh, I added a new rule to my list:
Rule #32: Never purchase anything that has already been opened.
returns = bad. if someone returned something, it probably didn't work then, so why is it going to work now?



Anyway, I rather think that closes this thread.
Thanks for your help everyone!

~ Ash

Post Reply