ubuntu-rockchip icon indicating copy to clipboard operation
ubuntu-rockchip copied to clipboard

Swap file automatically generates on boot

Open SimplyCorbett opened this issue 3 months ago • 3 comments

Hi,

I'm using the ubuntu-22.04.3-preinstalled-server-arm64-orangepi-5-plus image and there is a 1GB swap file in root that automatically generates every reboot. This is on a SD card so I definitely don't want a swap file to be generated on reboot. I have to manually disable swap by logging into SSH after rebooting. Deleting the file doesn't prevent it from regenerating on reboot.

This file doesn't exist in /etc/fstab. Is this documented anywhere? I can't find any details about this on google. What's the best method to permanently disable this?

Or does the x-systemd.growfs automatically generate it?

SimplyCorbett avatar Mar 21 '24 17:03 SimplyCorbett

try:

sudo systemctl stop swapfile.swap sudo systemctl stop mkswap.service

sudo systemctl mask mkswap.service sudo systemctl mask swapfile.swap

sudo rm -rf /swapfile

icache avatar Mar 22 '24 00:03 icache

Yes, I had to mask it. Disabling the services didn't work.

Thank you so much :)

SimplyCorbett avatar Mar 22 '24 14:03 SimplyCorbett

Wouldn't that also disable swap file generation on other specified devices? For example, I might want to put a swap file on the nvme drive.

The problem is the 1GB swap file still generates regardless on the root partition of the SD card, I've tested that.

SimplyCorbett avatar Mar 22 '24 14:03 SimplyCorbett