2009-09-10 13:58:49 +05:30
|
|
|
'\" -*- coding: UTF-8 -*-
|
|
|
|
.\" Copyright (C) 1998-2004 Miquel van Smoorenburg.
|
|
|
|
.\"
|
|
|
|
.\" This program is free software; you can redistribute it and/or modify
|
|
|
|
.\" it under the terms of the GNU General Public License as published by
|
|
|
|
.\" the Free Software Foundation; either version 2 of the License, or
|
|
|
|
.\" (at your option) any later version.
|
|
|
|
.\"
|
|
|
|
.\" This program is distributed in the hope that it will be useful,
|
|
|
|
.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
.\" GNU General Public License for more details.
|
|
|
|
.\"
|
|
|
|
.\" You should have received a copy of the GNU General Public License
|
|
|
|
.\" along with this program; if not, write to the Free Software
|
|
|
|
.\" Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
|
|
.\"
|
2021-12-28 01:44:42 +05:30
|
|
|
.TH MOUNTPOINT 1 "Mar 15, 2004" "sysvinit @VERSION@" "User Commands"
|
2009-09-10 13:58:49 +05:30
|
|
|
.SH NAME
|
|
|
|
mountpoint \- see if a directory is a mountpoint
|
|
|
|
.SH SYNOPSIS
|
2021-12-28 01:44:42 +05:30
|
|
|
.B mountpoint
|
2009-09-10 13:58:49 +05:30
|
|
|
.RB [ \-q ]
|
|
|
|
.RB [ \-d ]
|
|
|
|
.I /path/to/directory
|
|
|
|
.br
|
2021-12-28 01:44:42 +05:30
|
|
|
.B mountpoint
|
2019-03-04 03:02:28 +05:30
|
|
|
.B \-x
|
2009-09-10 13:58:49 +05:30
|
|
|
.I /dev/device
|
|
|
|
.SH DESCRIPTION
|
2021-12-28 01:44:42 +05:30
|
|
|
\fBmountpoint\fP checks if the directory is a mountpoint.
|
2009-09-10 13:58:49 +05:30
|
|
|
|
|
|
|
.SH OPTIONS
|
|
|
|
.IP \fB\-q\fP
|
|
|
|
Be quiet - don't print anything.
|
|
|
|
.IP \fB\-d\fP
|
|
|
|
Print major/minor device number of the filesystem on stdout.
|
2018-03-08 22:02:50 +05:30
|
|
|
.IP \fB\-p\fP
|
2021-12-28 01:44:42 +05:30
|
|
|
Check Linux's \fI/proc/mounts\fP file to try to detect circular mount points.
|
2009-09-10 13:58:49 +05:30
|
|
|
.IP \fB\-x\fP
|
|
|
|
Print major/minor device number of the blockdevice on stdout.
|
|
|
|
.SH EXIT STATUS
|
|
|
|
Zero if the directory is a mountpoint, non-zero if not.
|
|
|
|
.SH NOTES
|
|
|
|
Symbolic links are not followed, except when the \fB-x\fP option is
|
|
|
|
used. To force following symlinks, add a trailing slash to the
|
|
|
|
path of the directory.
|
|
|
|
.PP
|
2021-12-28 01:44:42 +05:30
|
|
|
The name of the command is misleading when the \fB-x\fP option is used,
|
2009-09-10 13:58:49 +05:30
|
|
|
but the option is useful for comparing if a directory and a device
|
|
|
|
match up, and there is no other command that can print the info easily.
|
|
|
|
.PP
|
2018-03-08 01:55:53 +05:30
|
|
|
The mountpoint command fails when a directory is binded to one of its grandparents.
|
|
|
|
For example, if /a/b/c/d is a mount point for /a/b then mountpoint will report
|
|
|
|
/a/b/c/d is not a valid mount point. This is because both the original directory and
|
|
|
|
its new mount point share the same inode and device number.
|
|
|
|
.PP
|
|
|
|
The circular mount problem can be worked around on Linux systems by using
|
2021-12-28 01:44:42 +05:30
|
|
|
the\fB-p\fP flag to check the \fI/proc/mounts\fP file for references to the circular mount bind.
|
|
|
|
When using the \fB-p\fP flag, make sure to specify the full path (ie \fI/home/user/mp\fP and
|
|
|
|
not just \fImp\fP). Also, \fBmountpoint\fP may still fail if there are spaces in
|
|
|
|
the mount point's path, even when using the \fB-p\fP flag because of the way
|
|
|
|
\fB/proc/mounts\fP mangles the spaces in the path name. Of course, if the
|
2018-03-08 01:55:53 +05:30
|
|
|
admin is using circular mount points with spaces in the name, there
|
|
|
|
are bigger concerns.
|
2009-09-10 13:58:49 +05:30
|
|
|
.SH AUTHOR
|
2021-12-28 01:44:42 +05:30
|
|
|
.MT miquels@\:cistron\:.nl
|
|
|
|
Miquel van Smoorenburg
|
|
|
|
.ME
|
2009-09-10 13:58:49 +05:30
|
|
|
.SH "SEE ALSO"
|
|
|
|
.BR stat (1)
|