Why is a second "tmpfs" parameter necessary when mounting a tmpfs?

12

3

Excerpted from the documentation

So 'mount -t tmpfs -o size=10G,nr_inodes=10k,mode=700 tmpfs /mytmpfs' will give you tmpfs instance on /mytmpfs which can allocate 10GB RAM/SWAP in 10240 inodes and it is only accessible by root.

Please note the command line:

mount -t tmpfs -o size=10G,nr_inodes=10k,mode=700 tmpfs /mytmpfs

What makes me confused is the second tmpfs. The manual page says nothing on the option tmpfs, what does it mean?

xmllmx

Posted 2014-12-02T09:08:50.427

Reputation: 403

Answers

23

It's not an option – it's the device name.

Remember that the syntax for mount(8) is:

mount [-t fstype] [-o options] device mountpoint

So even for filesystems that don't correspond to a specific device, you still need to give a dummy name, whether it's none or tmpfs or fluttershyfs.

user1686

Posted 2014-12-02T09:08:50.427

Reputation: 283 655

7I had to google 'fluttershy', and was not undisappointed. – mwfearnley – 2018-07-22T19:09:01.270

1Extra bonus for mentioning fluttershyfs. – Jürgen Weigert – 2019-01-23T17:42:04.133