Can't login - black screen & chroot guide


#1

If you are stuck and you can’t log into your system, use one of these steps bellow. They are sorted from easiest at the top. Start with the first step and if it doesn’t work, try with the next one and so on…

Once you get access to the system, then proceed with updating the system or installing/removing packages, checking log files… Steps (you only need one) are:

1 - log to tty terminal
2 - boot without X
3 - chroot auto (with manjaro-chroot)
4 - chroot (with manjaro-chroot)
5 - chroot older way (with mhwd-chroot)
6 - chroot into encrypted system (with manjaro-chroot)
7 - chroot into encrypted system (without manjaro-chroot)


1 - log to TTY terminal

At black screen press together:

Ctrl+Alt+F3 <- open a tty & login with your user

You can use any of these: F2, F4, F5, F6 but F3 is preferred (non GUI)
Now you are ready to update system… at the end type reboot to restart your system.

(Note you can always use this also in normally working system, say it starting to get really slow, you switch to TTY, run in the terminal “top” or “htop” to see what is slowing down the system, kill the problematic process and then you can return back to your regular session with Ctrl+Alt+F7)


2 - Boot without X - TTY1

  • Press “e” when the GRUB menu displays and for the kernel you wish to use
  • scroll down to the “linux” command line
  • press “End” key(or use arrow key, to get to the end of the kernel command line)
  • press space key/bar(to add a space - was not needed in my case though)
  • type “3” (no quotes)
  • press F10
    The system should now load but without X
  • next log in as normal user (not root) and start with system update…
  • at the end type: reboot to restart your system

3 - manjaro-chroot - auto

Boot up from live Manjaro media then enter into the terminal:

manjaro-chroot -a

This is automatic chroot, useful when multi boot, will list all bootable partitions, select the proper (Manjaro) root partition then proceed with updating or fixing the system


4 - manjaro-chroot

For example on the right I used sda1 is / manjaro; sda2 is swap, sda3 is home

lsblk <- list partitions
sudo mount /dev/sdxx /mnt <- example: sudo mount /dev/sda1 /mnt
sudo mount /dev/sdxx /mnt/home/ <- example: sudo mount /dev/sda3 /mnt/home/
sudo mount /mnt/boot/efi <- (optional) if you have UEFI!
sudo manjaro-chroot /mnt

Now you can start updating/fixing your system…


5 - mhwd-chroot

note, you will need to install mhwd-chroot from Manjaro repo:

yaourt -S mhwd-chroot

follow one of two guides bellow:
https://wiki.manjaro.org/index.php/Restore_the_GRUB_Bootloader#Chroot_into_your_existing_Manjaro_Installation


6 - chroot into encrypted system

cryptsetup luksOpen /dev/sda2 ssd
cryptsetup luksOpen /dev/sda3 swap

sudo mount /dev/mapper/ssd /mnt
sudo mount /dev/sda1 /mnt/boot/efi

sudo manjaro-chroot /mnt


7 - encrypted, not using manjaro-chroot

sudo su

cryptsetup luksOpen /dev/sda2 ssd
cryptsetup luksOpen /dev/sda3 swap

mount /dev/mapper/ssd /mnt
mount /dev/sda1 /mnt/boot/efi

mount -t proc proc /mnt/proc
mount -t sysfs sys /mnt/sys
mount -o bind /dev /mnt/dev
mount -t devpts pts /mnt/dev/pts/
mount -o bind /run /mnt/run
cp /etc/resolv.conf /mnt/etc/resolv.conf

chroot /mnt

To update your system run:

sudo pacman -Syyu

If you have an issue with file conflicts:

sudo pacman -Sy manjaro-keyring
sudo pacman -Sy manjaro-system
sudo pacman -Syyu


