mrs_uav_system icon indicating copy to clipboard operation
mrs_uav_system copied to clipboard

Make the swap persistent after reboot.

Open spurnvoj opened this issue 3 years ago • 3 comments

Current install script shows steps how to create swap and use it. However, the swap is not persistent and will not be used after restarting pc. We need to modify /etc/fstab file for it. (see https://linuxize.com/post/how-to-add-swap-space-on-ubuntu-18-04/).

Note: Some people already have a swap file. Therefore, we should increase it instead of creating a new one.

spurnvoj avatar Sep 09 '21 10:09 spurnvoj

We did not have to do this on any of our drones. Are you sure you are doing this correctly? I am using:

sudo swapoff -a
sudo dd if=/dev/zero of=/swapfile bs=1G count=16
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile

klaxalk avatar Sep 09 '21 23:09 klaxalk

Yes, I am using the same commands (see install script). To have swap permanent, you have to modify the fstab file. Here is another link that mentions that too. They also show how to make swap larger if you already have one.

spurnvoj avatar Sep 10 '21 08:09 spurnvoj

Ye, maybe, if you select to have "no swap" during Ubuntu installation. We should have the swap-setting script universal, therefore, let's also update https://github.com/ctu-mrs/uav_core/blob/master/miscellaneous/scripts/set_swap.sh.

klaxalk avatar Sep 10 '21 14:09 klaxalk