Jump to content

Linux/Troubleshooting

From Wikiversity

The goal of this page is to list solutions to common issues. You are encouraged to add yours here.


90-second delay while booting

[edit | edit source]

Such a delay may be caused by an incorrect entry in the /etc/fstab file. This can especially be caused with live USB operating systems used across computers.

Enter blkid into the command line terminal, then compare the output with the contents of aforementioned file. One of the entries, such as the entry for the swap file (which contains the word "swap"), may need to be removed or commented out by adding # at the beginning of the line.[1]

sysrq

[edit | edit source]

Some system requests might be disabled out of the box due to the bitmask value in the file /proc/sys/kernel/sysrq being set to a different value than 1, such as 176. A possible reason is to protect inexperienced users.

To override this, use the command echo 1 | sudo tee /proc/sys/kernel/sysrq, where the number "1" is piped into "tee", and sudo tee writes the "1" into said system file using root privileges.

Directly sudo echo 1 >/proc/sys/kernel/sysrq or sudo printf 1 >/proc/sys/kernel/sysrq does not work if the terminal is not running as root, since text redirection into the file is performed by the terminal, whereas with sudo tee, it is performed by the tee tool using root privileges.

Mixing desktop environments

[edit | edit source]

Your preferred desktop environment might lack an essential feature such as the popular "Cinnamon" desktop environment lacking a multiple-row task bar.[2][3]

It is possible to mix parts of desktop environments, such as using the mate-panel while other parts like the task switcher of Cinnamon are still operational. The Cinnamon task bar can be set to hide automatically in the configuration, whereas the multiple-row Mate taskbar can be made to always display on screen.

In order to start multiple panels automatically, add one of them to the list of programs to start automatically. Typically, it is found in the system control panel, though the location may vary across desktop environments.

Halting

[edit | edit source]

If your computer halts ("freezes") frequently, the most common causes are tasks consuming high CPU or disk I/O usage. The former can be monitored with the command-line utilities including top (usually bundled), htop (more sophisticated but may require installation first), and the graphical gnome-system-monitor. Disk I/O usage can be monitored with the interactive command-line utility iotop, where the -o parameter hides inactive processes for a better overview.

A high I/O usage may not only caused by reads and writes themselves, but can also be caused by latency. This is not of concern on flash storages, but it is on hard disk drives, since the magnetic head needs an additional fraction of a second to move to the physical location of requested data.

Halted window manager

[edit | edit source]

If the cursor has become unresponsive, and you wish to get out of it without losing your session, try the following:

  • Go to a different tty, for example, press Ctrl+Alt+F2 to go to tty2.
  • Type the w command to list active sessions. Notice the content of the FROM column, possibly :0.
  • Type [process name of desktop environment] --replace --display=:0 2>/dev/null &. Process names for desktop environments include cinnamon, mate-panel or wm-mate ("window manager MATE"), xfwm4 (for xfce), and kwin_x11 or plasmashell for KDE.[4]

The :0 part is from the "FROM" column in the prior command, the 2>/dev/null part prevents diagnostic error messages from flooding the command line output, and the & character puts the process in background.[5]

Password fail delay

[edit | edit source]

Linux installations may be shipped with a long password fail delay, meaning an artificial delay until the user is allowed to retry after entering a wrong password.

While it is intended to prevent password cracking through brute-forcing, a delay that is too long, such as three seconds, could become annoying from repetition and interfere with workflow.

The fail delay is not recommended to be deactivated completely, but can be shortened to something more sufferable like 0.3 seconds. The disadvantage that brute forcing would become faster could be compensated multiple times over by appending one or two characters to the password. However, even at a fail delay of 0.01 seconds, brute forcing would be severely handicapped. As such, a preset fail delay of three seconds appears to be security theater.

Setting

There are multiple system files where the password fail delay may be configurable. Make sure to create a backup copy of of any system file before modifying.

The exact used system file may vary depending on operating system distribution and version, but the configuration is typically located at /etc/pam.d/common-auth or /etc/pam.d/login, and the delay value is specified in microseconds.

For example, to set the password delay to the tenth of a second, set the pre-existing value in the "login" file, which is presumably 3000000 out of the box, to "100000", as shown here:

#
# The PAM configuration file for the Shadow `login' service
#

# Enforce a minimal delay in case of failure (in microseconds).
# (Replaces the `FAIL_DELAY' setting from login.defs)
# Note that other modules may require another minimal delay. (for example,
# to disable any delay, you should add the nodelay option to pam_unix)
auth       optional   pam_faildelay.so  delay=100000

Alternatively, try adding the new line auth optional pam_faildelay.so delay=100000 to the "common-auth" file at this position:

# here are the per-package modules (the "Primary" block)
auth       optional     pam_faildelay.so  delay=100000
auth	[success=1 default=ignore]	pam_unix.so nullok_secure nodelay

[6]

Black screen

[edit | edit source]

On some proprietary graphics drivers, a black screen may occur under when switching away from the graphical user interface (usually tty7) to any other tty (Ctrl+Alt+F[number]) while screen resolution is not set to maximum does result in a black screen with only backlight visible, meaning the screen is still on but nothing is visible. This may also happen after waking up from suspending after a countdown, e.g. sleep 1h; systemctl suspend.[7]

Adjust the screen resolution blindly by entering xrandr -s 1920x1080 or another valid resolution in a terminal running inside X server. Note that for it to work, it has to be a different resolution than the current one. Consider adding screenrescue() { xrandr -s 640x480; xrandr -s 1920x1080; redshift -O 2400; } to ~/.bashrc, to make a more memorable command named "screenrescue" do it.

References

[edit | edit source]
  1. Boot proces 90 seconds delay – LinuxMint Forums, August 2020
  2. Enable multiple rows in the daskbar – LinuxMint Forums, March 2014
  3. Resize panel/taskbar for two rows? - Linux Mint Forums, February 2017
  4. How do you properly restart KWin and Plasmashell from the virtual console? – /r/KDE, December 2018
  5. What to do when a Linux desktop freezes? - Unix & Linux Stack Exchange
  6. security - Why is there a big delay after entering a wrong password? - Unix & Linux Stack Exchange
  7. https://bugs.launchpad.net/ubuntu/+source/nvidia-graphics-drivers-440/+bug/1870758