After update minute ago can't enter desktop, system can't find tty
Got locked out of my desktop after changing zsh to bash!
Boot problems after cancellation of update
Checking disc image for errors
How do you get to tty on Cinnamon 16.10
[Stable Update] 2018-12-02 - Kernels, Plasma, Mesa, Cinnamon, Gnome, Deepin, XFCE, Vulkan
Finalizing Manjaro Gnome 18.0 installation - help a Linux newbie pls :)
Dell G7 i7 w GTX1060 6gb
No display after installation on Nvidia drivers
Black screen after fresh manjaro install
Manjaro XFCE: I can not boot my computer after the last update (2017-01-30)
[Stable Update] 2017-05-12 - Kernels, KDE, KDE Apps, Gnome, Browsers
Unable to boot into my manjaro system using tty
Help needed after installing kde 17.0.0
Can't login - error messages upon system boot
AMD drivers help needed
Login Broken After Wake From Suspend
Thunar GTK3 problem
How to recover GRUB after a Kernel update
Manjaro kde start in emergency mode
GRUB issues after resizing OSX partition
Screen corruption with Nvidia 396.24
Manjaro won't boot - how to troubleshoot
[TOC] Boot-GRUB problems
[TOC] Boot-GRUB problems
[Stable Update] 2018-08-18 - Kernels, Xorg-Server, Mesa, Deepin, MATE, Perl, Python
Unable to boot on Manjaro after full encrypted installation
How do I turn off my PC without damaging anything?
Manjaro ruined and unrecoverable?
How to install drivers from usb
Failed to boot from hibernation
[solved clonezilla] After update, my user is missing in log in menu (using LightDM)
"Incorrect password" after BIOS settings edit
Nvidia prime leads to black screen
#2

Great, very clean!
yaourt -S mhwd-chroot will install the package from Manjaro repo, because it is in fact available there.
One important addition in the last part

mount -o bind /run /mnt/run                  #to be able to install kernels
cp /etc/resolv.conf /mnt/etc/resolv.conf     #to be able to have internet access and install packages from repos

#3

Thank you very much, I was assuming, corrected! :slight_smile:

mount -o bind /run /mnt/run #to be able to install kernels
cp /etc/resolv.conf /mnt/etc/resolv.conf #to be able to have internet access and install packages from repos

I’m not sure where to add these two lines. Can you directly edit my post and just add them where they belong? And add anything else you think it may also be missing :slight_smile:

If not, can you show me exactly where to add those two commands, just before system updates?


#4

Some comments and maybe request for enrichment.


In Archwiki this command is mount --rbind /run /mnt/run/. Does it matter? Is one better than the other?


Some Reminder to “DO NOT FORGET TO exit chroot” would be good.


What about the LUKS+LVM situation? Does it need another set of instructions, or just a mention/comment?


Optional: I would add a title to the last part about repair advice, like:

Bonus Tips


Optional: The Tutorial title could very well be just “Chroot Guide”. We can send users to this when needed…


Excellent Guide!! It is worth to be in my bookmarks!


#5

I have no clue. You see, this tutorial is not from someone knowledgeable enough, I myself was confused with many different ways to go about, when you end up with black screen. So what I did is, I searched all I could find and compiled it into one guide, as a help for me next time when I need it. Since I already wrote it I put it online with the hope that users that really understand the topic would build on it.

You see, I don’t even use an encryption and I never tried those encryption steps if they really work. I was hoping, if something I wrote is wrong, someone that knows would correct me.

Well it is not just about chroot. Sometimes user ends up with black screen but simple switch to TTY helps. First two steps are not about chroot.

Title in my opinion helps finding this guide if someone uses “black screen” or “can’t login” in their search.

The thing is, since I wrote this guide, I never ever used upper steps again. I have never used chroot again. At this time I know less than I knew year ago. I had no problems, since I wasn’t tinkering with the system, so I wasn’t forced to do any troubleshooting and even what i already knew as beginner I mostly forgot by now.

Since I’m really not keeping up with Linux internals, just using it, my wish is, that someone who has enough knowledge and experience would take over this guide and modernize it, made it current and accurate. I just don’t feel qualified to keep it up to date.

Any takers please?
Beside, if I understand correctly, everyone can edit/change/update it. Please do so, whoever is willing and make it better. :slight_smile: