WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: [Solved] I need help to stop /dev/zram0 please  (Read 1172 times)

aus9

  • Guest
[Solved] I need help to stop /dev/zram0 please
« on: May 21, 2023, 12:09:07 AM »
Hi

I have forgotten most things about piCore so if you think its written somewhere and I have failed to understand, have a laugh and then tell me straight please.

if you see any config wrong....because I have failed to spot ....assume I am an idiot tell me please

I have a model B 4G Ram and a 32G sdcard. I read the readme that suggested you add NOZSWAP bootcode to stop /dev/zram0 (swapfile) but I noticed the following
Code: [Select]
dmesg | grep swap
[    0.000000] Kernel command line: coherent_pool=1M 8250.nr_uarts=0 snd_bcm2835.enable_headphones=0 snd_bcm2835.enable_headphones=1 snd_bcm2835.enable_hdmi=1 snd_bcm2835.enable_hdmi=0 video=HDMI-A-1:1920x1080M@60,margin_left=48,margin_right=48,margin_top=48,margin_bottom=48 smsc95xx.macaddr=DC:A6:32:4B:4A:65 vc_mem.mem_base=0x3ec00000 vc_mem.mem_size=0x40000000  zswap.compressor=lz4 zswap.zpool=z3fold console=tty1 root=/dev/ram0 rootwait quiet nortc loglevel=3 noembed home=/dev/mmcblk0p2 NOZSWAP
[    2.424458] Adding 952176k swap on /dev/zram0.  Priority:-2 extents:1 across:952176k SSFS
[    2.770787] Adding 4661968k swap on /dev/mmcblk0p3.  Priority:-3 extents:1 across:4661968k SSFS

I made that swap partition and my /etc/fstab is in back up and reads
Quote
# /etc/fstab
proc           /proc          proc   defaults 0 0
sysfs          /sys           sysfs  defaults 0 0
devpts         /dev/pts       devpts defaults 0 0
tmpfs          /dev/shm       tmpfs  defaults 0 0
/dev/mmcblk0p1 /mnt/mmcblk0p1 vfat   noauto,users,exec,umask=000 0 0
/dev/mmcblk0p2 /mnt/mmcblk0p2 ext4   users,exec 0 1
/dev/mmcblk0p3 swap           swap   defaults   0 0

I load inxi and util-linux and
Code: [Select]
inxi --swap
Swap:
  ID-1: swap-1 type: zram size: 929.9 MiB used: 0 KiB (0.0%) dev: /dev/zram0
  ID-2: swap-2 type: partition size: 4.45 GiB used: 0 KiB (0.0%)   dev: /dev/mmcblk0p3
Code: [Select]
/usr/local/sbin/swapon --summary
Filename Type Size Used Priority
/dev/zram0                              partition 952176 0 -2
/dev/mmcblk0p3                          partition 4661968 0 -3

Can you spot my errors please?

« Last Edit: May 21, 2023, 05:07:26 AM by Rich »

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11286
Re: I need help to stop /dev/zram0 please
« Reply #1 on: May 21, 2023, 04:11:31 AM »
Hi aus9
... I read the readme that suggested you add NOZSWAP bootcode to stop /dev/zram0 (swapfile) ...
It's case sensitive. That needs to be:
Code: [Select]
nozswap
Quote
... I made that swap partition and my /etc/fstab is in back up  ...
Don't back up  /etc/fstab , it will find the swap partition on its own.

aus9

  • Guest
Re: I need help to stop /dev/zram0 please
« Reply #2 on: May 21, 2023, 04:57:27 AM »
Hi Rich

piCore 14x README states
Quote
By default piCore has a gzip compressed swap in RAM, automatically
sized to 25% of available RAM. This can be disabled with the NOZSWAP
boot code.

I will make your suggested changes, I have to post in Beta so will let Paul_123 know there thanks

anyhow, I was going nuts trying to figure what I did wrong....I am glad I am still innocent ;)

trivia, that file for swap appears to be unchange boot code since 6x as per
http://tinycorelinux.net/6.x/armv6/releases/README

Please mark as solved

Rich, I have deleted home from backup. So will piCore detect /home on mmcblk0p2 as well?
« Last Edit: May 21, 2023, 04:59:50 AM by aus9 »

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11286
Re: [Solved] I need help to stop /dev/zram0 please
« Reply #3 on: May 21, 2023, 05:18:53 AM »
Hi aus9
... Please mark as solved ...
Done.

Quote
... I have deleted home from backup. So will piCore detect /home on mmcblk0p2 as well?
No. Try adding the boot code:
Code: [Select]
home=mmcblk0p2

aus9

  • Guest
Re: [Solved] I need help to stop /dev/zram0 please
« Reply #4 on: May 21, 2023, 06:13:35 AM »
Hi Rich

done but raised a minor issue trying to use GUI to delete etc/fstab in aarch64. I used nano instead

aus9

  • Guest
Re: [Solved] I need help to stop /dev/zram0 please
« Reply #5 on: May 30, 2023, 02:39:30 AM »
This is an update after I used a power switch off and on to get around a video crash. I make mistakes so feel free to point them out please

For those interested in having only a swap partition and no swap file read on please

1) I used TC64 gparted to create and format my swap for my sdcard but you can use command line tools
so do that please
2) boot up and you may need to turn off existing swap if its active eg
Code: [Select]
sudo swapoff /dev/zram0 3) Use root powers to edit /etc/fstab so assuming you have only 3 partitions your swap line reads
Quote
/dev/mmcblk0p3 swap           swap   defaults   0 0
4) Edit /opt/.filetool.lst to add line
Quote
etc/fstab
or use GUI cpanel
5) mount /dev/mmcblk0p1 and edit cmdline.txt to include the boot code nozswap
As Rich as kindly pointed out....its all lowercase
6) reboot with backup enabled. I am a visual type person so htop does a good job at showing my swap size
There are command alternatives including
Code: [Select]
dmesg | swap

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11286
Re: [Solved] I need help to stop /dev/zram0 please
« Reply #6 on: May 30, 2023, 05:36:07 AM »
Hi aus9
... 3) Use root powers to edit /etc/fstab so assuming you have only 3 partitions your swap line reads
Quote
/dev/mmcblk0p3 swap           swap   defaults   0 0
...
Tinycore can find swap partitions and add them to  /etc/fstab  on its own like this:
Code: [Select]
sudo rebuildfstab
Quote
... 4) Edit /opt/.filetool.lst to add line
Quote
etc/fstab
or use GUI cpanel  ...
If you back up  /etc/fstab  here is what happens. During bootup,  /etc/init.d/tc-config  runs
rebuildfstab  creating a fresh  /etc/fstab. Just before  /etc/init.d/tc-config  exits, it runs the
restore and overwrites the fresh data in  /etc/fstab  with the stale data you backed up.