You are not logged in.
Pages: 1
I have suddenly become confused as of the nature of tmpfs. What exactly should /etc/fstab contain;
none /dev/shm tmpfs defaults 0 0or
tmpfs /dev/shm tmpfs defaults 0 0and if one wants tmpfs to be mounted at /tmp; should an fstab line such as this be added as well?
tmpfs /tmp tmpfs defaults 0 0or should the device column rather state none, or perhaps /dev/shm?
Offline
it should contain
none /dev/shm tmpfs defaults 0 0and to be mounted:
tmpfs /tmp tmpfs defaults 0 0Offline
Thanks. That does make sense. Sometimes I really get confused about the most straightforward stuff...
Offline
The first line is because glibc 2.2 and above expects tmpfs to be mounted at /dev/shm for POSIX shared memory (shm_open, shm_unlink). the first line above takes care of that.
For the second line,
none /tmp tmpfs defaults 0 0should also work, as wel as
tmpfs /dev/shm tmpfs defaults 0 0for the first line
Offline
going to dig it out a bit further, should be at least a bit of a difference....post it when i find out
Offline
well, I can tell you that this page is what confused me to start with...
Offline
back again,
'none' for the filesystem means it is a filesystem generated by the system and is not saved to the disk. This part is used by glibc and above in /dev/shm. So to be able to use a temporary filesystem as a real space, it should be mounted using the tmpfs option, as done to the /tmp directory.
So as I stated in my first post, the lines should read:
none /dev/shm tmpfs defaults 0 0and
tmpfs /tmp tmpfs defaults 0 0Maybe now it makes more sense to you
Offline
Maybe now it makes more sense to you
It sure does
. Many thanks for the clarification!
Offline
Sorry to be reviving such an old post. But the only official guidelines I've
come across for this are from "man -s8 mount"...search for second occurrence of
"none":
Most devices are indicated by a file name (of a block special device),
like /dev/sda1, but there are other possibilities...[snip]The proc file system is not associated with a special device, and when mounting
it, an arbitrary keyword, such as proc can be used instead of a device
specification. (The customary choice none is less fortunate: the error message
`none busy' from umount can be confusing.)
This isn't about tmpfs specifically, but it suggests that you can use any
keyword you want for the filesystem options that don't use a specific device.
Thus "none" or "tmpfs" or "spam" in the first column would work just as well.
Can anyone with more knowledge confirm or deny? If not, I'll let this thread
return to the grave...
Last edited by Profjim (2009-06-14 19:23:37)
Offline
Pages: 1