LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Kernel (https://www.linuxquestions.org/questions/linux-kernel-70/)
-   -   Deleted /boot: Restore from CD or net possible without re-install? (https://www.linuxquestions.org/questions/linux-kernel-70/deleted-boot-restore-from-cd-or-net-possible-without-re-install-842262/)

JZL240I-U 11-04-2010 02:23 AM

Deleted /boot: Restore from CD or net possible without re-install?
 
I installed openSuSE 11.3 from the 32 bit live KDE disk aside the existing openSuSE 11.3_64 I had already running. I did not want /boot formatted and hoped that the new (kernel) files would just be added. That install crashed ignominiously and left my without a functioning /boot (exchanging GRUB's hd(0) for hd(1) in the same stroke, but that i can live with).

I then had a second go at it, formatting /boot but thereby of course loosing my previous /boot of the openSuSE 11.3_64. The entire rest of that installation is still sitting unharmed on my disk. Now to the question:

What files (and where from) should I add to the new /boot with the 32-bit files to get my 64-bit installation back, or is it well and truly lost? Or can't that be done at all? I'm aware that I would have to edit "menu.lst" but that is not really a problem...

jhladysz 11-04-2010 08:17 AM

i'm afraid you need to reinstall
 
The files in /boot were placed there in the course of installation.
You can work around the whole installation taking your distro cd #1:
mimmicking the whole installation process, but choosing no packages to install and choosing 'do not format' filesystem (preserving old content). This is one of the possiblities, of course.
Good Luck, Jerzy

JZL240I-U 11-04-2010 08:30 AM

I'm aware of the way the system puts the files there, thank you. Let me phrase my question differently:

Could I copy kernel-2.36.y.x.z-nml and the corresponding initrd from somewhere into my /boot and then just add a stanza in menu.lst and everything is good and proper? Or is the kernel locked to its system via some arcane procedures during the install, which can't be reproduced with acceptable effort by hand (and what would these be)?

I found only .rpm files at the SuSE site, anybody know of an extracted(?) kernel and initrd?

TobiSGD 11-04-2010 08:32 AM

If your 32-bit OS installed grub I think that only the kernel and the initrd (if there is one, don't know much about Suse) are needed to boot your 64-bit OS. And of course some editing of the menu.lst, as you already stated.

Edit: For extractin RPMs you may ha a look here.

syg00 11-04-2010 08:37 AM

You should be able to boot a 64-bit install CD and chroot into your 64-bit system (need to be same arch I believe). Then simply (re-)install the rpms for grub and the kernel. Won't find other systems and add them to the config file - that's actually done by the (distro) installer, not the grub installer. You'll have to do that by hand.

udaman 11-04-2010 08:38 AM

There's more to /boot than just a kernel and initrd. During the install process, or kernel upgrade process, the System-map and config files are also generated. I'm not sure that it'll boot without them. Below is the contents of my Suse 11.3, 64B /boot dir. Also the kernel install is converted to vmlinuz-xxxxx. If you do manange to boot it, you should do a kernel upgrade and those files will be created.

Don't use a common /boot directory, let each distro make it's own. I'd be happy to email you the proper files. Send a PM.

Code:

> ls /boot
backup_mbr                  initrd                              symtypes-2.6.34.7-0.5-desktop.gz  vmlinux-2.6.34.7-0.5-desktop.gz
boot                        initrd-2.6.34.7-0.4-desktop          symvers-2.6.34.7-0.4-desktop.gz  vmlinuz
boot.readme                  initrd-2.6.34.7-0.5-desktop          symvers-2.6.34.7-0.5-desktop.gz  vmlinuz-2.6.34.7-0.4-desktop
config-2.6.34.7-0.4-desktop  memtest.bin                          System.map-2.6.34.7-0.4-desktop  vmlinuz-2.6.34.7-0.5-desktop
config-2.6.34.7-0.5-desktop  message                              System.map-2.6.34.7-0.5-desktop
grub                        symsets-2.6.34.7-0.5-desktop.tar.gz  vmlinux-2.6.34.7-0.4-desktop.gz


JZL240I-U 11-04-2010 09:07 AM

Quote:

Originally Posted by TobiSGD (Post 4149046)
...Edit: For extractin RPMs you may ha a look here.

Great. Thanks for that link, TobiSGD :).

I just hope the kernel rpm contains the initrd as well...

JZL240I-U 11-04-2010 09:10 AM

Quote:

Originally Posted by syg00 (Post 4149048)
You should be able to boot a 64-bit install CD and chroot into your 64-bit system (need to be same arch I believe). Then simply (re-)install the rpms for grub and the kernel. ... You'll have to do that by hand.

Hmm. I used the 64-bit live KDE CD, hope I can find those there. Grub is there, I did a 32-bit install, I just need the kernel and initrd (I think). I'm not really anymore afraid of menu.lst ;).

JZL240I-U 11-04-2010 09:16 AM

Quote:

Originally Posted by udaman (Post 4149049)
...the System-map and config files are also generated. I'm not sure that it'll boot without them.

That's what Im afraid of...

Quote:

Originally Posted by udaman (Post 4149049)
Below is the contents of my Suse 11.3, 64B /boot dir. Also the kernel install is converted to vmlinuz-xxxxx. If you do manange to boot it, you should do a kernel upgrade and those files will be created.

vmlinuz is just a symbolic link AFAIR, I can create one myself. The others -- well I'll find out.

Quote:

Originally Posted by udaman (Post 4149049)
Don't use a common /boot directory, let each distro make it's own. I'd be happy to email you the proper files. Send a PM.

I used a /boot partition in the erroneous assumption that it would make it easier to have different kernels and distros at hand in one place booted by just one instance of GRUB. I'll send a PM next, thanks for your kind offer :).

<edit> Your PM is disabled, I'll send a mail instead. </edit>

syg00 11-04-2010 09:31 AM

System.map and the config are irrelevant for boot - the rpm should re-install them anyway.

udaman 11-04-2010 10:38 AM

Quote:

Originally Posted by syg00 (Post 4149104)
System.map and the config are irrelevant for boot - the rpm should re-install them anyway.


Thanks for that info, I'll file it in my memory.

@JZL240I-U

I've mailed you the vmlinuz. With instructions on how to make an initrd, you will need the kernel-source from suse. But syg00 recommendation of booting from the CD and installing from there, should work.

Good luck.

JZL240I-U 11-05-2010 02:29 AM

Good morning everybody :).

I had only a little time to experiment yesterday in the evening. Here is what I did:

I booted the 11.3_64 SuSE from its live CD and found a kernel in /boot. initrd was in /boot/grub/x86_64/loader with a size of 18 MB which is about double the size of its 32-bit counterpart (9.3 MB). I then created a stanza in menu.lst and booted.

GRUB showed its new menu as expected. Upon selecting the new entry boot commenced with some messages that are usually created during boot from CD (including something about "KIWI" now trying to boot from removable medium) while there was no CD in the drive. Boot then stopped.

Not truly and really a surprise. Ah, well.

I found your files in my mail, thanks again udaman. If it is not asking too much, could you please send your initrd as well? I'll try the other suggestions over the weekend too, but I think that is the smoothest way to proceed.

@syg00 I'll have a look at the rpm of course. I'll also look at the possibility to re-install from the CD but I have my misgivings there: this is the live CD, not SuSE's 4.7 GB DVD install medium, but we'll see. Creating a new initrd ... well, I'm not too keen to do that. I live in the country and have only mobile internet, downloading the source can be a long process and in the meantime I wait unproductively. It would probably be faster to re-install (but I'd learn less :(). On the other hand the weather forecast advised rain and wind for saturday ... hmm, I'll let you know ;).

udaman 11-05-2010 07:42 AM

Quote:

Originally Posted by JZL240I-U (Post 4149889)
Good morning everybody :).
If it is not asking too much, could you please send your initrd as well? I'll try the other suggestions over the weekend too, but I think that is the smoothest way to proceed.

I'll mail it right away, but it's built for my machine, with my module needs, so I'm not sure it'll work. Let us know if you have success.

JZL240I-U 11-05-2010 08:10 AM

Thank you for a speedy delivery udaman ;). I think it is reasonable to assume that it will at least work with your kernel (which I already copied over to my system). From then on no more than an active line to the SuSE repositories is required, I'll install the newest desktop kernel from there and that would be it.

I'll report on Monday latest. Thanks again and have a nice weekend.

udaman 11-05-2010 08:55 AM

This world of ours has gotten a great deal smaller. I read your good morning message while sipping my morning coffee, and you're near the end of your work day, and about to begin your weekend. Truly amazing times we live in.

Cheers!


All times are GMT -5. The time now is 02:04 AM.