I am running a Jetson Nano with Jetpack 4.4 which (Ubuntu 18.04), by default, has 4x495 Meg ZRAM partitions for swap space. The problem is that for a data science project I need MORE RAM than the 4gig installed on the Jetson (and whatever I get from compressed ZRAM - not much). So I'd like to make an 8gb swap file instead of the ZRAM swap.
How do I disable the ZRAM swap altogether so that I can create a swap file?
I've tried
sudo apt remove --purge zram-config
sudo dpkg --purge zrawmswap-enabler
sudo dpkg --purge zram-config
sudo service zramswap stop
But none of it works. ZRAM swap is still enabled on reboot:
Alternatively can I just create a disk swap file and expect it to replace ZRAM?
With zram you are having swap in RAM and compressed. Whenever your system swaps it will be doing it very fast, as is RAM.
You don't need to stop the zram to replace with another swap. You can just add more swap, and let the system handle it.
If you want to change the config ratio of zram edit: /etc/systemd/nvzramconfig.sh
In order to create a new swap on disk you have either two options:
If you expect a lot of movement from swap to ram and viceversa:
For what you are commenting I believe you'll run that scientific program few times, let's say a maximum of 100 times, so even if swap is being strongly used should be no problem for a domestic SSD. You can also attach an NVMe using an external case, but you'll not see high speed, as the speed constraint is in the USB 3.0. The Samsung PRO series offer double of writing before they die.
Pay attention to use the 3.0 and not a 2.0 accidentally.
If you require to use that scientific program, may be you can assemble a cheap PC with 16 GB or 32 GB of RAM and you will not need swap at all.
Update 2020-11-04: In JetPack-4.4 nvzramconfig is a Systemd Service, so in /etc/systemd/system you have a file called nvzramconfig.service
You can prevent completely this Service from starting by disabling it:
That's the preferred way to do it. But if for whatever reason you don't want to disable the service the not so nice option is to just comment every line in the file /etc/systemd/nvzramconfig.sh like this:
As long as the execution exits with error level 0 (so no error or no exit code different from 0) it will be seen as working.
In both ways the Kernel module will not be loaded (modprobe zram).
Cheers