ramdrive

Matus

Renowned Member
Mar 31, 2017
28
0
66
67
Hello,

I have created ramdrive for proxy cache with this commands:
>modprobe brd rd_size=5200000
>pvcreate /dev/ram0
>vgcreate vgramdisk /dev/ram0
>lvcreate -L 4G -n ramstorage vgramdisk
>mkfs.ext2 /dev/vgramdisk/ramstorage
>mount -o noatime /dev/vgramdisk/ramstorage /mnt/ramstorage
Then I create directory storage and mountpoint to container.
It works very well.

Now we need to automate this on starting of system.
Could you advise me best practise for this in Proxmox?

Thanks
 
If your goal is just to have a directory stored directly in RAM, the better option would be a tmpfs. I.e. mount -o size=5G -t tmpfs none /mnt/ramstorage. This is just a mount then, so you can put it in /etc/fstab to make it persistent.