Re: [opensuse] how to restore vmlinux and initrd

On Wed, Apr 6, 2011 at 9:10 PM, Felix Miata <mrmazda@xxxxxxxxxxxxx> wrote:
On 2011/04/06 18:25 (GMT-0500) Sunny composed:

I have very bad problem here. I have opensuse 10.0 machine. After hw
issue, the /boot partition got corrupted.

I made an image of all the partitions to a new hdd. All of them pass
fsck without any problems, and all the files are there.

But /boot fails fsck, and after repair vmlinux is lost, initrd is lost
etc. I have an image of the partition, so I can play with it as much
as I can.

Is this a laptop? How did you partition the new HD/with what tool? How did
you make that image? Maybe your image and the location you're trying to
restore it to do not match? Is the new HD bigger? Maybe its legacy geometry
does not match that from the old. Maybe it's not located the same number of
sectors from the start of the disk. It could be helpful for us to know what
fdisk -l currently reports, and even better if you had that info from the
old HD.

Is there a way I can rebuild /boot, like if I boot a live cd, then
chroot maybe to the original / partition, etc.

Yes. If it was here I would create the /boot from scratch, then copy the
required files from the saved image, somewhat like what I do with a new HD.
I always partition and install bootloader before installing any Linux
operating system. Typically I use a Knoppix CD to mkfs.ext2 my /boot
partition, then copy the Knoppix library of Grub files to the new
partition's grub directory, then run the Grub shell to manually install Grub
to that partition's boot sector. Asssuming the /boot partition is the first
primary at the head of the HD:

Thanks Felix, here's the situation.

This is working server. There were failure in the hw raid. I made
images with clonezilla of all partitions. Also, I did dd of the
partitions to be on the safe side.

When I do fsck on the image file, it reports errors.

If I copy (dd) the image to a new partition (same size), still fsck
shows problems.

As far as I can see, the missing critical files are System.mapxxxxxxx
and vmlinuxxxxxxx (xxx is ver. nr of the kernel).

The initrd file is ok, I was able to gunzip and cpio it, so its not corrupted.

I have other similar server, same 10.0, same partition setup.
Unfortunately it appears it was updated more recently than the bad
one, so the files it has in its /boot are newer version.

I tried to copy this machines /boot to the bad one. Its ok, it starts
booting, but after that it fails, as it can not find the right kernel
modules after the real / is mounted, as the vmlinux is different

So, I guess my only chance is if I find the kernel rpms for the exact
version I have on this machine, boot with recue, chroot and hope that
it rebuild the missing files.

unfortunately 10.0 is so old, that there are no more repositories.

I'll appreciate any other options one might have


Svetoslav Milenov (Sunny)

Artificial Intelligence is no match for natural stupidity.
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse+help@xxxxxxxxxxxx

Relevant Pages

  • Re: booting linux using a floppy
    ... which kernel of the list to boot from. ... Note that this will at this point remove your ability to boot into windows. ... I think I recall that you said the grub loader... ... and grub will search for a partition containing grub's stage2 file ...
  • Re: Help 10.3 a mess After YOU Upgrade
    ... GRUB stage1. ... The stage1 goes in boot sector of system root partition. ... sda6=/1st SUSE install ... and kernel as defined for selected menu item. ...
  • Re: LiILO in eigener kleiner Boot-Partition?
    ... (falls der Kernel eine initrd benutzt). ... Die beiden anderen Werte hängen vom zu bootenden Linux ab. ... und diese initrd zusammen mit LILO oder GRUB und wohin kommen dann die ... /boot Partition plaziert werden sollen? ...
  • Re: Grub config
    ... > so I created a logical partition and installed it there. ... > I've tried various combinations of telling grub where to find these ... > things, with the explicit partition for kernel and initrd, and fiddling ... install grub onto your system. ...
  • Re: Grub Manual
    ... I have digested what you all have said and applied it to the small file I wrote on the Grub Manual. ... Please no more about what is root. ... Many people keep the entire Linux in one partition and in that case both of the root point to the same partition. ... Your computer often wants to use the name of the kernel. ...