AFP548

Making RAM disks in 10.6 that are -notremovable

I am replacing my G5 (10.5) Xserve with a late 2008 Xserve (10.6). This server is primarily a web server, with a small amount of mail traffic. I keep my 'webfolder' on a RAM disk. All of my pages are dymanic php/mysql, so they can't be cached. But reading from RAM is so fast, you'd never know it. This is the command I used in 10.5 to create a 1 GB RAM disk at boot: [code]/usr/sbin/diskutil erasevolume HFS+ "web-ram" `/usr/bin/hdiutil attach -notremovable -nomount ram://2200000`[/code] Not the "notremovable", that flag makes the system treat the mounted disk image (or in this case, the RAM disk), like a real physical disk, and not a mounted disk image. When you use this flag, the ram disk will actually show up with a regular hard drive icon. Without this flag, it shows up as a white disk image. But this flag doesn't work in 10.6. According to the man page, it's still there. But when I use it, I get permissions errors. I am using it with sudo (from the command line, or as root via lanuchdeamons). As I look closer at my errors, It appears that what might be happening is that the diskutil command is being run as root, but the hdiutil command inside of it, is not. Anyway this is about more than just the icon. When the ram disk is mounted as a real disk, its harder to eject, which is good because it's my web folder and I don't want it going anywhere. AND when its mounted that way, I can use time machine to back it up. Which works out to be a great system for that.
Exit mobile version