LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   lost grub AND swap partition (https://www.linuxquestions.org/questions/linux-newbie-8/lost-grub-and-swap-partition-299811/)

Frelov 03-09-2005 08:03 PM

lost grub AND swap partition
 
Please forgive what is, by the looks of my search results, another spin on an already worn out question.

Problem:

multi boot, WinME/WinXP/RH9. XP became corrupted yet again. Trying to not have to reinstall redhat 9, I researched and jotted down the instructions for restoring grub and reloaded winxp

Complication: partition housing win xp had to be deleted and recreated. At this point I decided to resize partition to allow more space for other linux versions that I'd like to eventually try later

Evidently this changed the hard drive reporting for linux. the swap file (originally on hda3) is no longer recognized by red hat.

Attempted So far:
1) I booted using the restore floppy and typed "linux restore" at the "boot:" prompt.
2) RH9 automatically mounts system on /mnt/sysimage so I:
chroot /mnt/sysinfo
grub-install /dev/hda

Outcome:
"Kernel error . . . . . . ."
"invalid stack 0000 . . . . . . ."

I've researched and downloaded some instructions for entering grub commands manually but I am a newbie and don't know how to determine which partition is /boot for linux

I tried to "upgrade" only using rh9 anaconda installer but it fails due to the swap file no longer being /hda3.

I have 2 hd's with the meat of rh9 on the slave (swap was on master) and the meat of windows on master with swaps on slave.

most of the articles I can find on here appear to assume the readers have a greater experience/knowledge with linux than I do and give many general directions without specific commands, etc.

could someone please take the time to help an ignorant newbie such as myself? Many thanks for your kindness and patience.

Frelov 03-09-2005 10:03 PM

Forgot to specify.

my apologies. I forgot to specify specific questions after explaining my delima:

1) how do I find definitively which partition is boot and which is now swap while in rescue mode?
2) which file do I edit while in rescue mode to force the current linux/rh9 installation to recognize the change in the swap partition?
3) after fixing the now invalid pointer to the swap partition will grub-install work then and if not what commands do I run to manually force grub to reinstall?

I'm trying to avoid re-installing rh9 at all costs as I havent done my weekly backups and have data and email I'd like to save and cannot get to it from rescue mode due to my ignorance of the system. All help is appreciated. Thanks.

Frelov 03-09-2005 11:05 PM

found it by trial and error
 
well, I found everything by trial and error with only minor setbacks (I hope).

For any who's genuinely interested here is my solution:

1) boot using the emergency start disk (downloadable in the rh9 ftp site if you don't have one)
type linux rescue at the boot: prompt and after the linux command prompt comes up

chroot /mnt/sysimage (default system mounting for rh9 boot floppy)
sfstab
this shows SOME info on the partitions, including which is swap (mine was hda4)
I was able to correctly guess that my root partition was hda2 since it was the only partition in which the cylinders/sectors combo equated to roughly the size I had specified for root. (thank God I'm not totally ignorant)

cd etc
vi fstab (edit the fstab file to reflect the correct swap partition)
:wq (writes and quits in vi)

vi grub.conf (switch root from hd0,1 to hd0,2 since my root is now on hda3)
:wq

grub-install /dev/hda (JUST to be safe)
exit
exit (I don't know why but the floppy requires it twice to reboot)


had I not tried running grub-install /dev/hda1 prior to all this everything would be working perfectly. now I have to try to figure how to restore the ntloader without ruining my mbr again ;). I"ll post in this forum again to see if anyone can answer that question for me (will be interesting the curses I get for asking a windows question on a linux forum at least ;)

Frelov 03-09-2005 11:06 PM

oops
 
in previous note sfstab SHOULD have been sfdisk. sorry


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