1

Why does my Ubuntu 16.10 freeze so often suddenly after a few months?

I have to press the start/ restart button on my machine to reboot the system.

Then it works but after a few minute doing stuff, eg. browsing internet, working on a software, etc it freezes again - everything, keys and mouse and all, stops working!

Any ideas what might be causing this?

How can I check what is going on from my terminal?

Am I being hacked by viruses?

I am using Skull Canyon and it is solely on Ubuntu 16.10 - Kubuntu Plasma 5.8.

EDIT:

A screenshot when it freezes - as you can see that most of the CPUs are reaching 100%!

enter image description here

Why?? It never happened before!

Edit 3:

$ free -h
              total        used        free      shared  buff/cache   available
Mem:            15G        1.4G         12G        301M        1.3G         13G
Swap:           15G          0B         15G


$ sudo lshw -C memory
[sudo] password for lau: 
  *-firmware                
       description: BIOS
       vendor: American Megatrends Inc.
       physical id: 0
       version: KYSKLi70.86A.0033.2016.0408.1727
       date: 04/08/2016
       size: 64KiB
       capacity: 6080KiB
       capabilities: pci upgrade shadowing cdboot bootselect socketedrom edd int13floppy1200 int13floppy720 int13floppy2880 int5printscreen int14serial int17printer acpi usb biosbootspecification uefi
  *-cache:0
       description: L1 cache
       physical id: 16
       slot: L1 Cache
       size: 128KiB
       capacity: 128KiB
       capabilities: synchronous internal write-back data
       configuration: level=1
  *-cache:1
       description: L1 cache
       physical id: 17
       slot: L1 Cache
       size: 128KiB
       capacity: 128KiB
       capabilities: synchronous internal write-back instruction
       configuration: level=1
  *-cache:2
       description: L2 cache
       physical id: 18
       slot: L2 Cache
       size: 1MiB
       capacity: 1MiB
       capabilities: synchronous internal write-back unified
       configuration: level=2
  *-cache:3
       description: L3 cache
       physical id: 19
       slot: L3 Cache
       size: 6MiB
       capacity: 6MiB                                                                                                                                                                                        
       capabilities: synchronous internal write-back unified                                                                                                                                                 
       configuration: level=3                                                                                                                                                                                
  *-memory                                                                                                                                                                                                   
       description: System Memory                                                                                                                                                                            
       physical id: 1b                                                                                                                                                                                       
       slot: System board or motherboard                                                                                                                                                                     
       size: 16GiB                                                                                                                                                                                           
     *-bank:0                                                                                                                                                                                                
          description: [empty]                                                                                                                                                                               
          physical id: 0                                                                                                                                                                                     
          slot: ChannelA-DIMM0                                                                                                                                                                               
     *-bank:1                                                                                                                                                                                                
          description: [empty]                                                                                                                                                                               
          physical id: 1                                                                                                                                                                                     
          slot: ChannelA-DIMM1                                                                                                                                                                               
     *-bank:2                                                                                                                                                                                                
          description: SODIMM DDR4 Synchronous 2133 MHz (0.5 ns)                                                                                                                                             
          product: CT16G4SFD8213.C16FAD                                                                                                                                                                      
          vendor: Conexant (Rockwell)
          physical id: 2
          serial: 22201921
          slot: ChannelB-DIMM0
          size: 16GiB
          width: 64 bits
          clock: 2133MHz (0.5ns)
     *-bank:3
          description: [empty]
          physical id: 3
          slot: ChannelB-DIMM1
  *-memory UNCLAIMED
       description: Memory controller
       product: Sunrise Point-H PMC
       vendor: Intel Corporation
       physical id: 1f.2
       bus info: pci@0000:00:1f.2
       version: 31
       width: 32 bits
       clock: 33MHz (30.3ns)
       capabilities: bus_master
       configuration: latency=0
       resources: memory:dc344000-dc347fff

Edit 5:

enter image description here

Edit 6:

Logged in normally:

$ sudo blkid

