Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I just went into /etc/fstab (Linux) and changed my line for /tmp (on which a specific ext4 partition was previously mounted) to tmpfs. This was clearly a bit silly, but I wasn't thinking. Anyway, I rebooted, and everything is working and all, but I'm confused about the following.

When issuing mount I see this:

/dev/sda8 on /tmp type tmpfs

Does this mean that /dev/sda8 is mounted as tmpfs? If there were any files in /tmp, I can't access them any more, but I can create files in there. When I reboot, mounting as ext4 I can see that there were in fact files on the partition (that weren't visible when tmpfs was mounted).

Is the device file meaningless in this context?

share|improve this question
add comment

1 Answer

Is the device file meaningless in this context?

Yes, I think so. I cannot find evidence in the Linux documentation for this, but Googling around did point me at this in the NetBSD documentation about mount_tmpfs to support my thought:

The tmpfs parameter only exists for compatibility with the other mount commands and is ignored.

So, I guess it doesn't matter what you use as 'source device' in mount commands or fstab configuration if it's the tmpfs type.

Experiments on my Ubuntu 12.04 box also support this with some funny behaviour in other applications:

# mkdir tmpfs
# mount -t tmpfs Brendan tmpfs/

# cat /proc/mounts 
[...]
Brendan /home/gert/tmpfs tmpfs rw,relatime 0 0

# df -h
Filesystem                        Size  Used Avail Use% Mounted 
[...]
Brendan                            12G     0   12G   0% /home/gert/tmpfs
share|improve this answer
add comment

Your Answer

 
discard

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.