Problem: RAM disk/drive on Xbian, how to use zramswap?
|
19th May, 2023, 06:29 AM
Post: #1
|
|||
|
|||
RAM disk/drive on Xbian, how to use zramswap?
Hello,
one Kodi plugin downloads repeatedly a file worth tens of MB data and to save SDHC card writing cycles, I have found using "df -Th", that only tmpfs (RAM based filesystem per my understanding) is /dev and /run # df -Th|grep tmpfs Code: devtmpfs devtmpfs 1.6G 71M 1.5G 5% /dev I may utilize /dev/bigfile.name if i "chown xbian /dev", but since it may not be good practice, but /run seems to have already writing permissions for all users "Access: (1777/drwxrwxrwt)". Beside that I was able to do: Code: mkdir -p /mnt/tmpfs Yet someone suggested me to use zram with lz4 compression (claiming to be better compression than Xbian default lzo-rle) to save the space. Though i have doubts about this approach since zram is slower than regular tmpfs and if tmps/memory pressure is high, it will then move to zram swap per my understanding). But anyway if i want to do it, i tried these steps (failed): # zramctl --output-all Code: NAME DISKSIZE DATA COMPR ALGORITHM STREAMS ZERO-PAGES TOTAL MEM-LIMIT MEM-USED MIGRATED MOUNTPOINT # mount -t ext4 /dev/zram0 /mnt/zram Code: mount: /mnt/zram: /dev/zram0 already mounted or mount point busy. # mount -t tmpfs /dev/zram0 /mnt/zram # df -h Code: /dev/zram0 1.8G 0 1.8G 0% /mnt/zram I am able to mount it automatically using /etc/fstab line: Code: /dev/zram0 /mnt/zram tmpfs size=100M,mode=0755,uid=xbian 0 0 I could do: # swapoff -a;zramctl --algorithm lz4 --streams 4 --size 128M /dev/zram0 && swapon # zramctl --output-all Code: NAME DISKSIZE DATA COMPR ALGORITHM STREAMS ZERO-PAGES TOTAL MEM-LIMIT MEM-USED MIGRATED MOUNTPOINT Code: Swap: 0B 0B 0B I could write file to /mnt/zram/ but i see no zram usage: # df -h /mnt/zram /mnt/tmpfs Code: Filesystem Size Used Avail Use% Mounted on # zramctl Code: NAME ALGORITHM DISKSIZE DATA COMPR TOTAL STREAMS MOUNTPOINT # free -h Code: total used free shared buff/cache available and test the speed: ioping -R /mnt/zram -R, -rapid test with rapid I/O during 3s (-q -i 0 -w 3) Code: --- /mnt/zram (tmpfs /dev/zram0 100 MiB) ioping statistics --- vs regular tmpfs: Code: --- /mnt/tmpfs (tmpfs tmpfs 100 MiB) ioping statistics --- # fdisk -x /dev/zram0 Code: Disk /dev/zram0: 128 MiB, 134217728 bytes, 32768 sectors # lsblk -a Code: NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT Do you have idea on /etc/fstab line to mount zram based filesystem please? |
|||
« Next Oldest | Next Newest »
|
Messages In This Thread |
RAM disk/drive on Xbian, how to use zramswap? - postcd - 19th May, 2023 06:29 AM
RE: RAM disk/drive on Xbian, how to use zramswap? - Nachteule - 25th May, 2023, 04:37 AM
RE: RAM disk/drive on Xbian, how to use zramswap? - postcd - 12th Jun, 2023, 06:50 PM
RE: RAM disk/drive on Xbian, how to use zramswap? - Nachteule - 12th Jun, 2023, 08:11 PM
RE: RAM disk/drive on Xbian, how to use zramswap? - sortrequire - 11th Dec, 2023, 02:51 PM
RE: RAM disk/drive on Xbian, how to use zramswap? - ontosalsa - 17th Nov, 2023, 01:05 PM
|