ecdye / zram-config

A complete zram-config utility for swap, directories, and logs to reduce SD, NAND and eMMC block wear.
MIT License
412 stars 53 forks source link

zram device doesn't start at boot. #35

Closed yutayu closed 3 years ago

yutayu commented 4 years ago

● zram-config.service - zram-config Loaded: loaded (/etc/systemd/system/zram-config.service; enabled; vendor preset: enabled) Active: active (exited) since Sun 2020-01-19 19:17:15 JST; 7h ago Process: 352 ExecStart=/usr/local/bin/zram-config start (code=exited, status=0/SUCCESS) Main PID: 352 (code=exited, status=0/SUCCESS)

Jan 19 19:17:12 raspberrypi systemd[1]: Starting zram-config... Jan 19 19:17:14 raspberrypi zram-config[352]: entry swap /zram0 zra Jan 19 19:17:15 raspberrypi systemd[1]: Started zram-config.

and there is no device. but I restart systemd , it appears.

yutayu commented 4 years ago

sorry , i cannot reproduce and log's some line is cut.

and I restarted and successed start at boot.

● zram-config.service - zram-config Loaded: loaded (/etc/systemd/system/zram-config.service; enabled; vendor preset: enabled) Active: active (exited) since Mon 2020-01-20 02:49:18 JST; 2min 14s ago Process: 346 ExecStart=/usr/local/bin/zram-config start (code=exited, status=0/SUCCESS) Main PID: 346 (code=exited, status=0/SUCCESS)

Jan 20 02:49:15 raspberrypi systemd[1]: Starting zram-config... Jan 20 02:49:17 raspberrypi zram-config[346]: grep: /usr/local/share/zram-config/zram-device-list: No such file or directory Jan 20 02:49:17 raspberrypi zram-config[346]: mv: cannot stat '/usr/local/share/zram-config/zram-device-list.new': No such file or directory Jan 20 02:49:18 raspberrypi systemd[1]: Started zram-config.

yutayu commented 4 years ago

sometimes problem happens.

yutayu commented 3 years ago

Now, This script works well.

I didn't notice zram-config syncs when it stops. This script is perfectly I wanted. Swap system doesn't work dynamic originally , therefore I also want to use zram as disk. But I thought this script doesn't sync . Much Thanks. I changed to use zram-swap-config zram-config.

:)

yutayu commented 3 years ago

It works well and syncs with this setting.

swap alg mem_limit disk_size swap_priority page-cluster swappiness

swap lz4 250M 750M 75 0 80

swap zstd 400M 1200M 75 0 80

dir alg mem_limit disk_size target_dir bind_dir

dir lz4 50M 150M /home/pi /pi.bind

dir zstd 20M 60M /home/pi/.config/transmission /home/pi/.config/transmission.bind dir zstd 60M 180M /home/pi/.mozilla/firefox/oa4fr69f.default-esr /home/pi/.mozilla/firefox/oa4fr69f.default-esr.bind dir zstd 100M 300M /home/pi/.config/chromium ./home/pi/.config/chromium.bind dir zstd 20M 60M /home/pi/irclogs /home/pi/irclogs.bind

log alg mem_limit disk_size target_dir bind_dir oldlog_dir

log lz4 50M 150M /var/log /log.bind /opt/zram/oldlog