PDA

View Full Version : [SOLVED] 16.04lts boot fails after nvidia install with luks lvm



dgermann
November 29th, 2016, 05:12 AM
Friends--

Symptom: Upon rebooting, it gets to the box to enter the luks password, and locks. The screen will not accept any keyboard entries except ctrl-alt-del; I can get the computer to boot by going into recovery mode.

What happened just before this problem: After install of 16.04, I noticed that nvidia-settings showed no screens. Checking synaptic, I found no nvidia drivers were installed. Based on nvidia site, I installed nvidia-375 from the gnome gui terminal. It locked the computer part way through. Using ssh and cli this time, I reinstalled both nvidia-375 and nvidia-setting. Now nvidia-settings shows all three of my monitors. However, I have this bad bootup sequence ending at the non working password entry box.

Production environment.
Fresh install of 16.04 lts.
I chose automatic encrypt whole disk, which sets up lvm.
There is little on the hdd except the operating system. Just a lot of work on setting up settings on libreoffice and tbird, to name a couple.
uname -r produces: 4.4.0-47-generic.
I think the kernel that works is 4.4.0-31-generic.

What I tried:
with live cd:

sudo cryptsetup luksOpen /dev/sda5 somename
sudo vgchange -aly
vgscan --mknodes
#ls -alh /dev/mapper only shows somename, vg-root, and vg-swap_1
sudo fsck -y /dev/mapper/ubuntu--vgroot
sudo fsck -y /dev/mapper/ubuntu—vgswap_1
reboot into system


The fsck on the vgroot shows "clean" and the swap exits without errors. Each ran in less than a second.

Still have the locking password box.

Going back to the earlier kernel boots OK.

I considered reinstalling the kernel, but I do not know how to do that.

Any ideas how to fix this?

Thanks for your help!

oldfred
November 29th, 2016, 06:14 PM
Did you install nVidia from nVidia with .run file or from Ubuntu's own repository.
Or if very new nVidia card there is a ppa with all the newest nVidia drivers not yet in repository.

If you install nVidia driver from nVidia you have to in effect manually re-install with every kernel update by running dkms to re add it to kernel before rebooting & using new kernel.
If you install from Ubuntu or ppa then dpkg manages all that on every update.

Instructions are newest driver for newest cards, must load legacy driver if old nVidia card.
http://www.omgubuntu.co.uk/2015/08/ubuntu-nvidia-graphics-drivers-ppa-is-ready-for-action
Details on why and future incorporation to Ubuntu installer
https://lists.ubuntu.com/archives/ubuntu-desktop/2015-August/004693.html
https://launchpad.net/~graphics-drivers/+archive/ubuntu/ppa
sudo apt-add-repository ppa:graphics-drivers/ppa
# should show newest versions available in addition
ubuntu-drivers devices
If you have installed any version, you must purge first, old will conflict with new as new install does not overwrite old version.
sudo apt-get remove --purge nvidia-*
This may not exist, so if error that would be ok
sudo mv /etc/X11/xorg.conf /etc/X11/xorg.conf.backup

If .run file installed you its commands to uninstall it.


#What is installed
dpkg -l | grep -i nvidia
dkms status
lsmod | grep nvidia

dgermann
November 29th, 2016, 06:46 PM
oldfred--

Thank you for helping me!

I installed from repository, using sudo apt-get. Had not thought of purging the nvidia! Good idea.

The card is perhaps 4 years old, was running OK under 12.04.


