Can I use swap partition and systemd-swap together ?
To quote from the arch wiki link given earlier in this thread:
In order for systemd_swap to be effective you need to remove any traditional swap devices you have.
Oh thanks, I missed thatā¦so to be sure, while installation, for swap partition I need to choose none ? And when installation is finished, only use systemd-swap ? Thanks
Hi, I just installed fresh KDE on my laptop.
I wanted to try setup systemd-swap but I stucked on step : creating a file /etc/systemd/swap.conf.d/myswap.conf
How to do that ? In Dolphin I can not open etc folder as root ?thx
Itās all described in the wiki:
sudo bash -c 'echo -e "zswap_enabled=0\nzram_enabled=0\nswapfc_enabled=1" > /etc/systemd/swap.conf.d/myswap.conf'
Yes, I tried that and got this
[marko@marko-hpenvy ~]$ sudo bash -c āecho -e āzswap_enabled=0\nzram_enabled=0\nswapfc_enabled=1ā > /etc/systemd/swap.conf.d/myswap.confā
[sudo] password for marko:
bash: /etc/systemd/swap.conf.d/myswap.conf: No such file or directory
Try
echo -e "zswap_enabled=0\nzram_enabled=0\nswapfc_enabled=1" | sudo tee /etc/systemd/swap.conf.d/myswap.conf
If this is also not working you first need to create the missing directory /etc/systemd/swap.conf.d.
Yeah, I figured that⦠But In dolphin can not because no root in folder. In xfce I used option Thunar root. How to do that in Dolphin (KDE) ?
Use a terminal window and enter
cd /etc/systemd
sudo mkdir swap.conf.d
Thanks⦠got it now how to check if it is working ?
I tried to use command swapon, but nothing showed
Use
systemctl status systemd-swap.service
Watching this , I will say it is working `
[marko@marko-hpenvy ~]$ systemctl status systemd-swap.service
ā systemd-swap.service - Manage swap spaces on zram, files and partitions.
Loaded: loaded (/usr/lib/systemd/system/systemd-swap.service; enabled;>
Active: active (running) since Sat 2020-08-29 22:27:27 CEST; 31min ago
Main PID: 482 (systemd-swap)
Status: āMonitoring memory statusā¦ā
Tasks: 1 (limit: 6958)
Memory: 15.8M
CGroup: /system.slice/systemd-swap.service
āā482 /usr/bin/python3 -u /usr/bin/systemd-swap startkol 29 22:27:26 marko-hpenvy systemd[1]: Starting Manage swap spaces on zra>
kol 29 22:27:27 marko-hpenvy systemd-swap[482]: INFO: Load: /etc/systemd/sw>
kol 29 22:27:27 marko-hpenvy systemd-swap[482]: INFO: Removing working dire>
kol 29 22:27:27 marko-hpenvy systemd-swap[482]: INFO: Removing files in /va>
kol 29 22:27:27 marko-hpenvy systemd-swap[482]: INFO: Load: /etc/systemd/sw>
kol 29 22:27:27 marko-hpenvy systemd-swap[482]: INFO: Writing destroy info.>
kol 29 22:27:27 marko-hpenvy systemd-swap[482]: INFO: swapD: pick up device>
kol 29 22:27:27 marko-hpenvy systemd-swap[482]: INFO: swapD: searching swap>
kol 29 22:27:27 marko-hpenvy systemd-swap[482]: INFO: swapFC: on-demand swa>
kol 29 22:27:27 marko-hpenvy systemd[1]: Started Manage swap spaces on zram>
lines 1-20/20 (END)ā¦skippingā¦
ā systemd-swap.service - Manage swap spaces on zram, files and partitions.
Loaded: loaded (/usr/lib/systemd/system/systemd-swap.service; enabled; vendor preset: disabled)
Active: active (running) since Sat 2020-08-29 22:27:27 CEST; 31min ago
Main PID: 482 (systemd-swap)
Status: āMonitoring memory statusā¦ā
Tasks: 1 (limit: 6958)
Memory: 15.8M
CGroup: /system.slice/systemd-swap.service
āā482 /usr/bin/python3 -u /usr/bin/systemd-swap startkol 29 22:27:26 marko-hpenvy systemd[1]: Starting Manage swap spaces on zram, files and partitionsā¦
kol 29 22:27:27 marko-hpenvy systemd-swap[482]: INFO: Load: /etc/systemd/swap.conf.d/myswap.conf
kol 29 22:27:27 marko-hpenvy systemd-swap[482]: INFO: Removing working directoryā¦
kol 29 22:27:27 marko-hpenvy systemd-swap[482]: INFO: Removing files in /var/lib/systemd-swap/swapfc/ā¦
kol 29 22:27:27 marko-hpenvy systemd-swap[482]: INFO: Load: /etc/systemd/swap.conf.d/myswap.conf
kol 29 22:27:27 marko-hpenvy systemd-swap[482]: INFO: Writing destroy infoā¦
kol 29 22:27:27 marko-hpenvy systemd-swap[482]: INFO: swapD: pick up devices from systemd-gpt-auto-generator
kol 29 22:27:27 marko-hpenvy systemd-swap[482]: INFO: swapD: searching swap devices
kol 29 22:27:27 marko-hpenvy systemd-swap[482]: INFO: swapFC: on-demand swap activation at >3822 MiB memory usage
kol 29 22:27:27 marko-hpenvy systemd[1]: Started Manage swap spaces on zram, files and partitions.`
I searched but didnāt find a right answer⦠what is difference between systems swap and swap file ? Ok both donāt need partition.
What is best for you is up toyou
If you had full disk encryption and the hiber file would be inside, then you can be sure when you hibernate that the memory is stored on the encrypted disk.
If you had a swap partition and the partition would not be encrypted, then after hibernation, all the memory is stored on an unecrypted media.
EDIT: I use swap partition that is almost never used as I have 8Gb ram and never hibernate. But I donāt like risking Out of memory situation, Linux behaves kinda bad when that happens. + you can set up encryption with a random generated key specified in fstab and cryptab
Atm I used installation with : no swap. I thought to use swap file or systemd-swap,as I read that is basically the sameā¦
About encryption ,I donāt know what I haveā¦haha
Then you can use swapfile, resizing partition and doing all the stuff is extra hard work.
But when you install next, think through where all your data would be and how it can be lost and abused by naughty thief.
That is why I am asking. I am still on fresh start installation and it is not a problem to do new installation. I want to find out more information so I can keep Manjaro KDE without new installation for a long periodā¦hehe
Do I need encryption? It is my private laptop.
Also I have 6 gb of Ram which is shared with graphic card
Encryption protects the data from unauthorized access. I would make a difference between encryption of personal data and system encryption.
- Is there a person having access to your laptop? Does you have data you want to hide from that person? If yes, encrypt this personal data.
- Do you cary your laptop to places others could access it or do you fear what happens to your data if you loose the laptop? If yes, again encrypt your personal data.
- Do you have top confidential information on your laptop which if it is getting in wrong hands could cause serious damage? Then, and only then think about a system encryption.
If you trust yourself to net let it get stolen then OK. It has small CPU overhead, but itās so small that itās worth to protect your data.
6Gb shared with GPU is not much.
Hiberfile gives you the ability in certain scenario, delete it easily and use the space if you really need one. Swap partition is a fixed thing that is hard to repurpose.
@freed00m @Wollie thanks guysā¦Per your question I think I donāt need encryptionā¦too complicated ,hehe⦠it is needed for me only on my phone.
About swap partition, still donāt know which option to use from those three : swap file, systemd-swap or swap partition⦠I think that first two are faster and better ?