We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c0e8406 commit 1269f96Copy full SHA for 1269f96
bin/x-mac-ramdisk
@@ -0,0 +1,18 @@
1
+#!/bin/bash
2
+#
3
+# Creates a RAM disk in Mac OS X
4
5
+# Copied from http://pastie.textmate.org/private/igcxuzqqvlmlbavxooj2uw
6
+# by @antirez
7
+
8
+ramfs_size_mb=1024
9
+mount_point=~/volatile
10
11
+ramfs_size_sectors=$((${ramfs_size_mb}*1024*1024/512))
12
+ramdisk_dev=`hdid -nomount ram://${ramfs_size_sectors}`
13
+newfs_hfs -v 'Volatile' ${ramdisk_dev}
14
+mkdir -p ${mount_point}
15
+mount -o noatime -t hfs ${ramdisk_dev} ${mount_point}
16
+echo "remove with:"
17
+echo "umount ${mount_point}"
18
+echo "diskutil eject ${ramdisk_dev}"
0 commit comments