Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place! |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
04-12-2017, 09:26 PM
|
#1
|
Member
Registered: Nov 2015
Posts: 397
Rep: 
|
Using "none" in /etc/fstab
We can use "none" for mount point (2-nd) field when
we define swap mounting in /etc/stab.
Just wondering what use cases are applicable to
using "none" on the first field in /etc/fstab.
Typically, the first field is for devices, e.g. /dev/vdb1.
|
|
|
04-12-2017, 10:23 PM
|
#2
|
LQ Guru
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 20,016
|
The device won't mount because device "/dev/none" doesn't exist.
The first field must point to a device that the computer believes exists. If you want to mount that device to /etc/media/none, that's fine, in that /etc/media/none is a mountpoint, it's not a nothing (i. e., it's not a none, it's a thing that happens to be named "none"). You could also call it /etc/media/fred or /etc/media/ralph, for all fstab cares.
Last edited by frankbell; 04-12-2017 at 10:24 PM.
|
|
|
04-12-2017, 10:51 PM
|
#3
|
Member
Registered: Nov 2015
Posts: 397
Original Poster
Rep: 
|
Quote:
Originally Posted by frankbell
The device won't mount because device "/dev/none" doesn't exist.
The first field must point to a device that the computer believes exists. If you want to mount that device to /etc/media/none, that's fine, in that /etc/media/none is a mountpoint, it's not a nothing (i. e., it's not a none, it's a thing that happens to be named "none"). You could also call it /etc/media/fred or /etc/media/ralph, for all fstab cares.
|
Well, how do you explain "none" for swap mounting?
Swap does not mount to anything.
|
|
|
04-12-2017, 11:10 PM
|
#4
|
Moderator
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,386
|
Quote:
Originally Posted by fanoflq
Well, how do you explain "none" for swap mounting?
Swap does not mount to anything.
|
That is explained in man fstab...
Quote:
The first field (fs_spec).
This field describes the block special device or remote filesystem to be mounted.
For ordinary mounts it will hold (a link to) a block special device node (as created by mknod(8))
for the device to be mounted, like `/dev/cdrom' or `/dev/sdb7'. For NFS mounts one will have
<host>:<dir>, e.g., `knuth.aeb.nl:/'. For procfs, use `proc'.
Instead of giving the device explicitly, one may indicate the (ext2 or xfs) filesystem that is to
be mounted by its UUID or volume label (cf. e2label(8) or xfs_admin(8)), writing LABEL=<label>
or UUID=<uuid>, e.g., `LABEL=Boot' or `UUID=3e6be9de-8139-11d1-9106-a43f08d823a6'. This will
make the system more robust: adding or removing a SCSI disk changes the disk device name but not
the filesystem volume label.
Note that mount(8) uses UUIDs as strings. The string representation of the UUID should be based
on lower case characters.
The second field (fs_file).
This field describes the mount point for the filesystem. For swap partitions, this field should
be specified as `none'. If the name of the mount point contains spaces these can be escaped as
`\040'.
|
"none" in the second field is only applicable to swap devices, or if you create a mount point actually named none.
There are no normal use cases for none in the first field. "none" in the first field is not legal (unless of course you have an actual block device recognized by that name).
Last edited by astrogeek; 04-12-2017 at 11:16 PM.
Reason: comments, emphasis, quoting
|
|
|
04-13-2017, 09:11 AM
|
#5
|
Senior Member
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,828
|
Quote:
Originally Posted by astrogeek
There are no normal use cases for none in the first field. "none" in the first field is not legal (unless of course you have an actual block device recognized by that name).
|
It is legal for a tmpfs or a pseudo-filesystem like /proc that does not use a physical device. Using "none" in that first field is still not recommended because an error message reporting an issue with "none" or the output from the mount command saying "none on /proc ..." is just confusing.
|
|
1 members found this post helpful.
|
04-13-2017, 05:22 PM
|
#6
|
Senior Member
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,908
|
Some fstab documentation pages are out of date.
Mine has
Code:
The first field (fs_spec).
This field describes the block special device or remote filesystem to be mounted.
For ordinary mounts, it will hold (a link to) a block special device node (as created by mknod(8)) for the device to be mounted,
like `/dev/cdrom' or `/dev/sdb7'. For NFS mounts, this field is <host>:<dir>, e.g., `knuth.aeb.nl:/'. For filesystems with no
storage, any string can be used, and will show up in df(1) output, for example. Typical usage is `proc' for procfs; `mem',
`none', or `tmpfs' for tmpfs. Other special filesystems, like udev and sysfs, are typically not listed in fstab.
LABEL=<label> or UUID=<uuid> may be given instead of a device name. This is the recommended method, as device names are often a
coincidence of hardware detection order, and can change when other disks are added or removed. For example, `LABEL=Boot' or
`UUID=3e6be9de-8139-11d1-9106-a43f08d823a6'. (Use a filesystem-specific tool like e2label(8), xfs_admin(8), or fatlabel(8) to set
LABELs on filesystems).
It's also possible to use PARTUUID= and PARTLABEL=. These partitions identifiers are supported for example for GUID Partition Ta‐
ble (GPT).
See mount(8), blkid(8) or lsblk(8) for more details about device identifiers.
Note that mount(8) uses UUIDs as strings. The string representation of the UUID should be based on lower case characters.
Specifically "For filesystems with no storage, any string can be used". And even includes the use of the word "none".
Last edited by jpollard; 04-13-2017 at 05:25 PM.
|
|
1 members found this post helpful.
|
04-13-2017, 05:30 PM
|
#7
|
Member
Registered: Nov 2015
Posts: 397
Original Poster
Rep: 
|
Quote:
Originally Posted by jpollard
Some fstab documentation pages are out of date.
Mine has
Code:
The first field (fs_spec).
This field describes the block special device or remote filesystem to be mounted.
For ordinary mounts, it will hold (a link to) a block special device node (as created by mknod(8)) for the device to be mounted,
like `/dev/cdrom' or `/dev/sdb7'. For NFS mounts, this field is <host>:<dir>, e.g., `knuth.aeb.nl:/'.
For filesystems with no storage, any string can be used, and will show up in df(1) output, for example. Typical usage is `proc' for procfs; `mem',
`none', or `tmpfs' for tmpfs. Other special filesystems, like udev and sysfs, are typically not listed in fstab.
... ...
Specifically "For filesystems with no storage, any string can be used". And even includes the use of the word "none".
|
So a use case with none as first field in fstab is for tmpfs.
How do we use tmpfs?
Thank you.
|
|
|
04-14-2017, 12:59 AM
|
#8
|
LQ Addict
Registered: Dec 2013
Posts: 19,872
|
Quote:
Originally Posted by fanoflq
So a use case with none as first field in fstab is for tmpfs.
How do we use tmpfs?
Thank you.
|
https://duckduckgo.com/?q=how+to+use+tmpfs
you're welcome.
|
|
|
04-14-2017, 01:26 AM
|
#9
|
Member
Registered: Nov 2015
Posts: 397
Original Poster
Rep: 
|
Quote:
Originally Posted by ondoho
|
I see how tmpfs was mounted.
But how is it being used?
How to do processes use it or
make them aware of tmpfs so as to use it?
|
|
|
04-14-2017, 04:16 AM
|
#10
|
Senior Member
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,908
|
tmpfs is using main memory as a filesystem for temporary use.
it is also used for holding the management information for shared memory.
Some distributions (fedora for one) use it to hold user credentials, temporary/dynamic mounts for portable media (CD/DVD/memory/USB memory sticks).
Most of the time "aware of tmpfs so as to use it" is transparent. For other uses, that depends on the user.
GUI users with the usual file display will get an added entry for the mount - and again is transparent.
Otherwise, it is up to the administrator.
|
|
|
04-14-2017, 10:25 AM
|
#11
|
Senior Member
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,828
|
Quote:
Originally Posted by fanoflq
I see how tmpfs was mounted.
But how is it being used?
How to do processes use it or
make them aware of tmpfs so as to use it?
|
It's like any other mounted filesystem. It is mounted at some point in the system's directory hierarchy. Anything stored in that directory subtree is going into the tmpfs. Many systems have started using a tmpfs for /tmp, so any program that uses files in /tmp is using that tmpfs.
Code:
$ df /tmp
Filesystem 1K-blocks Used Available Use% Mounted on
tmpfs 2097152 1504 2095648 1% /tmp
^^^^^
|
|
1 members found this post helpful.
|
04-14-2017, 11:21 AM
|
#12
|
Member
Registered: Nov 2015
Posts: 397
Original Poster
Rep: 
|
Thank you all.
|
|
|
All times are GMT -5. The time now is 04:53 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|