dpkg -l | grep -i nvidia
ii bbswitch-dkms 0.8-3ubuntu1 amd64 Interface for toggling the power on NVIDIA Optimus video cards
ii libcuda1-375 375.20-0ubuntu0~gpu16.04.1 amd64 NVIDIA CUDA runtime library
ii nvidia-375 375.20-0ubuntu0~gpu16.04.1 amd64 NVIDIA binary driver - version 375.20
ii nvidia-opencl-icd-375 375.20-0ubuntu0~gpu16.04.1 amd64 NVIDIA OpenCL ICD
ii nvidia-prime 0.8.2 amd64 Tools to enable NVIDIA's Prime
ii nvidia-settings 375.20-0ubuntu0~gpu16.04.1 amd64 Tool for configuring the NVIDIA graphics driver
doug@fire:~$ dkms status
bbswitch, 0.8, 4.4.0-47-generic, x86_64: installed
nvidia-375, 375.20, 4.4.0-31-generic, x86_64: installed
nvidia-375, 375.20, 4.4.0-47-generic, x86_64: installed
virtualbox, 5.0.24, 4.4.0-47-generic, x86_64: installed
doug@fire:~$ lsmod | grep nvidia
nvidia_uvm 749568 0
nvidia_drm 53248 1
nvidia_modeset 790528 6 nvidia_drm
nvidia 11911168 123 nvidia_modeset,nvidia_uvm
drm_kms_helper 155648 1 nvidia_drm
drm 364544 4 drm_kms_helper,nvidia_drm
doug@fire:~$

What does this tell us?

I gather you are seeing this as a video problem, not so much a kernel nor luks issue. Yes? Yet it seems to be working in the older kernel, not the newer....

Thanks, oldfred!

oldfred
November 29th, 2016, 08:05 PM
What nVidia card/chip?
Recovery mode has nomodeset which normally is required until you install the nVidia proprietary driver from the repository.

I see bbswitch-dkms which is for Optimus nVidia or dual video laptops.
Some with standard video cards, uninstalled bbswitch and it then worked.

I am only thinking it may be video issue as dkms adds video to kernel, so if older kernel has correct video but newer does not, that could be the issue. But it could be something else.

I do not know LVM nor encryption so if related to that then someone else needs to chime in.

dgermann
November 30th, 2016, 02:36 AM
oldfred--

Thanks!

As to which card I have:

lspci -vnn | grep VGA
01:00.0 VGA compatible controller [0300]: NVIDIA Corporation GK106 [GeForce GTX 660] [10de:11c0] (rev a1) (prog-if 00 [VGA controller])


From http://www.nvidia.com/download/driverResults.aspx/111596/en-us I found I needed 375.20.

Since the screen displays the luks password prompt but locks, it feels to me like it is a video issue, not luks nor lvm. But what do I know? <grin>

So are you suggesting I purge bbswitch-dkms? (This is a desktop machine with three monitors.) Or do something else?

dgermann
November 30th, 2016, 05:08 AM
Another piece of info--tonight it offered an update and among the things offered was a new kernel. I installed it. Still have it locking at the luks password box. But again, if I go to recovery mode, this time on the new kernel, I can get it to boot up.

Perhaps that is telling us it is not the kernel but the nvidia and related things. Do you suppose so?

oldfred
November 30th, 2016, 05:26 AM
Recovery mode uses nomodeset by default.
So that is saying the kernel does not have nVidia?

At grub menu you can use e for edit, scroll to linux line and replace quiet splash with nomodeset.
How to set NOMODESET and other kernel boot options in grub2 - both BIOS liveCD & grub first boot ( also UEFI with grub)
http://ubuntuforums.org/showthread.php?t=1613132
How to add boot parameters, grub menu after install (also grub when UEFI)
https://wiki.ubuntu.com/Kernel/KernelBootParameters

