Quantcast
Channel: Creating a ram disk on Linux - Unix & Linux Stack Exchange
Viewing all articles
Browse latest Browse all 9

Answer by user39725 for Creating a ram disk on Linux

$
0
0

To make a large ram disk after boot, with no messing around with kernel parameters, this seems to work. Use tmpfs, make a file, mount it via loop, and mount that via a filesystem:

mount -t tmpfs -o size=200M tmpfs temp/
cd temp/
dd if=/dev/zero of=disk.img bs=1M count=199
losetup /dev/loop0 disk.img
mkfs.ext4 /dev/loop0
mount /dev/loop0 temp2/

Probably a bit of performance penalty going through multiple different layers... but at least it works.


Viewing all articles
Browse latest Browse all 9

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>