Skip to content

nicothread/linux-zram-user-disk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Installation of zram-disk on boot

wiki.archlinux.org - zram

Create kernel module configuration

echo "zram" > /etc/modules-load.d/zram.conf

Add udev rule to /etc/udev/rules.d

Filename : 99-zram.rules Parameters for this example :

  • device : zram0
  • algorithm : zstd
  • size : 50M
  • disk type : ext4
ACTION=="add", KERNEL=="zram0", ATTR{comp_algorithm}="zstd", ATTR{disksize}="50M", RUN="/usr/bin/mkfs.ext4 -U clear /dev/%k", TAG+="systemd"

Mount with fstab entry

Add fstab entry for <mount-path> and <zram0>.

This example for default user uid=1000 :

/dev/zram0 <mount-path> ext4 umask=0022,gid=1000,uid=1000

Or mount with 2 services on boot for mount, on shutdown/logoff to erase data

Mount service

Files :

  • mount_zram_disk.service
  • mount_zram_disk.sh

Umount service

Files :

  • erase_zram_disk.sh
  • erase_zram_disk.service

About

Initializes and mounts a zRAM partition at boot to store temporary data for the user.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages