An option is a manual recovery:
Files are the easiest part. You can do what Ramchandra suggested, but if you want to preserve your apps you should avoid reinstalling (as that would, as you've seen, remove the apps.) If you want to avoid uninstalling the boot with a missing kernel:
Boot to LiveCD.
Using nautilus, open up the broken partition.
Navigate to /home/myusernamehere. All your files will be there.
Some other files you might want to save:
- /etc/apt/sources.list, if you have any manual repos.
After you are done with this, stick it onto a flash drive or email it to yourself.
Apps is a trickier part. I have come up with a somewhat roundabout solution that will take some time (most of it without you actively participating), but this should recover your apps (without settings/configurations)
Stick around LiveCD.
Navigate to /usr/lib. (It may take a while to load.)
Woah! Huge amount of folders. Open up gedit in liveCD.
Type this in gedit:
#!/bin/sh
sudo apt-get install folder1 folder2 folder3
...Where folder1 folder2 folder3 are the names of the folders.
These are all the programs you have installed on ubuntu (I think). Some of these (about 50%, maybe more) come with the system, so the arent necessary, but a safe bet is just put everything.
Another place to look for apps is /etc and /etc/alternatives. (Update me if I am missing any spots, internet!)
Save the file as .sh and email or flash drive it.
Now, when you first start up your computer (after total reinstall) you can run this script to sudo apt-get all your programs that you previously had. They'll be good as new!
Usually kernel
's operation related messages are stored in a fixed sized memory called the Kernel Ring Buffer
. It's location is /proc/kmsg
. dmesg
usually prints the entries of the Kernel Ring Buffer
in a human readable format. As it is a buffer (a temporary storage) mounted under /proc
, you can imagine that it will not survive a reboot i.e. it will just show all the Kernel logs after being powered On. If you want to check all the previous Kernel logs you need to check /var/log/kern.log
, as it is being stored on the disk it will survive the reboots.
Best Answer
To show the output from the last boot, you can still use the command
dmesg
.However, Ubuntu 16.04 (in fact all Ubuntus >=15.04) use
systemd
which has a logging daemon,journald
and an interface with highly flexible access to logged data:journalctl
. You can see a log of the last boot equivalent todmesg
:From
journalctl
man page:all
dmesg
output in the last 2 hoursall of the journal since last boot
list boots in the journal
to set up persistent logging, you need to configure
journald
- by default its log is written non-persistently to/run/systemd/journal
(a binary file - no use trying to read it) and no data is available before the current boot. To set up persistent logging, edit the file/etc/systemd/journald.conf
and uncomment the line#Storage=auto
and changeauto
topersistent
. Use your favourite text editor orThen you must restart the service (or reboot)
Having enabled persistent logging, you will in future be able to use the full functionality of
journalctl
for example, to see information from the boot before the current oneSee the relevant page of the wonderful <3 Arch Wiki <3 for further tips and tricks on using
journalctl