Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DietPi-Set_swapfile | zram is not applied on first boot #4002

Closed
Dr0bac opened this issue Dec 24, 2020 · 5 comments
Closed

DietPi-Set_swapfile | zram is not applied on first boot #4002

Dr0bac opened this issue Dec 24, 2020 · 5 comments
Labels
Bug 🐞 Solution available 🥂 Definite solution has been done
Milestone

Comments

@Dr0bac
Copy link

Dr0bac commented Dec 24, 2020

On fresh dietpi install and before first boot i opened dietpi.txt and edited few lines.

For swap file i entered

AUTO_SETUP_SWAPFILE_SIZE=1

and

AUTO_SETUP_SWAPFILE_LOCATION=zram

When i go to dietpi_config/Advanced Options

I get this result

IMG_20201224_003515__01.jpg

Is this correct output for zram configuration?

Also, where exactly zram keep swapfile? If i understand correctly swap file is located on ram memory and not on sd card or external hdd?

@MichaIng
Copy link
Owner

MichaIng commented Dec 24, 2020

Many thanks for your report. I'll try to replicate.

The zram implementation does not create a swap "file" but uses the zram block device itself as swap space, similar to a swap partition. Indeed the dietpi-config output doesn't look like it worked correctly but default /var/swap file was used.

Easiest command to check which swap spaces are really used: swapon (without arguments)

@Dr0bac
Copy link
Author

Dr0bac commented Dec 24, 2020

root@DietPi:~# swapon
NAME      TYPE SIZE USED PRIO
/var/swap file   1G   0B   -2

how can i change to zram method?

@Joulinar
Copy link
Collaborator

you can try following /boot/dietpi/func/dietpi-set_swapfile 1 zram

@Dr0bac
Copy link
Author

Dr0bac commented Dec 24, 2020

Thank you. success!

root@DietPi:~# swapon
NAME       TYPE      SIZE USED PRIO
/dev/zram0 partition 487M   0B   -2

in dietpi-drive_manager i get these two new drives, this is normal behavior after enabling zram?

fffff

@MichaIng MichaIng added Bug 🐞 Solution available 🥂 Definite solution has been done and removed Investigating 🤔 labels Dec 25, 2020
@MichaIng MichaIng added this to the v6.35 milestone Dec 25, 2020
@MichaIng
Copy link
Owner

MichaIng commented Dec 25, 2020

There was indeed a bug in the logic of the script that dropped zram/zram0 dietpi.txt entries. Actually this was to prevent the attempt of removing the /dev/zram0 block device as if it was an ordinary file, but the dietpi.txt entry was not used at all then, hence was reset to default during first boot setup.
Fixed with: 8eb0973
Changelog: c2a6996

@MichaIng MichaIng changed the title Did i set zram properly? DietPi-Set_swapfile | zram is not applied on first boot Dec 27, 2020
@MichaIng MichaIng mentioned this issue Feb 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug 🐞 Solution available 🥂 Definite solution has been done
Projects
None yet
Development

No branches or pull requests

3 participants