Ubuntu boot problem after upgrade 14.10 - > 15.04

Problem

I update my laptop from 14.10 to 15.04 a few days ago. And now it is boot with strange problems. It is terrible but after reboot I have password-free root access to my Ubuntu in terminal. For some reasons systemd failed to boot, and throw up shell with root prompt.

What I see is this:

[   1.334674] input: AT Translated Set 2 Keyboard as /devices/platform/i8042/se
starting version 219
[   1.334674] random: systemd-udevd urandom read with 7 bits of entropy availab
[   1.334674] ahci 0000:00:1f.2: AHCI 0001.0300 32 slots 6 ports 6 Gbps 0x3 imp
[   1.334674] ahci 0000:00:1f.2: flags: 64vut ncq pm led clo pio slum part ems
[   1.334674] scsi host0: ahci
[   1.334674] scsi host1: ahci
[   1.334674] scsi host2: ahci
[   1.334674] scsi host3: ahci
[   1.334674] scsi host4: ahci
[   1.334674] scsi host5: ahci
[   1.334674] ata1: SATA max UDMA/133 abar m2048@0xf791e000 port 0xf791e100 irq
[   1.334674] ata2: SATA max UDMA/133 abar m2048@0xf791e000 port 0xf791e100 irq
[   1.334674] ata3: DUMMY
[   1.334674] ata4: DUMMY
[   1.334674] ata5: DUMMY
[   1.334674] ata6: DUMMY
Welcome to emergency mode! After logging in, type "journalctl -xb" to view
system logs, "systemctl reboot" to reboot, "systemctl default" or ^D to
try again to boot into default mode.

Problem description

The first thing that I find out in google was a lot notes about bug called starting version 219. But none of the solutions do not apply to my problem, I still cannot boot to GUI. Here I want to generalize the problem, summarize all solutions that I found and finnaly show how I actually solve my problem.

Problem summary

According to this bug report and comments the problem is that systemd could not load Display Manager (lightdm, gdm sddm, etc..). Here is helpfull quote

cro (cro) wrote on 2015-04-27:

So, if you see "starting version 219" and your display manager (login window) doesn't run, but you *can* load it by manually starting it form the console, you most likely have a problem with your display manager startup script(s).

Here it is recommended to enable your Display Manager:

sudo systemctl enable sddm.service -f
sudo reboot

But it is not working for me and saying:

Error getting authority: Error initializing authority: Could not connect: No such file or directory (g-io-error-quark, 1)

There is also a lot other links (1 2 3) where similar problem was solved by enabling corresponding Display Manager. So I decided to investigate problem by myself.

Finding a culprit

I run journalctl -xb as it was recommended by error message. There is no error at the end of log file, but when I scroll up I noticed strange message:

var-lock.mount: Mount on symlink /var/lock not allowed
...
...
...
var-lock.mount failed to run 'mount' task: Too many levels of symbolc links
failed to mount /var/lock
...
...
Dependency failed for Local File Systems.

I remembered that I was reading about fstab mistakes that leads to similar problems. I check fstab entries using blkid commands, I thought that the bcache can be culprit, but everything was looking normally. Everything but last lines:

tmpfs /tmp tmpfs defaults 0 0
tmpfs /var/tmp tmpfs defaults 0 0
tmpfs /var/lock tmpfs defaults 0 0

I don't remember why and when I added those lines to my fstab, I just commented /var/tmp and /var/lock and rebooted laptop. Now everything is ok.

Solution

The final solution was to check /etc/fstab for correct entries, and commenting all suspicious lines. For me it was /var/lock mount point.