Linux-tips

Fork me on GitHub

I. Linux tips

6. Get syslog when your linux installation fails

Sometimes, while modifying a linux installer, you might break it (it happened to the best of us) and get a wonderful red screen:


Linux installation failure

Problematic isn't it? Let's try to get the installation logs! To do so, I'll show two ways of doing it.

Access to console

Once you get the red screen, you have to possibility to access another console (on mine, I have two). You can access it with the keys ALT+F2 (and F3 for the second console for me):


Linux installation console

From there, you'll have a minimal shell which is more than enough for what we need. The logs should be located in /var/log/syslog. You should at least have an access to nano text editor (once again, it's minimal but should be enough) if you want to explore your log file (less and vim weren't available for me).

If you want to take a look to what the installer installed, you need to go into the /target folder. Also, if you want a bit more "control" or a better shell. You can do it like this:

> chroot /target
> bash

And here you go!

Using a live-cd

Any live-cd would do the trick, but I like PartedMagic, so let's go for it. I use this version of it (if you're too lazy to search :p). An old one, but it works fine.


PartedMagic

First thing to do (if needed), change the keyboard layout:


PartedMagic keyboard layout

Once you find the good one, just press "Ok"/"Yes" buttons until it stops asking.

Time to get into our system! To see what available partitions you have, run the lvscan command into a console. Then just mount it and find the log file. So for example, in my case I'll do:

> mkdir /tmp/t # any other name would be fine
> mount /dev/vg00/lvroot /tmp/t
> cd /tmp/t
> less var/log/syslog

You can also check around what your installer installed and stuff. PartedMagic live-cd also provides useful tools to work on system things (partitions for example). Don't hesitate to take a look to what it offers!