I've dual booted my desktop with Windows 10 and Ubuntu 18.04.3. Every once in a while, while using Ubuntu 18.04.3 over many hours (at least 6-7 hours), my computer completely freezes/stops working, like so:

  1. The keyboard does not work at all. Re-plugging does not help
  2. The mouse seems to still be able move the pointer, but cannot access any programs, i.e. clicking does not work on anything.
  3. When I re-plug the mouse, I can't move the pointer too.

It's impossible for me to do anything in this state since the mouse and keyboard cannot input anything (so Alt+PrinScreen+R+E+I+S+U+B does not work), and the only thing I can do is force shutdown by pressing the power button.

I have no idea how to solve this issue, and have no idea what information is required for anyone to help me solve this issue. I've provided the very basics here:

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 18.04.3 LTS
Release:    18.04
Codename:   bionic
$ uname -a
Linux mcheah 5.0.0-25-generic #26~18.04.1-Ubuntu SMP Thu Aug 1 13:51:02 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

I've noticed there is a mismatch between the ubuntu version in uname and lsb_release though I suspect this isn't really an issue (correct me if I'm wrong)

Update: More information that was requested:

$ grep -i swap /etc/fstab
# swap was on /dev/sda6 during installation
UUID=7f6fa0cf-a062-4b8a-8cd7-0fde60a5b47e none            swap    sw              0       0

$ free -h 
    total used free shared buff/cache available 
    Mem: 15G 3.8G 9G 152M 1.9G 11G 
    Swap: 59G 0B 59G

Disks SMART Data information

  • Edit your question and show me free -h after running for many hours. And ls -al ~/.local/share/gnome-shell/extensions.
    – heynnema
    Aug 31, 2019 at 22:53
  • ~/.local/share/gnome-shell/ does not contain extensions, only application_state and notifications. I'll update the status of free -h after a few hours but for now it's bash $ free -h total used free shared buff/cache available Mem: 15G 3.8G 9G 152M 1.9G 11G Swap: 59G 0B 59G
    – m_cheah
    Aug 31, 2019 at 23:02
  • Holy !@#$%, why is your swap set to 59G?!? (please put those kinds of results as an edit to your original question. Thanks!)
    – heynnema
    Aug 31, 2019 at 23:05
  • Yes, I didn't really know what swap space to set so I think I overdid it when I was setting up. I doubt that's the reason for why ubuntu just stops working though? Correct me if I'm wrong
    – m_cheah
    Aug 31, 2019 at 23:12
  • 1
    As mentioned run free -h every hour or so. When RAM gets low close all your browser windows. Then run free -h again. Does RAM come back? Aug 31, 2019 at 23:54

2 Answers 2


As a new user, I only have reputation of 11 and you need a reputation of 50 in order to comment. As heynnema commented, this should be a comment.

My Ubuntu 18.04.3 LTS acted similar when an alert warning popped up. I believe that the issues lies with how gnome is handling UI layers since when I pressed the Windows key on the keyboard the activities layer was shown. I was then able to interact with that screen layer and my issue was resolved.

Try the activities button (windows key on keyboard) in case that temporary solution works for you.

Another should be comment in response to heynnema's swap size. I read that swap partition should be the same size as ram. I have 16 GB RAM so I have 16GB of swap partition.

  • Cannot comment since I don't have 50 reputation. I am a new user. Not sure why I can comment here.
    – dmbGamer7
    Aug 31, 2019 at 23:43
  • 1
    "Swap partition = ram size" is an old-fashioned method to determine proper swap size. With 16G RAM, a much smaller swap size is suggested now.
    – heynnema
    Sep 1, 2019 at 0:04
  • I up voted you, and now you've moved from 11.2 to 21.2! Almost there!
    – heynnema
    Sep 1, 2019 at 0:22

Let's first get you a reasonable size swap partition...

In terminal...

  • sudo swapoff -a


  • sudo swapoff /dev/sda6

In gparted...

- resize /dev/sda6 to between 4-8G


  • delete /dev/sda6

  • new partition, linux-swap, /dev/sda6, 4-8G

In terminal... (if you recreated /dev/sda6)

  • sudo blkid | grep swap

  • copy the new UUID to the clipboard

  • edit /etc/fstab


UUID=7f6fa0cf-a062-4b8a-8cd7-0fde60a5b47e none            swap    sw              0       0


UUID=new_UUID none            swap    sw              0       0

  • sudo swapon -a

  • free -h

  • I've done as you've said. Now there's 7.8G on the swap partition: Swap: 7.8G 0B 7.8G
    – m_cheah
    Aug 31, 2019 at 23:52
  • @m_cheah did you resize or recreate? You might wish to reboot, verify that free -h looks the same, run for a while, and report back. Show me sysctl vm.swappiness
    – heynnema
    Aug 31, 2019 at 23:53
  • I resized. I've rebooted. I had just started checking the sysctl vm.swappiness, which gave me something along the lines of swappiness=60, before my computer suddenly blackscreened and is now continuously printing some systemd-journald[457]: Failed to write entry (9 items, 301 bytes), ignoring: Read-only file system and EXT4-fs (sda7): ext4_writepages: jdb2_start: 13312 pages, ino 95928000; err -30
    – m_cheah
    Sep 1, 2019 at 0:06
  • @m_cheah That's strange. It's calling out sda7? Boot to recovery mode, and use the recreate method to do your swap partition. Sorry about that... wasn't the plan. I'll stick around to help you.
    – heynnema
    Sep 1, 2019 at 0:08
  • @m_cheah If /dev/sda7 is your Ubuntu partition, this may be related to your original problem. You may have to fsck (file system check) it. Boot to a Ubuntu Live DVD/USB, open terminal, type sudo fsck -f /dev/sda7.
    – heynnema
    Sep 1, 2019 at 0:25

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .