View Single Post
thegeek
Member
 
Join Date: Dec 2004
 
2005-04-05, 20:02

[paul@swag paul]$ mkdir /tmp/ramdisk
[paul@swag paul]$ hdid -nomount ram://`echo "32 * 2048" | bc`
/dev/disk1
[paul@swag paul]$ newfs_hfs /dev/disk1
Initialized /dev/rdisk1 as a 32 MB HFS Plus volume
[paul@swag paul]$ mount -t hfs /dev/disk1 /tmp/ramdisk
[paul@swag paul]$ cd /tmp/ramdisk/
[paul@swag ramdisk]$ df -k .
Filesystem 1K-blocks Used Avail Capacity Mounted on
/dev/disk1 32768 524 32244 2% /private/tmp/ramdisk
[paul@swag ramdisk]$ cd -
[paul@swag paul]$ hdiutil eject /dev/disk1
"disk1" unmounted.
"disk1" ejected.
[paul@swag paul]$


If I were to script this, I would probably stuff the output of the hdid command into a variable and then carry that forward. You want lots of error checking here. These aren't exactly safe commands.

Last edited by thegeek : 2005-04-05 at 20:13.
  quote