Creates and mounts a proper RAMdisk of custom size. (tmpfs IS NOT A REAL RAMDISK!)
#!/bin/bash
_SIZE='10' # Gigabyte
if [ -d "/srv/ramdisk/lost+found/" ]
then
echo 'RAMdisk /srv/ramdisk already exists. Exiting.'
else
mkdir /srv/ramdisk
chattr +i /srv/ramdisk
mke2fs -t ext4 -O extents -vm0 /dev/ram0 ${_SIZE}G -L 'RAMDISK'
mount /dev/ram0 /srv/ramdisk
chmod a+rwx /srv/ramdisk
fi