RebornOS (5-16-2023) | 2023-05-25 13:27 |
RebornOS-ARM (3/15/2023) | 2023-03-16 03:54 |
RebornOS Beta (2022.07.29) | 2022-11-09 05:05 |
Why change something that works?
I try to configure my system as simply as possible, with the greatest possible benefit for me. The reader should be aware that this is a matter of opinion.
Since I build my system with only a /boot/efi and a / partition where I encrypt the / partition, the question of a swap area arises. It is possible to do this with another partition that should also be encrypted or with a swap file that is located on the encrypted / partition. Another advantage is that you can change the size of the swap file on the fly, a disadvantage of a swapfile is hybernating, it is quite complicated to configure.
Here I will describe how to create a swapfile.
First we create a file with:
sudo dd if=/dev/zero of=/srv/swapfile bs=1024 count=33554432
This command line creates a swap file in the /svr directory with a file size of 32 GigaByte (the size of the installed RAM).
As a second step, we let Linux make a swap file out of it:
sudo mkswap /srv/swapfile
Now we have to change the rights of the file:
sudo chown root:root /srv/swapfile
and
sudo chmod 0600 /srv/swapfile
The fourth step is to mount the swap file:
sudo swapon /srv/swapfile
To disable it, simply use:
sudo swapoff /srv/swapfile
To make the whole thing available after a reboot, we have to edit a file with the text editor of your choice:
/etc/fstab
here we add the following entry at the bottom:
/srv/swapfile swap swap defaults 0 0
This ensures that the swap file is included after a reboot.
[PageInfo]
LastUpdate: 2021-05-08 16:59:34, ModifiedBy: arnulf
[License]
GNU Free Documentation License
[Permissions]
view:all, edit:doc editors, delete/config:doc editors