2

Running Ubuntu 18.04 without issue, the system started getting sluggish last evening before eventually starting to throw lack of memory errors running simple commands (eg, cd) on the command line.

I tried restarting expecting it would clear temporary memory, but haven't been able to get back into the system. Assorted attempts to turn swap off and on again, running fsck to check for errors, as well as clear and dpkg within recovery mode didn't fix the issue.

I'm wondering if there's any downside to simply deleting the swapfile in question (picture of the offending taken via recovery terminal below), and recreating to deal with the issue? Any suggestions on addressing this otherwise.

I have access to recovery mode as well as an openSUSE live disk (from which I'm currently working) to effect changes.

enter image description here

5
  • 2GB is not "oversized" for a swap file. What makes you think this is causing the problem? But yes, you can delete the swapfile, but remember to update the respective /etc/fstab entry accordingly. Having partitions (or a swap file) configured there which no longer exists (or has a changed identifier) will prevent your system from booting too.
    – Byte Commander
    May 27, 2019 at 22:58
  • @ByteCommander, suppose I deduced after getting the OOM errors and when running the above and seeing the swpafile as a seemingly primary offender. any better method for determining what the actual offender is if not swap?
    – Chris
    May 27, 2019 at 23:01
  • 1
    Can you add the output of df -h to show how full the mounted partitions are? If e.g. /tmp or your root partition runs full that might cause similar error messages, and it could persist across reboots (in case of /tmp at least if it is not mounted as tmpfs). Swap should not show any persistent behaviour.
    – Byte Commander
    May 27, 2019 at 23:04
  • @ByteCommander, was able to check the offending directory (of which swap was a part) within recovery using du and eventually tracked down a few larger files I could delete to make sufficient space for boot. good to go now, thank you.
    – Chris
    May 27, 2019 at 23:22
  • It's better to use zram or zswap than a swap partition/file. You should use zram instead and maybe keep a small swap partition with lower priority. RAM alternative to swap partion or swap file on an SSD
    – phuclv
    May 28, 2019 at 3:00

1 Answer 1

1

According to our discussion in comments, it seems like the issue was a full disk.

Using df -h and du, it was possible to identify some large unnecessary files and delete them to free up enough space to boot.

1
  • 1
    actually, to put an even finer point on it, running this was what allowed me to track down offending files. du -a /home | sort -n -r | head -n 10 where /home is the directory to be inspected
    – Chris
    May 27, 2019 at 23:35

You must log in to answer this question.

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