When installing Manjaro XFCE I chose to create a swap file. That was an option over a partition. I’m now asking whether this is enough for my notebook or what I should do better next time or just now?
NAME TYPE SIZE USED PRIO
/swapfile file 512M 0B -2
OK, I see it’s 16 GiB. Thanks for posting the info.
A SWAP partition of at least 16GiB (and a bit more, if possible), will be sufficient to allow for hibernation, and most other needs.
If you plan on adding more RAM in the the near future, you might also want to allow for that as well.
I notice you’re using zswap as suggested by @cscs in another thread. I only mention this in case it’s relevant to others reading along.
To switch to using an adequately sized SWAP partition would require resizing the root (/) partition to create the extra space needed. This can (potentially) be a cumbersome task, sometimes with unexpected difficulties.
Although this would ultimately be more performant, the easiest for you is probably to reconfigure the size of the swap file using zswap. Were you given any reference information for that?
I did read here but I didn´t understand all: swap.
Should I reinstall Manjaro to create a 16GB swap partition? Or is that not absolutely necessary? I don’t actually have any programs running in standby mode, I don’t think.
Yes, given the situation, a fresh install allowing a 16Gib (maybe 17Gib), would be the easiest for a performant swap partition.
Increasing the swap file would probably be easier still, but my opinion is a full swap partition will be better.
Ultimately it’s up to you.
Whether you use a swap partition or a swap file, it still must be able to accommodate whatever data is in RAM, if hibernation is desired at any time.
And that’s the point.
I know. You know. But he doesn’t.
… and I did not intend to persuade him to do as I did
Apparently I never tried to hibernate with too much of my RAM being used so that it would fail.
I don’t know what would happen then - probably an fsck on the next reboot and perhaps some of the more recent changes lost due to it.
To be very honest - there is not that much (time) difference between coming out of hibernation and a clean boot - the reading back of 4 GB from swap takes it’s sweet time.
I appreciate you taking the time and effort to guide him to change what he has got now.
Very nice of you!
I already like this forum! You are really nice and knowledgeable helpers! I now have a 16 GB swap file using the instructions written especially for me! Many many thanks!
LC_ALL=C cat /etc/fstab
# /etc/fstab: static file system information.
# Use 'blkid' to print the universally unique identifier for a device; this may
# be used with UUID= as a more robust way to name devices that works even if
# disks are added and removed. See fstab(5).
# <file system> <mount point> <type> <options> <dump> <pass>
UUID=22F4-54A6 /boot/efi vfat umask=0077 0 2
UUID=d8ff5d2f-cd13-4534-b598-7ae3f9f4950e / ext4 defaults,noatime 0 1
/swapfile swap swap defaults,noatime 0 0
tmpfs /tmp tmpfs defaults,noatime,mode=1777 0 0
Yes, it’s OK to install a swap file but it feels old-school to me
I don’t understand why people don’t use zram instead, it’s more dynamic and costs less hdd space.
Install zram-generator using one of the methods listed above.
Create a zram-generator.conf config file.
Run systemctl daemon-reload to create new device units.
Run systemctl start /dev/zram0 (adjust the name as appropriate to match the config).
Call zramctl or swapon to confirm that the device has been created and is in use.
Once installed and configured, the generator will be invoked by systemd early at boot, there is no need to do anything else.
If you decide to use zram instead of a swap file & don’t want to have to fiddle around with a configuration file (as required with zram-generator), then a good alternative in the AUR is systemd-zram (and there are plenty of other zram enablers available in the AUR repository too). I recently installed systemd-zram with its default settings (lzo compression, cache size 75% of RAM size) & it works just as it should.
After I installed systemd-zram all I had to do was run (as root) systemctl enable --now systemd-zram to start it immediately and also have it run automatically at boot.