/dev/nvme0n1: PTUUID="994f73a0" PTTYPE="dos"
/dev/nvme0n1p1: UUID="5d13e954-064d-4700-9ac9-ed3002a036f3" TYPE="ext4" PARTUUID="994f73a0-01"
/dev/nvme0n1p5: UUID="2910a4f2-ef16-4f38-bb52-1a172c5886e1" TYPE="swap" PARTUUID="994f73a0-05"

$ sudo cat /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/nvme0n1p1 during installation
UUID=5d13e954-064d-4700-9ac9-ed3002a036f3 /               ext4    errors=remount-ro 0       1
# swap was on /dev/nvme0n1p5 during installation
UUID=2910a4f2-ef16-4f38-bb52-1a172c5886e1 none            swap    sw              0       0

Edit 7:

I have repeated the #1:

enter image description here

Then logged in to the terminal:

$ sudo blkid

/dev/nvme0n1: PTUUID="994f73a0" PTTYPE="dos"
/dev/nvme0n1p1: UUID="5d13e954-064d-4700-9ac9-ed3002a036f3" TYPE="ext4" PARTUUID="994f73a0-01"
/dev/nvme0n1p5: UUID="2910a4f2-ef16-4f38-bb52-1a172c5886e1" TYPE="swap" PARTUUID="994f73a0-05"

$ sudo cat /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/nvme0n1p1 during installation
UUID=5d13e954-064d-4700-9ac9-ed3002a036f3 /               ext4    errors=remount-ro 0       1
# swap was on /dev/nvme0n1p5 during installation
UUID=2910a4f2-ef16-4f38-bb52-1a172c5886e1 none            swap    sw              0       0

$ sudo lsblk -f
NAME        FSTYPE LABEL UUID                                 MOUNTPOINT
nvme0n1                                                       
├─nvme0n1p5 swap         2910a4f2-ef16-4f38-bb52-1a172c5886e1 [SWAP]
├─nvme0n1p1 ext4         5d13e954-064d-4700-9ac9-ed3002a036f3 /
└─nvme0n1p2  

My system still freezes as before...

Edit 9:

$ sudo gparted
Created symlink /run/systemd/system/-.mount → /dev/null.
Created symlink /run/systemd/system/run-user-1000.mount → /dev/null.
Created symlink /run/systemd/system/run-user-119.mount → /dev/null.
Created symlink /run/systemd/system/tmp.mount → /dev/null.

(gpartedbin:3431): Gtk-WARNING **: Unable to locate theme engine in module_path: "adwaita",

(gpartedbin:3431): Gtk-WARNING **: Unable to locate theme engine in module_path: "adwaita",
======================
libparted : 3.2
======================
Removed /run/systemd/system/-.mount.
Removed /run/systemd/system/run-user-1000.mount.
Removed /run/systemd/system/run-user-119.mount.
Removed /run/systemd/system/tmp.mount.

enter image description here

Edit 10:

I did the #1:

enter image description here

and #2

$ sudo blkid

/dev/nvme0n1: PTUUID="994f73a0" PTTYPE="dos"
/dev/nvme0n1p1: UUID="5d13e954-064d-4700-9ac9-ed3002a036f3" TYPE="ext4" PARTUUID="994f73a0-01"
/dev/nvme0n1p5: UUID="2910a4f2-ef16-4f38-bb52-1a172c5886e1" TYPE="swap" PARTUUID="994f73a0-05"

$ sudo cat /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/nvme0n1p1 during installation
UUID=5d13e954-064d-4700-9ac9-ed3002a036f3 /               ext4    errors=remount-ro 0       1
# swap was on /dev/nvme0n1p5 during installation
# UUID=2910a4f2-ef16-4f38-bb52-1a172c5886e1 none            swap    sw              0       0

$ sudo lsblk -f
NAME        FSTYPE LABEL UUID                                 MOUNTPOINT
nvme0n1
├─nvme0n1p1 ext4         5d13e954-064d-4700-9ac9-ed3002a036f3 /
├─nvme0n1p2
└─nvme0n1p5 swap         2910a4f2-ef16-4f38-bb52-1a172c5886e1

