Ahoy!
I had been booting into emergency mode for quite a while. I would hit enter and type exit or ctrl-d, sometimes I had to do this several times but eventually it would usually work. I wanted to figure out what was wrong and boot straight into Ubuntu without emergency mode. Windows 10 came factory installed on my laptop which was booting fine. I removed windows 10 and installed a test copy of Ubuntu on /dev/sda1 and it was not booting into emergency mode. So then I was hopeful it was not a hardware error i.e. just broken. I read this question
"Welcome to emergency mode!" Think it is a fsck problem
and thought maybe if I ran fsck -y /dev/sda6 it would solve the problem, unfortunately that did not work. Then I read this article
Wrong EFI System Partition GUID?
and ran more /etc/fstab on both Ubuntu partitions. Even though I installed both Ubuntu partitions on the same laptop, there were two different UID values for /boot/efi in fstab.
The old Ubuntu install that was booting into emergency mode had this
UUID=BEAA-DA23 /boot/efi vfat defaults 0 1
The new blank Ubuntu test partition had this
/dev/disk/by-uuid/AB34-68EA /boot/efi vfat defaults 0 1
I ran blkid and it tells you the UUID's of the root partition and the swap partition, but not the /boot/efi partition which in hindsight was the one causing the problem. When I removed my windows partition, I had to create a new /boot/efi partition, and the UUID changed when I did this. The new Ubuntu install noticed this and configured correctly. But the old one, the one where I installed all my programs and had all my data, remained unchanged. If you want to find the UUID of your /boot/efi partition without installing a new copy of Ubuntu, you can run ls -l /dev/disk/by-uuid and the UUID of the /boot/efi partition should be there. It is also listed in gparted if you run sudo gparted and double click on the partition. Gparted also told me to install some packages via apt so it could properly read a vfat partition. I did this using apt via
sudo apt install dosfstools mtools
I ran sudo emacs /etc/fstab, on the old Ubuntu partition, commented out the old line like this
#UUID=BEAA-DA23 /boot/efi vfat defaults 0 1
And under it put the new /boot/efi information from the Ubuntu test partition.
/dev/disk/by-uuid/AB34-68EA /boot/efi vfat defaults 0 1
And so far that is working. I had a random reboot earlier that doesnt usually happen, but I think that might be something else. When I rebooted it again did not boot into emergency mode and booted straight into Ubuntu. Problem appears solved so far! Hope that explanation can help someone else.
Good Luck!
update:
I am starting to think the UUID is another new partially broken replacement that wasnt as good as what we already had. For the /boot/efi partition, and all your other ones for that matter, I think you can avoid UUID's all together and just use the /dev/sda2 device which is traditionally what has worked and what Linux/Unix has always done. I think
/dev/sda2 /boot/efi vfat defaults 0 1
Will work just fine, and you can avoid UUID's altogether unless they have some other use I am not aware of. Google says it is good for if you are adding storage, but when the UUID changes, you have to manually fix fstab the same as when the /dev device changes. And when I add storage I normally leave the boot partition in place.
It seems they are creating many different aliases to reference the same thing again. Simply using the /dev name is how it has always been done, and is IMO better than some long meaningless random number that in some hidden way points to the /dev device.