You are not logged in.

#1 2005-09-16 10:30:49

nightfrost
Member
From: Sweden
Registered: 2005-04-16
Posts: 647

tmpfs questions

I have suddenly become confused as of the nature of tmpfs. What exactly should /etc/fstab contain;

none   /dev/shm       tmpfs           defaults         0 0

or

tmpfs   /dev/shm       tmpfs           defaults         0 0

and 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 0

or should the device column rather state none, or perhaps /dev/shm?

Offline

#2 2005-09-16 10:53:36

pressh
Developer/TU
From: Netherlands
Registered: 2005-08-14
Posts: 1,719

Re: tmpfs questions

it should contain

none /dev/shm tmpfs defaults 0 0

and to be mounted:

tmpfs /tmp tmpfs defaults 0 0

Offline

#3 2005-09-16 10:58:54

nightfrost
Member
From: Sweden
Registered: 2005-04-16
Posts: 647

Re: tmpfs questions

Thanks. That does make sense. Sometimes I really get confused about the most straightforward stuff...

Offline

#4 2005-09-16 11:13:53

pressh
Developer/TU
From: Netherlands
Registered: 2005-08-14
Posts: 1,719

Re: tmpfs questions

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 0

should also work, as wel as

tmpfs /dev/shm tmpfs defaults 0 0

for the first line

Offline

#5 2005-09-16 11:17:20

pressh
Developer/TU
From: Netherlands
Registered: 2005-08-14
Posts: 1,719

Re: tmpfs questions

going to dig it out a bit further, should be at least a bit of a difference....post it when i find out

Offline

#6 2005-09-16 11:44:19

nightfrost
Member
From: Sweden
Registered: 2005-04-16
Posts: 647

Re: tmpfs questions

well, I can tell you that this page is what confused me to start with...

Offline

#7 2005-09-16 11:56:49

pressh
Developer/TU
From: Netherlands
Registered: 2005-08-14
Posts: 1,719

Re: tmpfs questions

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 0

and

tmpfs /tmp tmpfs defaults 0 0

Maybe now it makes more sense to you

Offline

#8 2005-09-16 12:04:24

nightfrost
Member
From: Sweden
Registered: 2005-04-16
Posts: 647

Re: tmpfs questions

Maybe now it makes more sense to you

It sure does smile. Many thanks for the clarification!

Offline

#9 2009-06-14 19:18:22

Profjim
Member
From: NYC
Registered: 2008-03-24
Posts: 658

Re: tmpfs questions

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

Board footer

Powered by FluxBB