It still freezes as before though...

EDIT 11:

I captured the screenshot when it freezes with top on my terminal. I don't see anything is causing the freeze.

enter image description here

I have upgraded my Kubuntu/ Ubuntu to 17.04. Thought it might fix the issue but it doesn't...

EDIT 12:

$ sudo mkswap -L swap /dev/nvme0n1p5
mkswap: /dev/nvme0n1p5: warning: wiping old swap signature.
Setting up swapspace version 1, size = 15.9 GiB (17059278848 bytes)
LABEL=swap, UUID=d7210e00-cc66-42ca-96ce-5111d6481007

$ sudo blkid
/dev/nvme0n1p1: UUID="5d13e954-064d-4700-9ac9-ed3002a036f3" TYPE="ext4" PARTUUID="994f73a0-01"
/dev/nvme0n1p5: LABEL="swap" UUID="d7210e00-cc66-42ca-96ce-5111d6481007" TYPE="swap" PARTUUID="994f73a0-05"
/dev/nvme0n1: PTUUID="994f73a0" PTTYPE="dos"

$ sudo cat /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/nvme0n1p1 during installation
UUID=5d13e954-064d-4700-9ac9-ed3002a036f3 /               ext4    errors=remount-ro 0       1
# swap was on /dev/nvme0n1p5 during installation
UUID=d7210e00-cc66-42ca-96ce-5111d6481007 none            swap    sw              0       0

EDIT 13:

I am checking the health of my SSD following this answer:

$ sudo smartctl -a /dev/nvme0n1
smartctl 6.6 2016-05-31 r4324 [x86_64-linux-4.10.0-20-generic] (local build)
Copyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Model Number:                       INTEL SSDPEKKW256G7
Serial Number:                      BTPY64540VX7256D
Firmware Version:                   PSF100C
PCI Vendor/Subsystem ID:            0x8086
IEEE OUI Identifier:                0x5cd2e4
Controller ID:                      1
Number of Namespaces:               1
Namespace 1 Size/Capacity:          256,060,514,304 [256 GB]
Namespace 1 Formatted LBA Size:     512
Local Time is:                      Sat Apr 29 04:49:32 2017 BST
Firmware Updates (0x12):            1 Slot, no Reset required
Optional Admin Commands (0x0006):   Format Frmw_DL
Optional NVM Commands (0x001e):     Wr_Unc DS_Mngmt Wr_Zero Sav/Sel_Feat
Maximum Data Transfer Size:         32 Pages
Warning  Comp. Temp. Threshold:     70 Celsius
Critical Comp. Temp. Threshold:     80 Celsius

Supported Power States
St Op     Max   Active     Idle   RL RT WL WT  Ent_Lat  Ex_Lat
 0 +     9.00W       -        -    0  0  0  0        5       5
 1 +     4.60W       -        -    1  1  1  1       30      30
 2 +     3.80W       -        -    2  2  2  2       30      30
 3 -   0.0700W       -        -    3  3  3  3    10000     300
 4 -   0.0050W       -        -    4  4  4  4     2000   10000

Supported LBA Sizes (NSID 0x1)
Id Fmt  Data  Metadt  Rel_Perf
 0 +     512       0         0

=== START OF SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED

SMART/Health Information (NVMe Log 0x02, NSID 0x1)
Critical Warning:                   0x00
Temperature:                        42 Celsius
Available Spare:                    100%
Available Spare Threshold:          10%
Percentage Used:                    0%
Data Units Read:                    1,388,326 [710 GB]
Data Units Written:                 1,573,290 [805 GB]
Host Read Commands:                 23,376,158
Host Write Commands:                20,635,596
Controller Busy Time:               264
Power Cycles:                       390
Power On Hours:                     1,185
Unsafe Shutdowns:                   71
Media and Data Integrity Errors:    0
Error Information Log Entries:      0
Warning  Comp. Temperature Time:    3
Critical Comp. Temperature Time:    0

