Swap file for live session

I'd like to compile Niri in Zorin live session because I neither can test it in my Zorin lite VM nor in Linux Mint XFCE (no Wayland support). I started with the preparations/dependencies but ran out of space with my 8 GiB RAM.

Is it possible to create a 4 GiB Swap file or partition on the USB boot stick or somewhere else? It is a ventoy stick.

Doesn't these Instructions work?

I haven't tried that. When I select the ventoy stick in nautilus I get an error "Unable to access ventoy. Unable mounting /dev/sdb1 at /media/zorin/Ventoy: /dev/sdb1 already mounted or mount point busy"
Would it help to create another partition on the stick? Would a swap file or partition work at all? I'm not sure if it is worth a try or if Niri would need much more RAM than I can give.

Do you have a separate swap partition in your disk?

I haven't tried this and just a thought of mine but maybe it could be used under your live environment:

sudo swapon /path/to/swap/partition

Check afterwards if it's enabled:

swapon --show

No, I haven't set up a swap partition yet. Do you mean the disk in the laptop?

The Problem is that it can't mount the Partition because it is in Use. Which isn#t surprining because you use it. It is like with zotin when it is installed and you can't use GParted on the running System.

I would think 8Gig's of RAM should be more than enough for Niri. I wouldn't think that it needs more than Gnome. I mean, it isn't a whole Desktop Environment. And maybe the Live Mode isn't the best Way to try it. A VM would be good but this would require more RAM to give it to the VM ...

I think in live session the RAM is quickly used up, as all the programs are installed into the RAM (when I download or install separate packages which are not contained in Zorin or make updates).
The drive shows Zorin OS 3,2 GiB / 4,1 GiB available, and I always have problems when I try to install too many packages or bigger ones. I think somewhere around 1 GiB is the limit of what I can install, maybe because gnome desktop also needs 4 GiB RAM to work.

I'm wondering if I could use the swap file of my internal Linux Mint drive.

Is this a Persistent LiveUSB?

Because after installing Niri, you need to restart the system to see the changes.

No, the stick has no persistence.
In the guide of jeanlescure was not mentioned to reboot, only to logout.
When I installed other desktop environments in live session I never rebooted, and always worked (more or less).

Ok.
Just acting to remind of that particular inhibition of using a LiveUSB as a test.
If logging out and in works - then great.

Doesn't the Driver offer the Place for Dual-Boot?

On my 128 GiB drive is already a Dualboot with Linux Mint and Windows 11.

1 Like

Ah, okay. Yes, that is a bit tight.

I tried to follow the guide you linked to create a swapfile and put a folder named
swapfile into my homefolder on my LM drive.
But when I enter the path to that folder I get an error "is a directory". That sounds to me as if I should create a file and not a folder. But how can I create an empty file? Is it right to create a new document? How should the file be named (which file ending)?

You create a Folder and that is wrong. You need a File. Look in the Guide on Setp 2. There You have the Commands. To make an Example:

sudo fallocate -l 4G /swapfile

then

sudo chmod 600 /swapfile

and then

sudo mkswap /swapfile

This will create a Swapfile in / and then You have to activate it with

sudo swapon /swapfile

To check the Swapfile type swapon --show

???
Sorry, I don't understand what to do. In the guide they say I have to enter the path to the swapfile.
How do I create an empty file instead of a folder? In the context menu of the file manager is no such option, only to create folders, not files. My folder was named /swapfile. I need to enter the path because the drive is mounted at /media.

The Command will create the File - in my Example a File in / with 4Gig's. You don't have to create an empty File extra manually.

Yes, where You want to have the Swapfile:

1 Like

Ah, now I understand, thank you!
Is it better to put the swapfile into /root than in /home? I replaced /swapfile in the commands with /media/zorin/59a3bc.../home/USERNAME/swapfile
and it seems there is created a swapfile now. The commands looked good and showed no errors.

Edit: Unfortunately it seems not to work. I wanted to test with installing a flatpak, but failed because of less space.
Do I net to set a special value for the swappiness? Or do I need to change the permissions because on my Mint System the owner of the home directory is someone else than the user in live session?

How can I delete this swapfile? When I enter admin:// in nautilus and go with root rights to the file to delete it, I get an error that I don't have the permissions to do that.
I'd like to test it with a swapfile in root directory.

My Swapfile is in /, not in /root, only /

Did You tried it over the Terminal with sudo rm? Maybe use before the Disable Command from the Guide sudo swapoff

1 Like