User Tools

Site Tools



Found this nice little script that avoids some of the confusion of creating RamDisks under FreeBSD. Just making my own copy here. It creates md10 only, and frees it when you're done (just change the variables).

This creates it as a RAMDisk on Swap. If you want to use main memory, add -M in the mdmfs command
# Taken from
# Tested and works on FreeBSD 10
case "$1" in
        /sbin/mdmfs -s 256M md10 /mnt/ramdisk
        echo "256MB ramdisk created on /dev/md10 and mounted on /mnt/ramdisk"
        /sbin/mdconfig -l -u 10
        exit 0
        /sbin/umount /mnt/ramdisk
        /sbin/mdconfig -d -u 10
        echo "ramdisk unmounted from /mnt/ramdisk and deleted from /dev/md10"
        /sbin/mdconfig -l
        echo "Usage: `basename $0` {start|stop}" >&2
        exit 64
unix/freebsd/ramdisks.txt · Last modified: 2016/09/08 00:11 by