]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man2/mount.2
mount.2: Explicitly note that MS_DIRSYNC setting cannot be changed on remount
[thirdparty/man-pages.git] / man2 / mount.2
1 .\" Copyright (C) 1993 Rickard E. Faith <faith@cs.unc.edu>
2 .\" and Copyright (C) 1994 Andries E. Brouwer <aeb@cwi.nl>
3 .\" and Copyright (C) 2002, 2005, 2016 Michael Kerrisk <mtk.manpages@gmail.com>
4 .\"
5 .\" %%%LICENSE_START(VERBATIM)
6 .\" Permission is granted to make and distribute verbatim copies of this
7 .\" manual provided the copyright notice and this permission notice are
8 .\" preserved on all copies.
9 .\"
10 .\" Permission is granted to copy and distribute modified versions of this
11 .\" manual under the conditions for verbatim copying, provided that the
12 .\" entire resulting derived work is distributed under the terms of a
13 .\" permission notice identical to this one.
14 .\"
15 .\" Since the Linux kernel and libraries are constantly changing, this
16 .\" manual page may be incorrect or out-of-date. The author(s) assume no
17 .\" responsibility for errors or omissions, or for damages resulting from
18 .\" the use of the information contained herein. The author(s) may not
19 .\" have taken the same level of care in the production of this manual,
20 .\" which is licensed free of charge, as they might when working
21 .\" professionally.
22 .\"
23 .\" Formatted or processed versions of this manual, if unaccompanied by
24 .\" the source, must acknowledge the copyright and authors of this work.
25 .\" %%%LICENSE_END
26 .\"
27 .\" Modified 1996-11-04 by Eric S. Raymond <esr@thyrsus.com>
28 .\" Modified 2001-10-13 by Michael Kerrisk <mtk.manpages@gmail.com>
29 .\" Added note on historical behavior of MS_NOSUID
30 .\" Modified 2002-05-16 by Michael Kerrisk <mtk.manpages@gmail.com>
31 .\" Extensive changes and additions
32 .\" Modified 2002-05-27 by aeb
33 .\" Modified 2002-06-11 by Michael Kerrisk <mtk.manpages@gmail.com>
34 .\" Enhanced descriptions of MS_MOVE, MS_BIND, and MS_REMOUNT
35 .\" Modified 2004-06-17 by Michael Kerrisk <mtk.manpages@gmail.com>
36 .\" 2005-05-18, mtk, Added MNT_EXPIRE, plus a few other tidy-ups.
37 .\" 2008-10-06, mtk: move umount*() material into separate umount.2 page.
38 .\" 2008-10-06, mtk: Add discussion of namespaces.
39 .\"
40 .TH MOUNT 2 2016-03-15 "Linux" "Linux Programmer's Manual"
41 .SH NAME
42 mount \- mount filesystem
43 .SH SYNOPSIS
44 .nf
45 .B "#include <sys/mount.h>"
46 .sp
47 .BI "int mount(const char *" source ", const char *" target ,
48 .BI " const char *" filesystemtype ", unsigned long " mountflags ,
49 .BI " const void *" data );
50 .fi
51 .SH DESCRIPTION
52 .BR mount ()
53 attaches the filesystem specified by
54 .I source
55 (which is often a pathname referring to a device,
56 but can also be the pathname of a directory or file,
57 or a dummy string) to the location (a directory or file)
58 specified by the pathname in
59 .IR target .
60
61 Appropriate privilege (Linux: the
62 .B CAP_SYS_ADMIN
63 capability) is required to mount filesystems.
64
65 Values for the
66 .I filesystemtype
67 argument supported by the kernel are listed in
68 .I /proc/filesystems
69 (e.g., "btrfs", "ext4", "jfs", "xfs", "vfat", "fuse",
70 "tmpfs", "cgroup", "proc", "mqueue", "nfs", "cifs", "iso9660").
71 Further types may become available when the appropriate modules
72 are loaded.
73
74 The
75 .I data
76 argument is interpreted by the different filesystems.
77 Typically it is a string of comma-separated options
78 understood by this filesystem.
79 See
80 .BR mount (8)
81 for details of the options available for each filesystem type.
82
83 A call to
84 .BR mount ()
85 performs one of a number of general types of operation.
86 depending on the bits specified in
87 .IR mountflags .
88 The choice of operation is determined by testing the bits set in
89 .IR mountflags ,
90 with the tests being conducted in the order listed here:
91 .IP * 3
92 Remount an existing mount:
93 .IR mountflags
94 includes
95 .BR MS_REMOUNT .
96 .IP *
97 Create a bind mount:
98 .IR mountflags
99 includes
100 .BR MS_BIND .
101 .IP *
102 Change the propagation type of an existing mount:
103 .IR mountflags
104 includes one of
105 .BR MS_SHARED ,
106 .BR MS_PRIVATE ,
107 .BR MS_SLAVE ,
108 or
109 .BR MS_UNBINDABLE .
110 .IP *
111 Move an existing mount to a new location:
112 .IR mountflags
113 includes
114 .BR MS_MOVE .
115 .IP *
116 Create a new mount:
117 .IR mountflags
118 includes none of the above flags.
119 .PP
120 Each of these operations is detailed later in this page.
121 Further flags may be specified in
122 .IR mountflags
123 to modify the behavior of
124 .BR mount (),
125 as described below.
126 .\"
127 .SS Additional mount flags
128 The list below describes the additional flags that can be specified in
129 .IR mountflags .
130 Note that some operation types ignore some or all of these flags,
131 as described later in this page.
132 .\"
133 .\" FIXME 2.6.25 Added MS_I_VERSION, which needs to be documented.
134 .\"
135 .TP
136 .BR MS_DIRSYNC " (since Linux 2.5.19)"
137 Make directory changes on this filesystem synchronous.
138 (This property can be obtained for individual directories
139 or subtrees using
140 .BR chattr (1).)
141 .TP
142 .BR MS_LAZYTIME " (since Linux 4.0)"
143 .\" commit 0ae45f63d4ef8d8eeec49c7d8b44a1775fff13e8
144 .\" commit fe032c422c5ba562ba9c2d316f55e258e03259c6
145 .\" commit a26f49926da938f47561f386be56a83dd37a496d
146 Reduce on-disk updates of inode timestamps (atime, mtime, ctime)
147 by maintaining these changes only in memory.
148 The on-disk timestamps are updated only when:
149 .RS
150 .IP (a) 5
151 the inode needs to be updated for some change unrelated to file timestamps;
152 .IP (b)
153 the application employs
154 .BR fsync (2),
155 .BR syncfs (2),
156 or
157 .BR sync (2);
158 .IP (c)
159 an undeleted inode is evicted from memory; or
160 .IP (d)
161 more than 24 hours have passed since the inode was written to disk.
162 .RE
163 .IP
164 This mount option significantly reduces writes
165 needed to update the inode's timestamps, especially mtime and atime.
166 However, in the event of a system crash, the atime and mtime fields
167 on disk might be out of date by up to 24 hours.
168
169 Examples of workloads where this option could be of significant benefit
170 include frequent random writes to preallocated files,
171 as well as cases where the
172 .B MS_STRICTATIME
173 mount option is also enabled.
174 (The advantage of combining
175 .BR MS_STRICTATIME
176 and
177 .BR MS_LAZYTIME
178 is that
179 .BR stat (2)
180 will return the correctly updated atime, but the atime updates
181 will be flushed to disk only in the cases listed above.)
182 .TP
183 .B MS_MANDLOCK
184 Permit mandatory locking on files in this filesystem.
185 (Mandatory locking must still be enabled on a per-file basis,
186 as described in
187 .BR fcntl (2).)
188 Since Linux 4.5,
189 .\" commit 95ace75414f312f9a7b93d873f386987b92a5301
190 this mount option requires the
191 .B CAP_SYS_ADMIN
192 capability.
193 .\" FIXME Describe the MS_MOVE flag in more detail
194 .TP
195 .B MS_NOATIME
196 Do not update access times for (all types of) files on this filesystem.
197 .TP
198 .B MS_NODEV
199 Do not allow access to devices (special files) on this filesystem.
200 .TP
201 .B MS_NODIRATIME
202 Do not update access times for directories on this filesystem.
203 This flag provides a subset of the functionality provided by
204 .BR MS_NOATIME ;
205 that is,
206 .BR MS_NOATIME
207 implies
208 .BR MS_NODIRATIME .
209 .TP
210 .B MS_NOEXEC
211 Do not allow programs to be executed from this filesystem.
212 .\" (Possibly useful for a filesystem that contains non-Linux executables.
213 .\" Often used as a security feature, e.g., to make sure that restricted
214 .\" users cannot execute files uploaded using ftp or so.)
215 .TP
216 .B MS_NOSUID
217 Do not honor set-user-ID and set-group-ID bits or file capabilities
218 when executing programs from this filesystem.
219 .\" (This is a security feature to prevent users executing set-user-ID and
220 .\" set-group-ID programs from removable disk devices.)
221 .TP
222 .B MS_RDONLY
223 Mount filesystem read-only.
224 .TP
225 .BR MS_REC " (since Linux 2.4.11)"
226 Used in conjunction with
227 .BR MS_BIND
228 to create a recursive bind mount,
229 and in conjunction with the propagation type flags to recursively change
230 the propagation type of all of the mounts in a subtree.
231 See below for further details.
232 .TP
233 .BR MS_RELATIME " (since Linux 2.6.20)"
234 When a file on this filesystem is accessed,
235 update the file's last access time (atime) only if the current value
236 of atime is less than or equal to the file's last modification time (mtime)
237 or last status change time (ctime).
238 This option is useful for programs, such as
239 .BR mutt (1),
240 that need to know when a file has been read since it was last modified.
241 Since Linux 2.6.30, the kernel defaults to the behavior provided
242 by this flag (unless
243 .BR MS_NOATIME
244 was specified), and the
245 .B MS_STRICTATIME
246 flag is required to obtain traditional semantics.
247 In addition, since Linux 2.6.30,
248 the file's last access time is always updated if it
249 is more than 1 day old.
250 .\" Matthew Garrett notes in the patch that added this behavior
251 .\" that this lets utilities such as tmpreaper (which deletes
252 .\" files based on last access time) work correctly.
253 .TP
254 .BR MS_SILENT " (since Linux 2.6.17)"
255 Suppress the display of certain
256 .RI ( printk ())
257 warning messages in the kernel log.
258 This flag supersedes the misnamed and obsolete
259 .BR MS_VERBOSE
260 flag (available since Linux 2.4.12), which has the same meaning.
261 .TP
262 .BR MS_STRICTATIME " (since Linux 2.6.30)"
263 Always update the last access time (atime) when files on this
264 filesystem are accessed.
265 (This was the default behavior before Linux 2.6.30.)
266 Specifying this flag overrides the effect of setting the
267 .BR MS_NOATIME
268 and
269 .BR MS_RELATIME
270 flags.
271 .TP
272 .B MS_SYNCHRONOUS
273 Make writes on this filesystem synchronous (as though
274 the
275 .B O_SYNC
276 flag to
277 .BR open (2)
278 was specified for all file opens to this filesystem).
279 .PP
280 From Linux 2.4 onward, the
281 .BR MS_NODEV ", " MS_NOEXEC ", and " MS_NOSUID
282 flags are settable on a per-mount-point basis.
283 From kernel 2.6.16 onward,
284 .B MS_NOATIME
285 and
286 .B MS_NODIRATIME
287 are also settable on a per-mount-point basis.
288 The
289 .B MS_RELATIME
290 flag is also settable on a per-mount-point basis.
291 .\"
292 .SS Remounting an existing mount
293 An existing mount may be remounted by specifying
294 .B MS_REMOUNT
295 in
296 .IR mountflags .
297 This allows you to change the
298 .I mountflags
299 and
300 .I data
301 of an existing mount without having to unmount and remount the filesystem.
302 .I target
303 should be the same value specified in the initial
304 .BR mount ()
305 call.
306
307 The
308 .I source
309 and
310 .I filesystemtype
311 arguments are ignored.
312
313 The
314 .I mountflags
315 and
316 .I data
317 arguments should match the values used in the original
318 .BR mount ()
319 call, except for those parameters that are being deliberately changed.
320
321 The following
322 .I mountflags
323 can be changed:
324 .BR MS_MANDLOCK ,
325 .BR MS_NOATIME ,
326 .BR MS_NODEV ,
327 .BR MS_NODIRATIME ,
328 .BR MS_NOEXEC ,
329 .BR MS_NOSUID ,
330 .BR MS_RDONLY ,
331 and
332 .BR MS_SYNCHRONOUS .
333 Attempts to change the setting of the
334 .\" See the definition of MS_RMT_MASK in include/uapi/linux/fs.h
335 .BR MS_DIRSYNC
336 flag during a remount are silently ignored.
337
338 Since Linux 3.17,
339 .\" commit ffbc6f0ead47fa5a1dc9642b0331cb75c20a640e
340 if none of
341 .BR MS_NOATIME ,
342 .BR MS_NODIRATIME ,
343 .BR MS_RELATIME ,
344 or
345 .BR MS_STRICTATIME
346 is specified in
347 .IR mountflags ,
348 then the remount operation preserves the existing values of these flags
349 (rather than defaulting to
350 .BR MS_RELATIME ).
351
352 Since Linux 2.6.26, this flag can also be used to make
353 .\" See https://lwn.net/Articles/281157/
354 an existing bind mount read-only by specifying
355 .IR mountflags
356 as:
357
358 MS_REMOUNT | MS_BIND | MS_RDONLY
359
360 Note that only the
361 .BR MS_RDONLY
362 setting of the bind mount can be changed in this manner.
363 .\"
364 .SS Creating a bind mount
365 If
366 .I mountflags
367 includes
368 .BR MS_BIND
369 (available since Linux 2.4),
370 .\" since 2.4.0-test9
371 then perform a bind mount.
372 A bind mount makes a file or a directory subtree visible at
373 another point within the single directory hierarchy.
374 Bind mounts may cross filesystem boundaries and span
375 .BR chroot (2)
376 jails.
377
378 The
379 .IR filesystemtype
380 and
381 .IR data
382 arguments are ignored.
383
384 The remaining bits in the
385 .I mountflags
386 argument are also ignored, with the exception of
387 .BR MS_REC .
388 (The bind mount has the same mount options as
389 the underlying mount point.)
390 However, see the discussion of remounting above,
391 for a method of making an existing bind mount read-only.
392
393 By default, when a directory is bind mounted,
394 only that directory is mounted;
395 if there are any submounts under the directory tree,
396 they are not bind mounted.
397 If the
398 .BR MS_REC
399 flag is also specified, then a recursive bind mount operation is performed:
400 all submounts under the
401 .I source
402 subtree (other than unbindable mounts)
403 are also bind mounted at the corresponding location in the
404 .I target
405 subtree.
406 .\"
407 .SS Changing the propagation type of an existing mount
408 If
409 .IR mountflags
410 includes one of
411 .BR MS_SHARED ,
412 .BR MS_PRIVATE ,
413 .BR MS_SLAVE ,
414 or
415 .BR MS_UNBINDABLE
416 (all available since Linux 2.6.15),
417 then the propagation type of an existing mount is changed.
418 If more than one of these flags is specified, an error results.
419
420 The only flags that can be used with changing the propagation type are
421 .BR MS_REC
422 and
423 .BR MS_SILENT .
424
425 The
426 .IR source ,
427 .IR filesystemtype ,
428 and
429 .IR data
430 arguments are ignored.
431
432 The meanings of the propagation type flags are as follows:
433 .TP
434 .BR MS_SHARED
435 Make this mount point shared.
436 Mount and unmount events immediately under this mount point will propagate
437 to the other mount points that are members of this mount's peer group.
438 Propagation here means that the same mount or unmount will automatically
439 occur under all of the other mount points in the peer group.
440 Conversely, mount and unmount events that take place under
441 peer mount points will propagate to this mount point.
442 .TP
443 .BR MS_PRIVATE
444 Make this mount point private.
445 Mount and unmount events do not propagate into or out of this mount point.
446 This is the default propagation type for newly created mount points.
447 .TP
448 .BR MS_SLAVE
449 If this is a shared mount point that is a member of a peer group
450 that contains other members, convert it to a slave mount.
451 If this is a shared mount point that is a member of a peer group
452 that contains no other members, convert it to a private mount.
453 Otherwise, the propagation type of the mount point is left unchanged.
454
455 When a mount point is a slave,
456 mount and unmount events propagate into this mount point from
457 the (master) shared peer group of which it was formerly a member.
458 Mount and unmount events under this mount point do not propagate to any peer.
459
460 A mount point can be the slave of another peer group
461 while at the same time sharing mount and unmount events
462 with a peer group of which it is a member.
463 .TP
464 .BR MS_UNBINDABLE
465 Make this mount unbindable.
466 This is like a private mount,
467 and in addition this mount can't be bind mounted.
468 When a recursive bind mount
469 .RB ( mount (2)
470 with the
471 .BR MS_BIND
472 and
473 .BR MS_REC
474 flags) is performed on a directory subtree,
475 any bind mounts within the subtree are automatically pruned
476 (i.e., not replicated)
477 when replicating that subtree to produce the target subtree.
478 .PP
479 By default, changing the propagation type affects only the
480 .I target
481 mount point.
482 If the
483 .B MS_REC
484 flag is also specified in
485 .IR mountflags ,
486 then the propagation type of all mount points under
487 .IR target
488 is also changed.
489 .\"
490 .SS Moving a mount
491 If
492 .I mountflags
493 contains the flag
494 .BR MS_MOVE
495 (available since Linux 2.4.18),
496 then move a subtree:
497 .I source
498 specifies an existing mount point and
499 .I target
500 specifies the new location to which that mount point is to be relocated.
501 The move is atomic: at no point is the subtree unmounted.
502
503 The remaining bits in the
504 .IR mountflags
505 argument are ignored, as are the
506 .IR filesystemtype
507 and
508 .IR data
509 arguments.
510 .\"
511 .SS Creating a new mount point
512 If none of
513 .BR MS_REMOUNT ,
514 .BR MS_BIND ,
515 .BR MS_MOVE ,
516 .BR MS_SHARED ,
517 .BR MS_PRIVATE ,
518 .BR MS_SLAVE ,
519 or
520 .BR MS_UNBINDABLE
521 is specified in
522 .IR mountflags ,
523 then
524 .BR mount ()
525 performs its default action: creating a new mount point.
526 .IR source
527 specifies the source for the new mount point, and
528 .IR target
529 specifies the directory at which to create the mount point.
530
531 The
532 .I filesystemtype
533 and
534 .I data
535 arguments are employed, and further bits may be specified in
536 .IR mountflags
537 to modify the behavior of the call.
538 .\"
539 .SH RETURN VALUE
540 On success, zero is returned.
541 On error, \-1 is returned, and
542 .I errno
543 is set appropriately.
544 .SH ERRORS
545 The error values given below result from filesystem type independent
546 errors.
547 Each filesystem type may have its own special errors and its
548 own special behavior.
549 See the Linux kernel source code for details.
550 .TP
551 .B EACCES
552 A component of a path was not searchable.
553 (See also
554 .BR path_resolution (7).)
555 .TP
556 .B EACCES
557 Mounting a read-only filesystem was attempted without giving the
558 .B MS_RDONLY
559 flag.
560 .TP
561 .B EACCES
562 The block device
563 .I source
564 is located on a filesystem mounted with the
565 .B MS_NODEV
566 option.
567 .\" mtk: Probably: write permission is required for MS_BIND, with
568 .\" the error EPERM if not present; CAP_DAC_OVERRIDE is required.
569 .TP
570 .B EBUSY
571 .I source
572 is already mounted.
573 .TP
574 .B EBUSY
575 .I source
576 cannot be remounted read-only,
577 because it still holds files open for writing.
578 .TP
579 .B EBUSY
580 .I source
581 cannot be mounted on
582 .I target
583 because
584 .I target
585 is still busy (it is the working directory of some thread,
586 the mount point of another device, has open files, etc.).
587 .TP
588 .B EFAULT
589 One of the pointer arguments points outside the user address space.
590 .TP
591 .B EINVAL
592 .I source
593 had an invalid superblock.
594 .TP
595 .B EINVAL
596 A remount operation
597 .RB ( MS_REMOUNT )
598 was attempted, but
599 .I source
600 was not already mounted on
601 .IR target .
602 .TP
603 .B EINVAL
604 A move operation
605 .RB ( MS_MOVE )
606 was attempted, but
607 .I source
608 was not a mount point, or was \(aq/\(aq.
609 .TP
610 .B EINVAL
611 .I mountflags
612 includes more than one of
613 .BR MS_SHARED ,
614 .BR MS_PRIVATE ,
615 .BR MS_SLAVE ,
616 or
617 .BR MS_UNBINDABLE .
618 .TP
619 .B EINVAL
620 .I mountflags
621 includes
622 .BR MS_SHARED ,
623 .BR MS_PRIVATE ,
624 .BR MS_SLAVE ,
625 or
626 .BR MS_UNBINDABLE
627 and also includes a flag other than
628 .BR MS_REC
629 or
630 .BR MS_SILENT .
631 .TP
632 .BR EINVAL
633 An attempt was made to bind mount an unbindable mount.
634 .TP
635 .B ELOOP
636 Too many links encountered during pathname resolution.
637 .TP
638 .B ELOOP
639 A move operation was attempted, and
640 .I target
641 is a descendant of
642 .IR source .
643 .TP
644 .B EMFILE
645 (In case no block device is required:)
646 Table of dummy devices is full.
647 .TP
648 .B ENAMETOOLONG
649 A pathname was longer than
650 .BR MAXPATHLEN .
651 .TP
652 .B ENODEV
653 .I filesystemtype
654 not configured in the kernel.
655 .TP
656 .B ENOENT
657 A pathname was empty or had a nonexistent component.
658 .TP
659 .B ENOMEM
660 The kernel could not allocate a free page to copy filenames or data into.
661 .TP
662 .B ENOTBLK
663 .I source
664 is not a block device (and a device was required).
665 .TP
666 .B ENOTDIR
667 .IR target ,
668 or a prefix of
669 .IR source ,
670 is not a directory.
671 .TP
672 .B ENXIO
673 The major number of the block device
674 .I source
675 is out of range.
676 .TP
677 .B EPERM
678 The caller does not have the required privileges.
679 .SH VERSIONS
680 The definitions of
681 .BR MS_DIRSYNC ,
682 .BR MS_MOVE ,
683 .BR MS_PRIVATE ,
684 .BR MS_REC ,
685 .BR MS_RELATIME ,
686 .BR MS_SHARED ,
687 .BR MS_SLAVED ,
688 .BR MS_STRICTATIME
689 and
690 .BR MS_UNBINDABLE
691 were added to glibc headers in version 2.12.
692 .\"
693 .SH CONFORMING TO
694 This function is Linux-specific and should not be used in
695 programs intended to be portable.
696 .SH NOTES
697 Since Linux 2.4 a single filesystem can be mounted at
698 multiple mount points, and multiple mounts can be stacked
699 on the same mount point.
700 .\" Multiple mounts on same mount point: since 2.3.99pre7.
701
702 The
703 .I mountflags
704 argument may have the magic number 0xC0ED (\fBMS_MGC_VAL\fP)
705 in the top 16 bits.
706 (All of the other flags discussed in DESCRIPTION
707 occupy the low order 16 bits of
708 .IR mountflags .)
709 Specifying
710 .BR MS_MGC_VAL
711 was required in kernel versions prior to 2.4,
712 but since Linux 2.4 is no longer required and is ignored if specified.
713
714 The original
715 .B MS_SYNC
716 flag was renamed
717 .B MS_SYNCHRONOUS
718 in 1.1.69
719 when a different
720 .B MS_SYNC
721 was added to \fI<mman.h>\fP.
722 .LP
723 Before Linux 2.4 an attempt to execute a set-user-ID or set-group-ID program
724 on a filesystem mounted with
725 .B MS_NOSUID
726 would fail with
727 .BR EPERM .
728 Since Linux 2.4 the set-user-ID and set-group-ID bits are
729 just silently ignored in this case.
730 .\" The change is in patch-2.4.0-prerelease.
731 .\"
732
733 .SS Per-process namespaces
734 Starting with kernel 2.4.19, Linux provides
735 per-process mount namespaces.
736 A mount namespace is the set of filesystem mounts that
737 are visible to a process.
738 Mount-point namespaces can be (and usually are)
739 shared between multiple processes,
740 and changes to the namespace (i.e., mounts and unmounts) by one process
741 are visible to all other processes sharing the same namespace.
742 (The pre-2.4.19 Linux situation can be considered as one in which
743 a single namespace was shared by every process on the system.)
744
745 A child process created by
746 .BR fork (2)
747 shares its parent's mount namespace;
748 the mount namespace is preserved across an
749 .BR execve (2).
750
751 A process can obtain a private mount namespace if:
752 it was created using the
753 .BR clone (2)
754 .BR CLONE_NEWNS
755 flag,
756 in which case its new namespace is initialized to be a
757 .I copy
758 of the namespace of the process that called
759 .BR clone (2);
760 or it calls
761 .BR unshare (2)
762 with the
763 .BR CLONE_NEWNS
764 flag,
765 which causes the caller's mount namespace to obtain a private copy
766 of the namespace that it was previously sharing with other processes,
767 so that future mounts and unmounts by the caller are invisible
768 to other processes (except child processes that the caller
769 subsequently creates) and vice versa.
770
771 The Linux-specific
772 .I /proc/PID/mounts
773 file exposes the list of mount points in the mount
774 namespace of the process with the specified ID; see
775 .BR proc (5)
776 for details.
777 .SH SEE ALSO
778 .BR umount (2),
779 .BR namespaces (7),
780 .BR path_resolution (7),
781 .BR lsblk (8),
782 .BR findmnt (8),
783 .BR mount (8),
784 .BR umount (8)