LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 04-11-2016, 03:18 PM   #1
twoprop
LQ Newbie
 
Registered: Jan 2011
Posts: 14

Rep: Reputation: 0
Unhappy 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.

Thanks...

--2p
 
Old 04-12-2016, 02:29 AM   #2
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by twoprop View Post
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?
no.
my guess is, lots of manual work.
 
Old 04-12-2016, 09:29 AM   #3
twoprop
LQ Newbie
 
Registered: Jan 2011
Posts: 14

Original Poster
Rep: Reputation: 0
> apt-get autoremove should not do that.

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.

Peace...

--2p
 
Old 04-12-2016, 07:55 PM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,103

Rep: Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117
Should be reasonably straight-forward.


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
 
Old 04-12-2016, 08:05 PM   #5
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,661

Rep: Reputation: Disabled
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.

Last edited by Emerson; 04-12-2016 at 08:07 PM.
 
Old 04-12-2016, 11:25 PM   #6
twoprop
LQ Newbie
 
Registered: Jan 2011
Posts: 14

Original Poster
Rep: Reputation: 0
Thanks, all!

I was able to reinstall the kernel files by following the information here:

http://askubuntu.com/questions/11908...distro-upgrade

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.

Thanks!

--2p
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] HELP: How do I restore all my files that got erased by "apt-get dselect-upgrade" after failed upgrade from 32 to 64 bit Ubuntu 14.04 LTS judoka Linux - Newbie 11 03-05-2016 05:03 PM
Ubuntu Server 10.10 64 bit dezzy01 Linux - Server 2 07-10-2012 07:57 PM
iptables-restore ubuntu server does not restore at boot R03L Ubuntu 4 02-09-2010 08:14 PM
Is Ubuntu server 64 bit? ckosloff Linux - Newbie 1 12-01-2009 07:06 PM
no cd or usb bootability, need floppy to cd boot Person_1873 Fedora - Installation 22 01-10-2008 08:30 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration