• Home
  • Shop
    • FLX1s
    • FLX1s Case
    • FLX1s Screen Protector
    • FLX1 Case
    • FLX1 Screen Protector
  • Resources
    • Blog
    • Search
    • Forum
    • Flash Guide
    • Changelog
    • Privacy Policy
    • Shipping
    • Refund and Returns Policy
    • FuriLabs Github
  • About us
    • Reviews
    • Frequently Asked Questions
    • FuriLabs in the Media
    • Timeline
    • Contact
My Account
Login Register

Lost password?

Your personal data will be used to support your experience throughout this website, to manage access to your account, and for other purposes described in our privacy policy.

0
0 My Wishlist

View Wishlist Add all to cart

0 0
0 Shopping Cart

No products in the cart.

Return To Shop
Shopping cart (0)
Subtotal: $0.00

Checkout

My Account
Login Register

Lost password?

Your personal data will be used to support your experience throughout this website, to manage access to your account, and for other purposes described in our privacy policy.

0
0 My Wishlist

View Wishlist Add all to cart

0 0
0 Shopping Cart

No products in the cart.

Return To Shop
Shopping cart (0)
Subtotal: $0.00

Checkout

  • Home
  • Shop
    • FLX1s
    • FLX1s Case
    • FLX1s Screen Protector
    • FLX1 Case
    • FLX1 Screen Protector
  • Resources
    • Blog
    • Search
    • Forum
    • Flash Guide
    • Changelog
    • Privacy Policy
    • Shipping
    • Refund and Returns Policy
    • FuriLabs Github
  • About us
    • Reviews
    • Frequently Asked Questions
    • FuriLabs in the Media
    • Timeline
    • Contact
Wishlist 0
Sign in
Shop
Facebook Twitter Instagram Youtube Linkedin
  • Home
  • Shop
    • FLX1s
    • FLX1s Case
    • FLX1s Screen Protector
    • FLX1 Case
    • FLX1 Screen Protector
  • Resources
    • Blog
    • Search
    • Forum
    • Flash Guide
    • Changelog
    • Privacy Policy
    • Shipping
    • Refund and Returns Policy
    • FuriLabs Github
  • About us
    • Reviews
    • Frequently Asked Questions
    • FuriLabs in the Media
    • Timeline
    • Contact
Shop
0
0 My Wishlist

View Wishlist Add all to cart

My Account
Login Register

Lost password?

Your personal data will be used to support your experience throughout this website, to manage access to your account, and for other purposes described in our privacy policy.

0 0
0 Shopping Cart

No products in the cart.

Return To Shop
Shopping cart (0)
Subtotal: $0.00

Checkout

FLX1s is in stock and shipping
Into the Wild with Librem 5 – Part 4
  • Home
  • Shop
    • FLX1s
    • FLX1s Case
    • FLX1s Screen Protector
    • FLX1 Case
    • FLX1 Screen Protector
  • Resources
    • Blog
    • Search
    • Forum
    • Flash Guide
    • Changelog
    • Privacy Policy
    • Shipping
    • Refund and Returns Policy
    • FuriLabs Github
  • About us
    • Reviews
    • Frequently Asked Questions
    • FuriLabs in the Media
    • Timeline
    • Contact
Wishlist 0
Sign in
Shop
Facebook Twitter Instagram Youtube Linkedin
0 0
0 Shopping Cart

No products in the cart.

Return To Shop
Shopping cart (0)
Subtotal: $0.00

Checkout

FLX1s is in stock and shipping
Into the Wild with Librem 5 – Part 4
  • Recent Posts
  • Forums
Forums
Owners Forum
FLX1 Owners
Add swap?
 
Notifications
Clear all

[Solved] Add swap?

 
FLX1 Owners
Last Post by CaptainCook 8 months ago
10 Posts
5 Users
6 Reactions
632 Views
RSS
2
26/09/2024 10:59 am
Topic starter
Marius 
(@rasumi)
Customer
  Eminent Member
25 Posts
3 22 0

The ram in the FLX1 is not enough for my usual daily routine (opening Firefox, Tuba, Fractal, Signal (in Android container) and using all of them for  a while). Usually, then my firefox gets unresponsive or phosh gets ultra slow or even unusable.

