Joined
·
1,744 Posts
I've been running my Minecraft servers on a ramdisk awhile now at my home. However I kept having issues on my laptop, the world would load real slowly. Or not even load at all. I'd be walking in mid air. I thought this was just due to my laptop being underpowered. Turns out, even with an ssd my textures were just not loading. Created a 1gb ramdisk, @reboot in the crontab to load it with the ~/.minecraft folder and create a symlink to /home/"$USER"/.minecraft and all my troubles are gone. The world loads faster than ever and I can see things from a great distance instead of waiting till I get close for them to load. I haven't had an issue since making this change.
To backup the ramdisk on shutdown / reboot I created this systemd service file.
Code:
This script both the load and shutdown
Code:
TLDR - Ramdisk loads textures instantly. Not just good for chunk loading on Minecraft. Gave my laptop whole new life with Minecraft.
To backup the ramdisk on shutdown / reboot I created this systemd service file.
Code:
Code:
[Unit]
Description = logs uptime
After = network.target
[Service]
User = jason
Group = jason
Type = simple
ExecStart = /bin/true
ExecStop = /home/jason/bin/mylaptop mcramdisk shutdown
RemainAfterExit = yes
[Install]
WantedBy = multi-user.target
Code:
Code:
if mountpoint /ramdisk ; then
case "$2" in
shutdown)
rsync -auv --progress /ramdisk/.minecraft/* /home/"$USER"/.MINECRAFT/
;;
load)
mkdir -p /ramdisk/.minecraft
rsync -auv --progress /home/"$USER"/.MINECRAFT/* /ramdisk/.minecraft/
if [[ ! -e /home/"$USER"/.minecraft ]] ; then
ln -s /ramdisk/.minecraft /home/"$USER"/
fi
;;
esac
fi