[SOLVED] restore bootability to an Ubuntu 14.04 64 bit server
Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
restore bootability to an Ubuntu 14.04 64 bit server
Oh, dear.
I was doing routine maintenance on my server when I noticed a lot of crufty old kernels. I did an `apt-get autoremove' and it rendered the server unbootable. It just brings up an Ubuntu 12.04 (yes, it was running 14.04) splash screen and hangs. Inspecting the file system, it appears that the most recent kernel files in /boot have been deleted.
I tried using the live CD to re-install grub, but no joy. I can install a fresh partition and I thought I could just migrate all the files over (I have many good backups), but copying all of /etc renders the new partition unbootable, and I just spent the last 30 sleepless hours trying to selectively migrate files and realized that the server is just too big and complex to ever make that happen. I tried replacing the /boot directory with the one from the new (bootable) partition, then chrooting to the old partition and running update-grub, but it still won't boot.
Anyone know of a good tutorial or explanation of how I can make the old partition bootable again, without losing 12 years of accumulated, interlocking configuration files? I have backups of everything; I thought I was safe but just having all the files doesn't help if I can't get them all together in a bootable filesystem.
I was doing routine maintenance on my server when I noticed a lot of crufty old kernels. I did an `apt-get autoremove' and it rendered the server unbootable.
apt-get autoremove should not do that.
likely something else was amiss; maybe your "routine maintenance" had some side effects?
Quote:
I tried using the live CD to re-install grub, but no joy.
that is a very imprecise account.
we need moreinformation.
Quote:
Anyone know of a good tutorial or explanation of how I can make the old partition bootable again, without losing 12 years of accumulated, interlocking configuration files?
Of course it shouldn't, but I had a bootable, functioning system, did the autoremove, a subsequent reboot failed and most of the recent kernel files were gone. I didn't do any other maintenance between booting the system (following an `aptitude safe-upgrage'), running the autoremove, and the failure. It was certainly the autoremove that did it, but this system has a long legacy. The likelihood of other kinds of corruption either in the apt infrastructure or the disk structure itself is high.
> that is a very imprecise account. we need moreinformation.
The Ubuntu 14.04 server installer disc has a "rescue" option that boots a limited live system. That system offers an option to reinstall grub. I ran that, got no errors, but it didn't change anything (the system still booted into a 12.04 splash screen followed by a hang).
> my guess is, lots of manual work.
Thanks for taking the time to reply and confirming my suspicions. After over a decade of continuous uptime, it isn't unreasonable to just do a scratch reconfigure.
It's not just the kernel itself(s ??? - doesn't look right) that have evaporated; using a package manager also zaps the kernel modules, so just copying over /boot will never work.
Long-and-short of it should be to just chroot into the on-disk system, re-install (force if necessary) the appropriate kernel package, fix up grub, and reboot.
It's never that easy, but should be. Presumes there is no underlying (other) problem like a broken filesystem or flaky disk, and that you haven't done any other damage in the interim.
Have a look at this - there is a verbose post at the bottom.
Last edited by syg00; 04-12-2016 at 07:56 PM.
Reason: typos
It sounds like a newer kernel was installed but Grub wasn't configured to use it. Again presuming there was no hard drive corruption fixing it could be as simple as booting from external media and editing grub conf to load an existing kernel. Yes, even Grub2 conf can be edited by hand, doing so is even not discouraged by developers.
Edit: Actually you could load an existing kernel from Grub boot menu by hitting 'e' and editing the command line. This will bring your box up, just remember to edit Grub conf to make the change permanent.
As predicted, it wasn't that simple. Booting now gets as far as
* Starting SystemD login management service [OK]
So I seem to have a mostly functional kernel, though it hangs at that point. I'm analyzing logs now, though I have to say that there isn't a lot of information there. syslog, kern.log, boot.log all seem to follow a predictable course, then everything just stops after a complaint about no lp devices. There is a conspicuous lack of reference to any networking hardware or drivers which might point to the problem. At any rate, though, I seem to be in motion again and learned the thing I really wanted to know, which is how to render an existing filesystem bootable.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.