Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to read and write to a ramdisk on OpenSolaris for performance testing purposes. The tests would be aimed at network transmission and I want to rule out disk performance. I set up the ramdisk on the NFS server, machine A, with

mkfile -nv 1000m  `pwd`/ramdisk

on a directory that was mounted via NFS onto machine B. Reading the ramdisk went fine, but writing to it, just overwrote the file. I then setup a ramdisk with

ramdiskadm -a ramdisk1 1000m

which I can write to fine but I can't access over NFS. The ramdisk is put on /dev/ramdisk which is a link to /devices/pseudo I added /devices/pseudo to /etc/dfs/sharetab and mounted it on machine B without error, but the contents of the directory on machine B are emtpy.

share|improve this question
I see you added a ramdisk block device with ramdiskadm, but did you format it with a file system, then export the file system? You can't export block devices over NFS (NFS is the Network File System, as in not for block devices, that's what protocols like iSCSI, ATAoE, or FCoE are for). – Chris S Jul 1 '11 at 1:58
up vote 1 down vote accepted

Here is the high-level recipe for what you want to do:

  1. Create ramdisk device (ramdiskadm)
  2. Format ramdisk device with a filesystem (newfs or zpool create)
  3. Mount ramdisk device on a mount point (mount, or automatically for ZFS)
  4. Export that mount point through NFS (man export fs, or zfs set sharenfs=on)
  5. Profit!

mkfile doesn't create ramdisks, only files on some storage area. Since you want to test performance I don't see how it would help.

share|improve this answer
awesome thanks. With the steps outlined above I was able to google more precisely and I turned up this link which gave more detail – Kyle Hailey Jul 5 '11 at 21:06
PS steps I took, on OpenSolaris NFS server: ramdiskadm -a ramdisk1 1000m newfs /dev/rramdisk/ramdisk1 mkdir /ramdisk mount /dev/ramdisk/ramdisk1 /ramdisk share -F nfs -o rw /ramdisk chmod 777 /ramdisk On client (LINUX in this case) : mkdir /ramdisk mount -t nfs -o 'rw,bg,hard,nointr,rsize=32768,wsize=32768,tcp,nfsvers=3,timeo=600' server_machine:/ramdisk /ramdisk Now, on the client I can read and write to the ramdisk and avoid the disk speed issues: time dd if=/ramdisk/toto of=/dev/null bs=1024k count=800 838860800 bytes (839 MB) copied, 7.74495 seconds, 108 MB/s – Kyle Hailey Jul 6 '11 at 17:14

A much simpler solution: (thanks to Adam Leventhal for this tidbit)

On Server

 share -F nfs -o rw /tmp

On client:

   mkdir /tmpnfs
   mount -o vers=4,rsize=32768,wsize=32768 server:/tmp  /tmpnfs

works like an in memory file system.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.