PDA

View Full Version : partition number changed grub install problem



ramaswamyps
03-12-2006, 03:27 PM
i had to delete a partition in my system and new partition table
knoppix does not boot.
i am not able to reinstall grub.
how do i rescue my knoppix installation now on hda10 mbr on root partition.
previously it was on hda11.
someone help to recover this installation please.

nad
03-12-2006, 06:20 PM
I am not completely clear as to where grub is installed. The MBR or your knoppix partition?

Either way, you will have to edit (as root) the files /etc/boot/grub/menu.lst and /etc/fstab to correctly point to your knoppix partitions (your swap partition is also probably changed).

Now, you may have to reinstall grub to correct the hard coded location of the stage1 (?) code.

Boot from the liveCD and from a root terminal mount your knoppix installation and enter the command: chroot </mount_point> and issue the command: grub-install <grub_location> (either (hd0) or /dev/hda or your partition?).

ramaswamyps
03-12-2006, 07:22 PM
i tried it before.
mounted /dev/hda10 /mnt
chroot /mnt /bin/bsh
i had edited fstab for / hda10 swap hda11
grub-install /devhda10
it gave me an error error reading stage 1

then sewcond time it gave an error read error stage 5 but it is not important succeeded.
but only grub cli is appearing on invoking hda10
tab shows options of vmlinuz vmlinus-2.6.12 initrd.img -2.6.12 initrd.img etc
what line should be booting in CLi
which of these vmlinuz and initrd.img will boot
i tried to boot with vmlinuz.2.6.12 initrd.img-2.6.12
then it starts and stops saying kernel panic try telling kernel init level
tried runlevel 3
no success.

still i have not edited menu.list
i will look into that and get back here.

nad
03-12-2006, 07:45 PM
I see a couple of problems here, possibly typos.

"grub-install /devhda10" should be grub-install /dev/hda10

"then sewcond time it gave an error read error stage 5 but it is not important succeeded". This is probably the stage2 code.

"i tried to boot with vmlinuz.2.6.12 initrd.img-2.6.12". Grub needs to know where both of these files are located.

"still i have not edited menu.list ". Once you have editted /boot/grub/menu.lst , at the grub command line simply issue the commands: root /dev/hda10 <enter> setup /dev/hda10 <enter>

ramaswamyps
03-13-2006, 04:00 AM
there is lot of trouble
root (hd0,10)
unknown format
the rest is given below
grub>

grub> setup /dev/hda10

Error 11: Unrecognized device string

grub> root (hd0,9)
Filesystem type is ext2fs, partition type 0x83

grub> setup /dev/hda9

Error 11: Unrecognized device string

grub> setup (hd0,9)
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,9)"... failed (this is not fatal)
Running "embed /boot/grub/e2fs_stage1_5 (hd0,9)"... failed (this is not fatal)
Running "install /boot/grub/stage1 (hd0,9) /boot/grub/stage2 p /boot/grub/menu
.lst "... succeeded
Done.

grub> setup (hd0,10)
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,10)"... failed (this is not fatal
)
Running "embed /boot/grub/e2fs_stage1_5 (hd0,9)"... failed (this is not fatal)
Running "install /boot/grub/stage1 (hd0,10) /boot/grub/stage2 p /boot/grub/men
u.lst "... succeeded
Done.

grub>

actually /dev/hda11 is my swap drive

there is a confusion of dev numbers.
looks like grub takes nmber +1 as device.
let me reboot and see now

grub>

ramaswamyps
03-13-2006, 04:14 AM
yes now i got into knoppix bootup and all work well.


eben though i feel stupid not really know what i have done.
i still feel it worked by fluhe
seems i have to learn more about grub working.
i am not sure i can do this again . i have to remove another 2 more partitions.and reorganise my comp.
i want to move 3 installations to other partitions.
well kets see what happens.


thanks for the time and guidance nad

nad
03-13-2006, 05:34 AM
You are welcome. I am glad that I was of some assistance.

Grub uses a _zero_ based numbering scheme. Your first hard drive, /dev/hda, is (hd0). Your first partition on that drive (hd0,0).

Do yourself a favor at some point in your reorganization. Create a separate boot partition (usually the first one on a drive), install grub to your MBR and point it to this boot partition. In this way you may add and delete partitions at will and simply update the one /boot/grub/menu.lst whenever necessary. Just make certain that should you add another operating system do not install grub again, and once again, simply edit your menu.lst with the parameters for your new os while adding the necessary startup images to the /boot directory. This can usually be accomplished by booting to a different operating system after a fresh install, mounting your new root directory and copying the special startup files to your existing boot partition.

ramaswamyps
03-15-2006, 05:30 PM
that suggestion of using boot partition is good only if all other installations use grub for booting..my primary linux is fedoracore4 and its having the mbr.
i cannot have any other format than ext2 or 3 then only it can chainload the newly installed partition.
thats why i have put grub /lilo to its own root partition.for other 8 installs of linux.
as mbr dies for some reason then all of them will be dead.
with boot loader in root partition recovery or boot is easy just point to the partition to boot.

nad
03-15-2006, 07:40 PM
GRand Unified Bootloader will boot most x86 operating systems. It doesn't matter where the boot images for a particular operating system are stored as long as it knows where to find them. Hence, /boot/grub/menu.lst .

Grub wiil map drives and chainload as required. You may use the ext2 filesystem for my referenced separate boot partition. Several filesystem types are supported.

I am not familiar with fedora, but, imagine that it uses either lilo or grub, in which case your method of chainloading grub is redundant though it works for you.