|
|
Great news! Plus an easier way.
This is fantastic. Good work.
I've found (based on bombich's findings) easier ways of doing this. Easiest way: from the terminal, run the command: hdid ram://disksize In the finder, a message pops up "This disk is unreadable" Click "Initialize..." and then use disk utility to format the new ram disk you've created. Now just drag files onto the ram disk that you need. Here's an all-terminal way of doing the same: (output is in bold). hdid -nomount ram://disksize /dev/diskN newfs_hfs /dev/rdiskN Initialized /dev/rdiskN as a [disksize]MB HFS Plus volume hdiutil mount /dev/diskN where N is the disk number returned by hdid in step 1. Note the change to rdiskN from disk in in the newfs step: this is because rdisks are "raw disks" that can be formatted. /dev/disk entries are only useful after the corresponding raw entry has been formatted. Note that I have had problems in getting the ram disks to actually go away after ejecting them in the finder. 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.
Great news! Plus an easier way.
There is no point for a RAM disk in a Virtual Memory System like OS X!
Great news! Plus an easier way. BUT...
It is true that in a high speed virtual memory system there is no NEED for a RAM disk, but there is a USE for one! I still turn my Mac off when I'm not home (where it is) so I use a RAM disk for my cache for Netscape or IE. That way when I turn the computer off, my cache simply dissappears instead of remaining on the machine. When you create a RAM disk, you can point your cache to that "disk" and then the cache will run at RAM speeds, which is still faster than the virtual memory that ANY system has, and it will not stay with the computer and eventually need clearing out. If you simply quit Netscape or IE, you can clear it out manually (or with some script) as well as the history, and any other database that gets created whenever you run the web browsers. So for a security reason, it is easier to delete lots of unwanted tracking files with a RAM disk.
Great news! Plus an easier way. BUT...
I see the point for killing the IE cache, but, it might well not be faster than doing it other ways. The point is, that all file i/o in unix is buffered via memory. This is done in such a way that with a good quantity of ram, the disk is very rarely written to. The vm system takes care of paging the 'dirty' file buffers to disk. I very much doubt if in osx the ram disk gets guaranteed ram residency. Therefore, when the system has need for extra pages, it too will be paged out to disk (and will sit there until paged in again). I may be wrong, but I think the only non-pagable part of the memory will be a set of core kernel code.
Great news! Plus an easier way.
Ram disks improve efficiency enormously for applications that manipulate hundreds or thousands of temporary files, when disk I/O becomes a bottleneck due to the limited hardware bandwidth.
There is no point???
Just startup in single user mode (command-s at startup) and try using the man command:
man lsYou will get an error message because /tmp is not writable. This is the perfect time for a ramdisk. Linux does this for installation and for a bootable CD.
There is no point???
/tmp and /var/run are candidates to mount as RAM disks.
Sad news! UMA still has no bootable/persistent RAMDISKS!
Some while ago , Apple started using cheap memory parts -- and thus obsoleted a VERY cool feature that has been an essential life-saver many times when a system became toally unbootable otherwise (from cdrom or dasd or zipdisk) ...
Sad news! UMA still has no bootable/persistent RAMDISKS!
I thought it was because the newer memory systems lose contents a lot faster when not getting power than the old memory. Not "cheaper" parts.
Sad news! UMA still has no bootable/persistent RAMDISKS!
I'm fairly certain that bootable ram disks were never preserved in ram over a shutdown. Instead, they got written to disk and read back into ram at startup by bootstrap code. I remember seeing the files (invisible on early SE/ Plus systems). New ram technology does loose information faster than old technology, but then its also faster to access and bigger capacity and higher bandwidth. And whilst it is cheaper than ram used to be this is due to increased quality production processes (which create higher chip yeild, and hence are lower overhead in terms of cost) and because ram is comoditized (and the market has surplus - remember when a fire in Japan wiped out a whole crop, ram went ceiling high then).
Great news! Plus an easier way.
That's a really easy way to make the ram disk, only one command (hdid ram://disksize). Couple of questions though
Great news! Plus an ApleScript way!!
I took the hints from 'zpincus' and modified them to AppleScript.
Here's what I came up with (you may have to reformat the script from the copy/paste). tell application "Finder" Hope it works for you. For those of you who may have been getting an error at the 'new_hfs'... part, I added the full path to the command, as mine was giving me an error. Please also note that you will very likely have to unmount the disk from the Disk Utility. It disappeared fine from my desktop with the drag-to-trash method, but didn't really go away. FWIW. Feel free to email me with questions. Enjoy.
AppleScript To Create RAM Disks
You can download an AppleScript Application to create a RAM Disk at my web site:
http://homepage.mac.com/nick2588/ It is pretty much uses the code above, but an AppleScript is nice because it is all automated. :)
Great news! Plus an easier way.
this is a great tip, but here's my problem:
UNIX script --This is what happens when i'm REALLY bored.
Me again, I answered my own question. I don't know how efficient it is, but here's my script:
UNIX script --This is what happens when i'm REALLY bored.
I've made a Perl script to call the necessary commands: download it here
Unlike the other suggestions so far, this one also lets you specify the name of the disk and does some error simple error checking.
Usage: ramdisk MB_size [name]
e.g.
ramdisk 10 mydisk
ramdisk 20
If you don't give a name, it defaults to "untitled".
|
SearchFrom our Sponsor...Latest Mountain Lion HintsWhat's New:HintsNo new hintsComments last 2 daysLinks last 2 weeksNo recent new linksWhat's New in the Forums?
Hints by TopicNews from Macworld
From Our Sponsors |
|
Copyright © 2014 IDG Consumer & SMB (Privacy Policy) Contact Us All trademarks and copyrights on this page are owned by their respective owners. |
Visit other IDG sites: |
|
|
|
Created this page in 0.10 seconds |
|