Re: use shmfs

Robert Love (rml@tech9.net)
16 Dec 2001 00:31:25 -0500


On Sat, 2001-12-15 at 19:26, Hua Zhong wrote:

> Currently I'm using shmfs as a volatile storage. I am using Monta Vista's
> kernel (2.4.2). I added the following line in /etc/fstab:
>
> tmpfs /dev/shm shm defaults 0 0
> <snip>
> I cannot write to the filesystem. write returns EINVAL. I can create an
> empty file, however.

It is confusing: tmpfs is used both for abstracting POSIX shared memory
(shm) and for a page-cache-based dynamic RAM disk. The line above, that
you are adding, is for the shm support. You need to add another line to
create the tmpfs filesystem at a given mount point. Example:

tmpfs /var/cheese tmpfs defaults,size=4m 0 0

Would create a tmpfs at /var/cheese. The (optional) size parameter
specifies a maximum fs size of 4MB.

See Documentation/filesystems/tmpfs.txt for more information.

Robert Love

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/