summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mount/mount.823
-rw-r--r--mount/mount.c26
2 files changed, 34 insertions, 15 deletions
diff --git a/mount/mount.8 b/mount/mount.8
index 524ed28cc..7487923d0 100644
--- a/mount/mount.8
+++ b/mount/mount.8
@@ -108,6 +108,11 @@ file hierarchy somewhere else. The call is
.br
.B "mount --bind olddir newdir"
.RE
+or shortoption
+.RS
+.br
+.B "mount -B olddir newdir"
+.RE
or fstab entry is:
.RS
.br
@@ -123,6 +128,11 @@ a second place using
.br
.B "mount --rbind olddir newdir"
.RE
+or shortoption
+.RS
+.br
+.B "mount -R olddir newdir"
+.RE
.\" available since Linux 2.4.11.
Note that the filesystem mount options will remain the same as those
@@ -135,6 +145,11 @@ to another place. The call is
.br
.B "mount --move olddir newdir"
.RE
+or shortoption
+.RS
+.br
+.B "mount -M olddir newdir"
+.RE
Since Linux 2.6.15 it is possible to mark a mount and its submounts as shared,
private, slave or unbindable. A shared mount provides ability to create mirrors
@@ -787,11 +802,15 @@ For more details see
.BR selinux (8)
.RE
.TP
-.B \-\-bind
+.B \-B, \-\-bind
Remount a subtree somewhere else (so that its contents are available
in both places). See above.
.TP
-.B \-\-move
+.B \-R, \-\-rbind
+Remount a subtree and all possible submounts somewhere else (so that its
+contents are available in both places). See above.
+.TP
+.B \-M, \-\-move
Move a subtree to some other place. See above.
.SH "FILESYSTEM SPECIFIC MOUNT OPTIONS"
diff --git a/mount/mount.c b/mount/mount.c
index 8bf6154c5..39a9bd858 100644
--- a/mount/mount.c
+++ b/mount/mount.c
@@ -1671,10 +1671,10 @@ static struct option longopts[] = {
{ "test-opts", 1, 0, 'O' },
{ "pass-fd", 1, 0, 'p' },
{ "types", 1, 0, 't' },
- { "bind", 0, 0, 128 },
- { "move", 0, 0, 133 },
+ { "bind", 0, 0, 'B' },
+ { "move", 0, 0, 'M' },
{ "guess-fstype", 1, 0, 134 },
- { "rbind", 0, 0, 135 },
+ { "rbind", 0, 0, 'R' },
{ "make-shared", 0, 0, 136 },
{ "make-slave", 0, 0, 137 },
{ "make-private", 0, 0, 138 },
@@ -1861,12 +1861,15 @@ main(int argc, char *argv[]) {
initproctitle(argc, argv);
#endif
- while ((c = getopt_long (argc, argv, "afFhilL:no:O:p:rsU:vVwt:",
+ while ((c = getopt_long (argc, argv, "aBfFhilL:Mno:O:p:rRsU:vVwt:",
longopts, NULL)) != -1) {
switch (c) {
case 'a': /* mount everything in fstab */
++mount_all;
break;
+ case 'B': /* bind */
+ mounttype = MS_BIND;
+ break;
case 'f': /* fake: don't actually call mount(2) */
++fake;
break;
@@ -1885,6 +1888,9 @@ main(int argc, char *argv[]) {
case 'L':
label = optarg;
break;
+ case 'M': /* move */
+ mounttype = MS_MOVE;
+ break;
case 'n': /* do not write /etc/mtab */
++nomtab;
break;
@@ -1901,6 +1907,9 @@ main(int argc, char *argv[]) {
readonly = 1;
readwrite = 0;
break;
+ case 'R': /* rbind */
+ mounttype = (MS_BIND | MS_REC);
+ break;
case 's': /* allow sloppy mount options */
sloppy = 1;
break;
@@ -1923,12 +1932,6 @@ main(int argc, char *argv[]) {
case 0:
break;
- case 128: /* bind */
- mounttype = MS_BIND;
- break;
- case 133: /* move */
- mounttype = MS_MOVE;
- break;
case 134:
/* undocumented, may go away again:
call: mount --guess-fstype device
@@ -1940,9 +1943,6 @@ main(int argc, char *argv[]) {
printf("%s\n", fstype ? fstype : "unknown");
exit(fstype ? 0 : EX_FAIL);
}
- case 135:
- mounttype = (MS_BIND | MS_REC);
- break;
case 136:
mounttype = MS_SHARED;