(https://wiki.ubuntu.com/Kernel/KernelBootParameters)
Lists installed version, in/with your kernel:
dkms status


(https://wiki.ubuntu.com/Kernel/KernelBootParameters)

dgermann
December 1st, 2016, 05:26 PM
oldfred--

Oh, thank you very much!

Sorry you had to wait for a response. Will get to this this weekend. I am seeing things that look like video issues, but I cannot tell for sure what is what.

Looks like I have some studying to do with nomodeset.

Would you suggest I purge all nvidia stuff and reinstall that before trying nomodeset, or just go directly to nomodeset? (It almost sounds to me like nomodeset is actually testing out whether a change in the nvidia stuff would help.)

Thanks for helping with my education, oldfred!

oldfred
December 1st, 2016, 06:49 PM
I have a bit older nVidia card GeForce GT 620 and it just works now. Or open source driver has caught up to work reasonably well with my card. I have another Ubuntu install with the nVidia driver and cannot tell any real difference. But I do not play games or push system.

Before I had to always use nomodeset to install & first boot. And first thing I did was install the proprietary nVidia driver from the repository. After that every new kernel was updated & worked with the nVidia driver.

Those that attempt multiple nVidia driver installs always have issues. You must totally purge everything nVidia related first. A new driver does not purge old driver and settings, and then you almost always have conflicts.

dgermann
December 1st, 2016, 07:04 PM
oldfred--

Thanks. So when I get to it, I will do the purge first, then nomodeset, then install the nvidia stuff.

Thanks!

Bashing-om
December 1st, 2016, 09:50 PM
dgermann; Hello;

As I pass by, an observation.
In purging the old driver do not forget to check IF there is also a config file ' /etc/X11/xorg.conf '.


ls -al /etc/X11/xorg.conf

In a single graphic's card installation this file "should" not be present - with the advent of DKMS where the kernel now does the hardware discovery this file is no longer required on most situations. However, if it is present it will be honored. If it is inconsistent with the installed driver it will of course give ya problems.



just my bit to try and help

dgermann
December 5th, 2016, 12:57 AM
Bashing-om--

Thanks! I just checked and that xorg.conf file does not exist. Good to know.

oldfred--

Well, it was no-go; back to the drawing board I suppose. Here's what I did and the results:

1. On synaptic, remove completely nvidia-375, nvidia-settings, and nvidia-prime.
2. sudo apt-get remove --purge nvidia* (removed nvidia-opencl-icd-375*)
3. sudo apt-get autoremove (removed bbswitch-dkms libjansson4 screen-resolution-extra)
4. reboot. It booted ok and gave me a luks password box that worked, and I got all the way to the gnome login screen. So far so good.
5. reboot, chose e at the grub screen, and added nomodeset; I logged in and used synaptic to install nvidia-375. This installed everything I had purged, I think.
6. reboot, but again locked at the luks password screen
7. reboot, used recovery mode
8. gksudo gedit /etc/default/grub: GRUB_CMDLINE_LINUX_DEFAULT="quiet splash nomodeset"
9. sudo update-grub
10. reboot, still have to use recovery mode because it freezes at the luks password screen.

So I am thinking that it is nvidia-related because at # 4 above it booted OK without any nvidia stuff installed.

Your thoughts, please?

oldfred
December 5th, 2016, 01:13 AM
Well I have a 620GT and use the open source driver. I did another install with nVidia and could not really tell much difference. But I do not run games or anything that might require advanced settings.

But it was only recently I noticed I could boot without nomodeset. Always with older versions I got black screen issue, system was actually working but monitor was off.

dgermann
December 5th, 2016, 01:41 AM
oldfred--

Nor do I do games. Have three monitors is about as fancy as it gets. Just doing libreoffice writer and calc and tbird.

I see some people talk about using a ppa for drivers. I also wonder if it would make sense to install some sort of base nvidia driver (nvidia-current?) and let Ubuntu find the driver that works? I see some talk of nouveau, but I am not seeing that in synaptic.

You have 620GT and I have gtx 660: are those close to the same card, or in the same family? When you say it just works, do you mean you have no nvidia drivers at all? Do you suggest I try purging all and seeing what I get? (I think it only had one screen when I let it go in step #4.

Thanks for getting back to me so quickly, oldfred!

oldfred
December 5th, 2016, 05:50 AM
The open source drivers basically work on older cards. They keep adding features, but then nVidia releases a newer card with more features.

Do not install one driver and then install another. Just be sure to totally purge before attempting another whether from Ubuntu repository or ppa.
Generally ppa is for very newest driver which may be what nVidia says is correct, but that includes lots of updates for the very newest cards which have capabilities not in older cards. Evenually they freeze a driver and only do security updates as it has all the features needed in older cards. And sometimes newer cards do need or conflict with some of the older driver capabilities.

This says newest still is correct driver for 600 series.
http://www.geforce.com/drivers

But the slightly older drivers back to even the ones current when card was released should work.
Shows 375.20 back to 352.79 and in between should work.

Instructions are newest driver for newest cards, must load legacy driver if old nVidia card.
http://www.omgubuntu.co.uk/2015/08/ubuntu-nvidia-graphics-drivers-ppa-is-ready-for-action
Details on why and future incorporation to Ubuntu installer
https://lists.ubuntu.com/archives/ubuntu-desktop/2015-August/004693.html
https://launchpad.net/~graphics-drivers/+archive/ubuntu/ppa
sudo apt-add-repository ppa:graphics-drivers/ppa
# should show newest versions available in addition
ubuntu-drivers devices

dgermann
December 6th, 2016, 03:14 AM
oldfred--

Well, I am really lost now.

Summary:

I have purged and restarted and gotten into a login loop and purged and autoremoved and rebooted 4 or 5 times. I installed nvidia-current and that gave me nvidia-304, and that did not work, purged and then added the ppa, and then installed 364. Last time around I removed nomodeset from /etc/default/grub

Sometimes when I reboot I get a screen with a circle and two letters U interlocked with a blue line circling around--but it is stopped and does not move. Sometimes the login screen is text only saying "Ubuntu gnome." (Seems my machine is confused!)

The upshot is that to login I need to go to recovery mode. (If it is a clue, I have to go through two screens twice--4 screens total-- saying it is OK to boot.)

End summary

So in case it is a help, here is what I have now:

doug@fire:~$ dpkg -l |grep -i nvidia
ii bbswitch-dkms 0.8-3ubuntu1 amd64 Interface for toggling the power on NVIDIA Optimus video cards
ii libcuda1-364 364.19-0ubuntu0~gpu16.04.6 amd64 NVIDIA CUDA runtime library
ii nvidia-364 364.19-0ubuntu0~gpu16.04.6 amd64 NVIDIA binary driver - version 364.19
ii nvidia-opencl-icd-364 364.19-0ubuntu0~gpu16.04.6 amd64 NVIDIA OpenCL ICD
ii nvidia-prime 0.8.2 amd64 Tools to enable NVIDIA's Prime
ii nvidia-settings 375.20-0ubuntu0~gpu16.04.1 amd64 Tool for configuring the NVIDIA graphics driver
doug@fire:~$ dkms status
bbswitch, 0.8, 4.4.0-51-generic, x86_64: installed
nvidia-364, 364.19, 4.4.0-51-generic, x86_64: installed
virtualbox, 5.0.24, 4.4.0-47-generic, x86_64: installed
virtualbox, 5.0.24, 4.4.0-51-generic, x86_64: installed
doug@fire:~$ lsmod |grep nvidia
nvidia_uvm 708608 0
nvidia_drm 45056 1
nvidia_modeset 753664 5 nvidia_drm
nvidia 10203136 88 nvidia_modeset,nvidia_uvm
drm_kms_helper 155648 1 nvidia_drm
drm 364544 4 drm_kms_helper,nvidia_drm
doug@fire:~$

Not sure what to try next. Maybe you have been telling me to do something in particular, and it has not sunk in. Got any suggestions as to what to try next? Some driver outside nvidia?

I see you are a moderator--perhaps there is someone you know whom you could tap on the shoulder and ask to take a look....

Thanks, oldfred!

oldfred
December 6th, 2016, 05:34 AM
Is this a laptop with switchable graphics?
I saw one user remove the bbswitch-dkms and it worked.
But another user said it was automatically getting installed. I thought that was only for bumblebee and nVidia then controlled switching.

Do not understand how nvidia-current was 304, that is for much older legacy cards. Even my 9600GT uses 340 which also now is a legacy driver.

dgermann
December 6th, 2016, 05:42 AM
oldfred--

No, this is a desktop machine with three monitors.

bbswitch-dkms seems to be getting automagically installed when I sudo apt-get install nvidia-3whatever.

I can try uninstalling that.

later....

I did uninstall that, and same locking at the interlocked U circle. I did notice that the blue line moved a little in the circle, then stopped. So it was back to recovery mode and the boot up took longer this time. synaptic reports that bbswitch-dkms is *not* installed.

Gijsbert_Wiesenekk
December 6th, 2016, 07:52 AM
Hi,

While trying to solve my Nvidia login loop problem (see my thread in this forum) I encountered the same issue. In my case running update_initramfs -u solved it (perhaps initramfs was still loading the nouveau driver).

Gijsbert

oldfred
December 6th, 2016, 03:26 PM
I do not understand why you are getting bbswitch unless nVidia started using it. But it is for switching from nVidia to Intel (maybe others)? But that has to be on a laptop using one video out port. Desktops would have a Intel out port & the nVidia ports.

This is what ist says bbswitch is:

bbswitch is a kernel module which automatically detects the required ACPI
calls for two kinds of Optimus laptops.

I think Gijsbert_Wiesenekk' suggestion is worth trying, I have seem this also:
If from ppa or nVidia you may need to manually make new initramfs.
man mkinitramfs
sudo update-initramfs -u
or
sudo update-initramfs -k all -c

dgermann
December 7th, 2016, 04:37 AM
oldfred and Gijsbert_Wiesenekk--

Well, I tried the commands you said (see code below for details) and it still is not working--it still locks up at the U-circle, and I have to go to recovery mode.

=========

Here are a couple of other things that have been going on, that might trigger some obscure thought for you:

1. I have been noticing some issues in various programs which might be video: A. scrolling is not smooth in nautilus; B. When I scroll in Thunderbird, it sometimes scrolls the left half of the screen a split line higher than the left; C. slow switching from tab to tab in libreoffice calc.

2. Lots of start and stop jobs on reboot, so it is waiting for 1 min 40 seconds, etc.

3. Often it does not mount the network shares on boot up and I have to go sudo mount -a

4. I do not have uefi, but legacy. I found something last night that showed how to check, forget where.

5. I do not have an xorg.conf file.

6. I fixed the previous login loop by installing nvidia-364 and rebooting.

7. I have another system with the 16.04 installed, and just rebooted it. The Circle-U screen shows up, and indeed the blue line stops there. When I type the luks password, it does show dots for each character I type, and does accept the password, continuing the login correctly. Additional Drivers shows that it is using X.org X server -- Nouveau. Not sure how I got that there and not here.

==========

So in hopes that the updated driver would work I re-installed nvidia-375.

If it is of interest, here is everything I did this evening:

sudo update-initramfs -u ; reboot; no change
sudo update-initramfs -k all -c ; reboot; no change
sudo apt-get remove --purge nvidia*
sudo apt-get remove --purge nvidia-*
sudo apt-get autoclean && sudo apt-get autoremove
sudo apt-get update && sudo apt-get dist-upgrade
sudo apt-get install nvidia-375 ; reboot; still had to go to recovery mode
also tried reboot and just entered luks password as if it were showing my entry, but it did nothing when I hit <ret>


What else might work, short of a re-install of this whole system (which I am considering)? Is there a generic video driver?

Thanks for all your help!

oldfred
December 7th, 2016, 05:30 AM
If you uninstall all nVidia you then have Nouveau which is the open source driver.
And then you usually have to use nomodeset.

Did you re-install nVidia (after a purge), uninstall/purge bbswitch, and then run the intramfs commands?

dgermann
December 8th, 2016, 05:14 AM
oldfred--

No, I had not done that last night but did tonight. No progress that I can detect:


sudo apt-get remove --purge nvidia*
sudo apt-get remove --purge nvidia-*
sudo apt-get autoremove
sudo apt-get install nvidia-375
sudo apt-get remove --purge bbswitch-dkms
sudo update-initramfs -u ; reboot; no change

sudo update-initramfs -k all -c ; reboot; no change, except there was no long wait for a start job (I'm thinking this was just a fluke.) Oh, and the screen scrolling was jerky--if I held the up or down arrow down, it would go up a half screen, pause, and then the final half.

sudo apt-get remove --purge nvidia*
sudo apt-get remove --purge nvidia-*
sudo apt-get autoremove
gksudo gedit /etc/default/grub:
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash nomodeset"
sudo update-grub
reboot--only had one screen, not all three (and not sure I want to learn all over again how to create an xorg.conf file and get three monitors working)

sudo apt-get install nvidia-375 && sudo apt-get remove --purge bbswitch-dkms
sudo update-initramfs -k all -c ; reboot; no change, there was a wait for a start job and network shares were not mounted


What's next, maestro?

oldfred
December 8th, 2016, 05:28 AM
Your issues do sound like video related issues.

But do not understand why all the issues. My 620 is at least in the same family. But I only have one monitor using DVI. Open Source works, have not tried the install with the nVidia driver install recently. Tomorrow I will boot into it and see what it does.
But running out of ideas.

dgermann
December 8th, 2016, 05:30 AM
oldfred--

OK. Let me know.

The other machine I tested on the other day only has one monitor, so it might have the same issues.

Do you suspect it is not luks?

Thanks for your help, oldfred!

oldfred
December 8th, 2016, 10:49 PM
I just booted into my install with nVidia. But it was 16.10, so not sure if that makes much difference. It just works. It has a slightly older version of nVidia - 367.

But it did show bbswitch installed, so that must be a red herring.

Not sure what to suggest. You could purge and try the one of the slightly older drivers. But I doubt if that is the issue.

dgermann
December 9th, 2016, 01:20 AM
oldfred--

Thank you, thank you for all your help on this!

Let me ask you about a couple of possibilities:

1. Would there be some way to test this using a virtual machine? I don't know if there is some way to get three monitors on a virtual machine, or if I do not even need that ability to test different things. (Not sure what I would test anyway.)

2. Would it make sense to purge and reinstall gnome desktop? One place suggested that as an intermediate step: https://askubuntu.com/questions/760934/graphics-issues-after-while-installing-ubuntu-16-04-16-10-with-nvidia-graphics

3. Maybe I should try reinstalling Xorg?

I have so much time on this, I am thinking a fresh install would be quicker. Except if I end up with the same problem! <sad grin> Which direction would you go?

Thanks, oldfred! Very much.

oldfred
December 9th, 2016, 05:50 AM
I have never installed a virtual system. It is on my list of things to do as my new systems have enough RAM and drive space to experiment.

Only ever used one monitor. But you should be able to test everything with just one monitor and then once that works, add more.

I have not had to edit xorg since about version 9.04. Before that just to get nVidia working I had to edit it a lot. I thought to get your 3 monitors working you still have to have an xorg, but otherwise it is being obsoleted. Everything just works (for many, but not all).

dgermann
December 12th, 2016, 12:02 AM
oldfred--

I think I've got it!

We were it seems but one step away.


sudo apt-get remove --purge nvidia*
sudo apt-get remove --purge bbswitch-dkms (not present)
sudo update-initramfs -u ; reboot; no change on bootup issues
sudo apt-get purge xorg-* xserver-xorg; sudo apt-get install xorg xserver-xorg; sudo dpkg-reconfigure xorg
sudo update-initramfs -k all -c ; reboot no change on bootup issues
sudo apt-get purge ubuntu-gnome-desktop gnome-desktop-environment; sudo apt-get install ubuntu-gnome-desktop
reboot, no change on bootup issues
gksudo gedit /etc/default/grub:
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash" [removed nomodeset]
sudo update-grub
reboot: now the bootup screen for luks password was correct, and I had three monitors operating properly, apparently
reboot: worked right the second time! Seems to be fixed!

So the combination of purging nvidia and removing the nomodeset command seemed to be what did the trick.

So many thanks to you again, oldfred. You stuck with me, and got me to where I was confident enough to try some things, which ultimately worked! Thanks!

oldfred
December 12th, 2016, 01:39 AM
Sorry did not know answer, but glad you were able to figure it out.
Always willing to try to help.

dgermann
December 12th, 2016, 03:18 AM
oldfred--

Oh, you did help, you did.