Error Information (NVMe Log 0x01, max 64 entries)
No Errors Logged

I don't see any error.

3
  • @heynnema I have booted my system into recovery mode. it then just running lines of code then showed me a login page again. I logged in and typed fsck -f / on the terminal, it gives the same warning as in edit 4 above. maybe i have booted it incorrectly? Should i re-format my system instead? Is it a system issue or the hardware issue actually? If it is a software issue, i might have been hacked?
    – Run
    Apr 26, 2017 at 21:50
  • 1
    Give me a minute and I'll put up an answer with more detail on how to run fsck... 'cause somehow you didn't do it right. Don't reformat your system. Don't panic. You haven't been hacked. Don't know if you have a hardware or software problem right now... just not enough information. That's one reason why I wanted to start with fsck. So give me a minute, then check my answer, below...
    – heynnema
    Apr 26, 2017 at 22:18
  • Comments are not for extended discussion; this conversation has been moved to chat.
    – Seth
    Apr 26, 2017 at 22:57

1 Answer 1

1

From the comments...

Step #1

Lets first check your file system for errors.

To check the file system on your Ubuntu partition...

  • boot to the GRUB menu
  • choose Advanced Options
  • choose Recovery mode
  • choose Root access
  • at the # prompt, type sudo fsck -f /
  • repeat the fsck command if there were errors
  • type reboot

Step #2

Lets find out why fsck is complaining about swap devices...

In terminal...

  • type sudo blkid
  • type sudo cat /etc/fstab
  • type sudo lsblk -f

Update #1

Notice this line in the sudo blkid...

/dev/nvme0n1p5: UUID="2910a4f2-ef16-4f38-bb52-1a172c5886e1" TYPE="swap" PARTUUID="994f73a0-05"

Notice these lines in the sudo cat /etc/fstab...

# swap was on /dev/nvme0n1p5 during installation
UUID=2910a4f2-ef16-4f38-bb52-1a172c5886e1 none            swap    sw              0       0

Notice that the UUID= number is the same. This will become important after we do a mkswap command to try and fix the swap partition. The existing UUID number will change, and we'll have to edit /etc/fstab to reflect the UUID change.

For right now, I want you to comment out the second line of the swap definition in /etc/fstab, by placing a # at the front of the line, so it looks like this... (gksudo gedit /etc/fstab)...

# swap was on /dev/nvme0n1p5 during installation
# UUID=2910a4f2-ef16-4f38-bb52-1a172c5886e1 none            swap    sw              0       0

Then redo step #1 and lets see if the swap errors are gone.

Update #2

Although it won't fix your freezing problem, we now need to get your swap partition running again. The swap partition was causing fsck error messages. And although the blkid UUID matches the /dev/nvme0n1p5 UUID (which is the most common cause of errors) the swap area must be corrupt in some way. We'll build a new swap, and come up with a new UUID for /dev/nvme0n1p5 in that process, and we'll edit that new UUID into /etc/fstab.

  • boot to Ubuntu normally
  • assure that you've got backups of your important stuff, just in case of a problem
  • in terminal...
    • sudo cp /etc/fstab /etc/fstab.bak # make a backup of fstab
    • sudo mkswap -L swap /dev/nvme0n1p5
    • copy the new UUID to the clipboard
    • gksudo gedit /etc/fstab
    • uncomment the second line of the swap definitions
    • replace the UUID with a paste from the clipboard (no quote marks)
    • save the file and quit gedit
    • sudo blkid
    • sudo cat /etc/fstab
    • as I instructed you earlier, make sure the UUID's match for /dev/nvme0n1p5
    • sudo swapon -a # to enable the new swap
    • if there are any errors with the swapon command, comment out that line in /etc/fstab again until we figure out what's wrong
    • reboot
  • Repeat step #1 and confirm no swap related errors
1
  • Comments are not for extended discussion; this conversation has been moved to chat.
    – terdon
    Apr 29, 2017 at 15:59

You must log in to answer this question.

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