For example, programs like ProjectBuilder could label all their intermediate build files as "unimortent / never save to disk" and label all the basic source files as "critical / cache in emergency crash resistant ram or flash." You could also have a "high preformance file" checkbox in the file info editor, but this is probably a waist of the users time. Likewize, improving caching technology to handle the complexities of the read-write world would seem to be the intelegent place to direct your efforts. everyone knows that you should never put an application in a ram disk. Caching completely replaces the need for ram disks in the read-only world, i.e. I've never understood why ram disks still exist. It disappeared fine from my desktop with the drag-to-trash method, but didn't really go away. Please also note that you will very likely have to unmount the disk from the Disk Utility. part, I added the full path to the command, as mine was giving me an error. Set AppleScript's text item delimiters to prevTextDelimsįor those of you who may have been getting an error at the 'new_hfs'. ![]() Set myShellCmd to "/sbin/newfs_hfs /dev/r" & myDevDisk as textĭo shell script "hdiutil mount /dev/" & myDevDisk Set myDevDisk to the last text item of dskImg How many megabytes would you like it to be?" default answer "" buttons Here's what I came up with (you may have to reformat the script from the copy/paste).ĭisplay dialog "This script will create a RAM Disk on your desktop. I took the hints from 'zpincus' and modified them to AppleScript. On a few occasions I have had to use Disk Utility to eject the ram disks, even though their icons were gone after I "ejected" them from within the finder. Note that I have had problems in getting the ram disks to actually go away after ejecting them in the finder. ![]() dev/disk entries are only useful after the corresponding raw entry has been formatted. Note the change to rdiskN from disk in in the newfs step: this is because rdisks are "raw disks" that can be formatted. Where N is the disk number returned by hdid in step 1. Initialized /dev/rdiskN as a MB HFS Plus volume Here's an all-terminal way of doing the same: (output is in bold). Now just drag files onto the ram disk that you need. In the finder, a message pops up "This disk is unreadable"Ĭlick "Initialize." and then use disk utility to format the new ram disk you've created. I've found (based on bombich's findings) easier ways of doing this.Įasiest way: from the terminal, run the command: % hdiutil mount /dev/rdisk1You need to change the "1" in disk1 and rdisk1 to whatever number is returned by the first command. Next type: % dd if=/path/to/image/file.dmg of=/dev/disk1 bs=512ġ467392 bytes transferred in 1 secs (1467392 bytes/sec)] ![]() Replace numblocks with the number you calculated in the first step. Open a terminal and type: % hdid -nomount ram://numblocks Here are the Terminal commands:įirst, calculate the number of 512K blocks you need: numblocks = (image size in MB) * 2048 for example: 5MB = 10240 blocks. Because the disk image is mounted from the /dev entry, any changes occur in RAM. Finally, copy the contents of the disk image to the RAM /dev entry and mount it. Next, create the /dev entry for RAM using the hdid tool. First, create a read/write disk image (you can do this in Disk Copy). Read the rest of the article if you'd like to know how to create your own RAM disk from the command line.įor those of you interested in how this works from the command line, it's pretty simple. The reason I mention it here is because it could have a huge positive impact on the functionality of a bootable X CD. Rambunctious has excellent documentation on the state of RAM disks in X and when you should/should not use them. There is a utility called ramBunctious that brings this functionality back to X (well, at least it puts a GUI on it). Creating a RAM disk was easy in 9, and, until now, "undocumented" in X.
0 Comments
Leave a Reply. |