I would therefore like to add a little bit of swap (but still of course want the already configured zram "swap" to come first / have higher prio). Unfortunately I don't find where it is configured (it's not in /etc/fstab or in /lib/init/fstab) in order to set its priority higher than the one of my new swap (for which I can't give negative prio in /etc/fstab). By default, my new swap gets prio -2 and /dev/block/zram0 gets -3, so the wrong order. Any ideas?

What do you think of generally configuring swap space as a default for all flx1 devices? Or do you fear the storage might suffer from this?

Or do you have other ideas that are better than adding swap?


Answer
Add a comment
Add a comment
6 Answers
2
27/09/2024 1:28 pm
fakeshell 
(@fakeshell)
Admin
  Member
151 Posts
0 104 47

#!/bin/bash

# 2.5G
size=$((2560 * 1024 * 1024))

swap_file="/swapfile"

sudo dd if=/dev/zero of=$swap_file bs=1M count=$((size / 1024 / 1024)) status=progress

sudo chmod 600 $swap_file

sudo mkswap $swap_file

sudo swapon --priority -3 $swap_file

swapon --show

free -h

 

using this, i got:

cat /proc/swaps
Filename Type Size Used Priority
/dev/block/zram0 partition 3128848 1014124 -2
/swapfile file 2621436 0 -3

 

so zram is now -2 and swapfile is -3
it can be made as a script and enabled with systemd, something like:

 

[Unit]
Description=setup swap on startup
After=lxc@android.service

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/bin/setup-swap.sh

[Install]
WantedBy=graphical.target


Add a comment
Add a comment
2
25/11/2024 9:11 am
Dogman 
(@jakes2me-com)
Customer
  Eminent Member
21 Posts
6 13 2

Thanks! but please do note that with the most recent updates if you create a systemd service to launch right after the lxc service it will break wifi. 

For those reading to prevent this just make the systemd service run 2 mins after boot with 

[Timer]
OnBootSec=2min



Add a comment
praveen 11/12/2024 6:56 pm

@jakes2me-com this does not help, even with this wifi is disabled on reboot. I have to disable the service, reboot again and start the service. So at present the automation is not working.


 
praveen 11/12/2024 6:59 pm

@jakes2me-com do you know which service enables wifi? May be we should start this after wifi is enabled.


 
Dogman 12/12/2024 7:40 am

yeah it broke for me last update too for some reason and sadly its not the wifi service from what I found, I found its because of "After=lxc@android.service" in the bootscript i.e its the driver loading service.
To fix this for me at least, I usually dont need the swap right away after boot, so I manually made an onboot script thats set for 10 mins after boot at thats it lol. Phone is unlikely to be booting for 10 mins and will usually be about 5 so 5 after boot aint half bad vs not having wifi.

[Unit]
Description=setup swap on startup

[Timer]
OnBootSec=10min

[Service]
Type=oneshot
RemainAfterExit=no
ExecStart=/usr/bin/swapmaker.sh

[Install]
WantedBy=graphical.target


 
Show 1 more comments
Add a comment
0
30/09/2024 8:58 am
Topic starter
Marius 
(@rasumi)
Customer
  Eminent Member
25 Posts
3 22 0

Thanks a lot, I did not know that swapon accepts negative priorities whereas /etc/fstab doesn't.


Add a comment
Add a comment
0
25/11/2024 12:44 pm
praveen 
(@praveen)
Customer
  Estimable Member
78 Posts
31 37 10

I think more people find this option useful and it'd be good to add support for this directly in settings.


Add a comment
Add a comment
0
08/12/2024 8:45 pm
praveen 
(@praveen)
Customer
  Estimable Member
78 Posts
31 37 10
$ cat /etc/systemd/zram-generator.conf.d/librem5.conf
[zram0]
zram-fraction = 2
max-zram-size = none

Does this make sense for FLX1 as well ? Originally for Librem 5.
 https://forums.puri.sm/t/why-and-how-to-extend-zram-on-l5-a-revolution-for-librem-5-stability/24046/34?u=pirate_praveen 

Add a comment
Add a comment
0
22/04/2025 6:40 am
CaptainCook 
(@captaincook)
Customer
  Estimable Member
68 Posts
22 20 26

The following worked for me and it's faster since you don't re-create a swap file you already created, this is using a second swap file called /swapfile2:

Create second swap file:

sudo dd if=/dev/zero of=/swapfile2 bs=1G count=4
sudo mkswap /swapfile2 && sudo chmod 0600 /swapfile2

Add a script to /usr/bin/swapon.sh the #!/bin/bash may not be needed here since the service runs /bin/bash not sure

#!/bin/bash

# Turn on second swap file after boot


swap_file="/swapfile2"

sudo swapon --priority -3 $swap_file

Add a service to /etc/systemd/system/swapon.service

[Unit]
Description=turn on second swap on startup

[Timer]
OnBootSec=3min

[Service]
Type=oneshot
RemainAfterExit=no
ExecStart=/bin/bash /usr/bin/swapon.sh

[Install]
WantedBy=multi-user.target

Adjust service permissions:

$ chmod 644 /etc/systemd/system/swapon.service

 


This post was modified 8 months ago by CaptainCook
Add a comment
Add a comment
Forum Jump:
  Previous Topic
Next Topic  
Forum Information
Recent Posts
Unread Posts
Tags
  • 1 Forums
  • 174 Topics
  • 819 Posts
  • 1 Online
  • 658 Members
Our newest member: lex
Latest Post: How to get a refund ?
Forum Icons: Forum contains no unread posts Forum contains unread posts
Topic Icons: Not Replied Replied Active Hot Sticky Unapproved Solved Private Closed

Powered by wpForo  Powered by wpForo version 2.4.12

  • Matrix (protocol) logo
  • Brand Bluesky Streamline Icon: https://streamlinehq.com
  • Resources

    • FAQ

    • Shipping

    • Returns and Exchanges

    • Privacy Policy

  • Company

    • About Us

    • Timeline

    • Furi Labs in the Media

    • FuriOS Changelog

    • Furi Labs Github

Copyright © 2025 FuriLabs

Android is a trademark of Google LLC. The Android robot is reproduced or modified from work created and shared by Google and used according to terms described in the Creative Commons 3.0 Attribution License.

Home
0 Wishlist
Shop
More
More
  • Home
  • Shop
    • FLX1s
    • FLX1s Case
    • FLX1s Screen Protector
    • FLX1 Case
    • FLX1 Screen Protector
  • Resources
    • Blog
    • Search
    • Forum
    • Flash Guide
    • Changelog
    • Privacy Policy
    • Shipping
    • Refund and Returns Policy
    • FuriLabs Github
  • About us
    • Reviews
    • Frequently Asked Questions
    • FuriLabs in the Media
    • Timeline
    • Contact