silent Turn on the silent flag.
Who can tell me more about
silent for mount ?
Or who can provide a specific code example to show this difference(
I simple tested no find any difference.
If a utility has a
quiet option, it usually means that the utility will operate without emitting any output.
Sometimes it additionally means that the utility will not output any diagnostic messages (warnings or errors). It may also (but seldom) mean that the utility will always exit with a zero exit status and therefore always act as if the operation that it performed succeeded.
In the case of
mount (on Debian at least), I'm assuming it means that
mount will not cause an error message or warning if you try to mount a filesystem with, e.g., the wrong filesystem type.
The documentation of the
-t option to
mount on Debian has the following information:
-toption is given, or if the
autotype is specified,
mountwill try to guess the desired type. [...] If
/etc/filesystemsends in a line with a single
/proc/filesystemsafterwards. While trying, all filesystem types will be mounted with the mount option
This is obviously a case where, if the
silent option was not applied automatically, there may be a lot of unwanted output.
Normally a failed kernel
mount() call will print diagnostic errors to the kernel message log that can provide more details about why it failed than just the error code returned. The
MS_SILENT mount option, which
mount passes to the kernel, suppresses such kernel log output. It is generally used by scripts that are trying various mount options to probe for any filesystem that can be mounted, where such log output is not likely to be helpful to the administrator.