Memory based file system (ramdisk) on FreeBSD
To create a ramdisk for /tmp and detach it on FreeBSD 8
Don't forget to chmod +w for read/write
Detach it and delete from /dev/md0
There is a shell script for the operation
# /sbin/mdmfs -M -S -o async -s size md0 /tmp
Don't forget to chmod +w for read/write
# chmod +w /tmp
Detach it and delete from /dev/md0
# /sbin/mdconfig -d -u 0
There is a shell script for the operation
Caution! This is for specificed purpose only! You have to modify the parameters if you want to use it.
%cat ramdisk.sh
#!/bin/sh
case "$1" in
create)
/sbin/mdmfs -M -S -o async -s 18432m md0 /tmp
/bin/chmod 777 /tmp
echo "18G ramdisk created on md0 and mounted on /tmp"
exit 0
;;
destory)
/sbin/umount /tmp
/sbin/mdconfig -d -u 0
echo "ramdisk umounted from /tmp and destory from md0"
;;
*)
echo "Usage: `basename $0` {create|destory}" >&2
exit 64
;;
esac
Comments
Post a Comment