I was doing a memory-heavy project in python and kept getting an error (137 SIGKILL 9, something like that), so I looked up a solution and it said to change the swap size. I copied and pasted the commands I found into terminal, and it started copying some files:
# disable the use of swap
sudo swapoff -a
# create the SWAP file. Make sure you have enough space on the hard disk.
# here is my size, the total size is bs*count B
sudo dd if=/dev/zero of=/swapfile bs=1024 count=136314880 status=progress
# output:
# 139458259968 bytes (139 GB, 130 GiB) copied, 472 s, 295 MB/s
# 136314880+0 records in
# 136314880+0 records out
# 139586437120 bytes (140 GB, 130 GiB) copied, 472.372 s, 296 MB/s
# Mark the file as SWAP space:
sudo mkswap /swapfile
# output:
# Setting up swapspace version 1, size = 130 GiB (139586433024 bytes)
# no label, UUID=25a565d9-d19c-4913-87a5-f02750ab625d
# enable the SWAP.
sudo swapon /swapfile
# check if SWAP is created
sudo swapon --show
# output:
# NAME TYPE SIZE USED PRIO
# /swapfile file 130G 0B -2
# Once everything is set, you must set the SWAP file as permanent, else you will lose the SWAP after reboot. Run this command:
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab
After a while (it reached about 40 GB I think), my system gave me a message that it was running out of space. Then the terminal finished working, i pasted the rest of the commands to set up the swap, and rebooted my computer. Then, when I booted up again, this message showed:
/dev/nvme0n1p6: clean, 1090638/907808 files, 35521979/36801792 blocks
And it doesn't boot after this. I started it in recovery mode, tried some of the options there (like clean - try to free up some space, etc), but nothing worked. This is the system summary:
I believe that I should have checked if I had enough space on my disk before doing the swap change. Also, I think this upgraded my swap to 40 + GB, when I wanted it to get to 8 GB max... How do I solve this problem and save my data? This project is really important to me and I would hate to lose it... Can I reverse the changes I made in the terminal in recovery mode?
Thanks in advance!!!