* util-linux-v2.25:mountpoint misnamed or bugged, and "-d" bugged
@ 2017-04-16 1:08 L A Walsh
2017-05-10 9:47 ` Karel Zak
0 siblings, 1 reply; 3+ messages in thread
From: L A Walsh @ 2017-04-16 1:08 UTC (permalink / raw)
To: util-linux
mountpoint doesn't detect file, device
or other inode mount points.
Also, the "-d" switch doesn't show the maj:min of the mounted
inode. Of note: "-x" does show the maj:min of a remounted blockdev.
#reproduce (showing additional variant w/a char device)
cd /tmp
mkdir foo1
cd foo1
mkdir mnt
sudo mount tmpfs -t tmpfs mnt
touch mnt/file mnt_file mnt_null
sudo mknod mnt/null c 1 3
sudo mount --bind mnt/file mnt_file
sudo mount --bind mnt/null mnt_null
function is_mountedQ {
if /usr/bin/mountpoint -q $1; then
echo "$1 is a mount point"
else
echo "$1 is not a mount point"
fi
}
is_mountedQ mnt_file
is_mountedQ mnt_null
------------
Note, -x does show a remounted dev:
Ishtar:/tmp/foo1/mnt> sudo mknod sda b 8 0
Ishtar:/tmp/foo1> ll mnt/sda
brw-rw-r-- 1 8, 0 Apr 15 17:59 mnt/sda
Ishtar:/tmp/foo1> touch mnt_sda
Ishtar:/tmp/foo1> sudo mount --bind mnt/sda mnt_sda
Ishtar:/tmp/foo1> ll mnt_sda
brw-rw-r-- 1 8, 0 Apr 15 17:59 mnt_sda
Ishtar:/tmp/foo1> mountpoint -x mnt_sda
8:0
"mount |grep foo1" shows all the mount points:
Ishtar:/tmp/foo1> mount |grep foo1
tmpfs on /tmp/foo1/mnt type tmpfs (rw,relatime)
tmpfs on /tmp/foo1/mnt_file type tmpfs (rw,relatime)
tmpfs on /tmp/foo1/mnt_null type tmpfs (rw,relatime)
tmpfs on /tmp/foo1/mnt_sda type tmpfs (rw,relatime)
======
Side (or end) note:
Besides "mountpoint" handling mounted inodes, it **could**
be "more complete" by being enhanced to:
1) scan all names on its command line
2) scan all inodes in a directory
or
3) scan all inodes recursively, starting at a directory
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: util-linux-v2.25:mountpoint misnamed or bugged, and "-d" bugged
2017-04-16 1:08 util-linux-v2.25:mountpoint misnamed or bugged, and "-d" bugged L A Walsh
@ 2017-05-10 9:47 ` Karel Zak
2017-05-10 9:49 ` Karel Zak
0 siblings, 1 reply; 3+ messages in thread
From: Karel Zak @ 2017-05-10 9:47 UTC (permalink / raw)
To: L A Walsh; +Cc: util-linux
On Sat, Apr 15, 2017 at 06:08:17PM -0700, L A Walsh wrote:
>
> mountpoint doesn't detect file, device
> or other inode mount points.
>
> Also, the "-d" switch doesn't show the maj:min of the mounted
> inode. Of note: "-x" does show the maj:min of a remounted blockdev.
Version, distro, do you have classic mtab, etc, etc.... ?
> #reproduce (showing additional variant w/a char device)
>
> cd /tmp
> mkdir foo1
> cd foo1
> mkdir mnt
> sudo mount tmpfs -t tmpfs mnt
> touch mnt/file mnt_file mnt_null
> sudo mknod mnt/null c 1 3
> sudo mount --bind mnt/file mnt_file
> sudo mount --bind mnt/null mnt_null
> function is_mountedQ {
> if /usr/bin/mountpoint -q $1; then
> echo "$1 is a mount point"
> else
> echo "$1 is not a mount point"
> fi
> }
> is_mountedQ mnt_file
> is_mountedQ mnt_null
Works for me:
# cd /tmp
# mkdir foo1
# cd foo1
# mkdir mnt
# mount tmpfs -t tmpfs mnt
# touch mnt/file mnt_file mnt_null
# mknod mnt/null c 1 3
# mount --bind mnt/file mnt_file
# mount --bind mnt/null mnt_null
# mountpoint mnt_null
mnt_null is a mountpoint
# mountpoint mnt_file
mnt_file is a mountpoint
# findmnt --submounts /tmp
TARGET SOURCE FSTYPE OPTIONS
/tmp tmpfs tmpfs rw,nosuid,nodev
├─/tmp/foo1/mnt tmpfs tmpfs rw,relatime
├─/tmp/foo1/mnt_file tmpfs[/file] tmpfs rw,relatime
└─/tmp/foo1/mnt_null tmpfs[/null] tmpfs rw,relatime
Karel
--
Karel Zak <kzak@redhat.com>
http://karelzak.blogspot.com
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: util-linux-v2.25:mountpoint misnamed or bugged, and "-d" bugged
2017-05-10 9:47 ` Karel Zak
@ 2017-05-10 9:49 ` Karel Zak
0 siblings, 0 replies; 3+ messages in thread
From: Karel Zak @ 2017-05-10 9:49 UTC (permalink / raw)
To: L A Walsh; +Cc: util-linux
On Wed, May 10, 2017 at 11:47:46AM +0200, Karel Zak wrote:
> On Sat, Apr 15, 2017 at 06:08:17PM -0700, L A Walsh wrote:
> >
> > mountpoint doesn't detect file, device
> > or other inode mount points.
> >
> > Also, the "-d" switch doesn't show the maj:min of the mounted
> > inode. Of note: "-x" does show the maj:min of a remounted blockdev.
>
> Version, distro, do you have classic mtab, etc, etc.... ?
Ah, now I see v2.25 in the subject. Sorry. My test is with v2.28 and
current git tree.
Karel
--
Karel Zak <kzak@redhat.com>
http://karelzak.blogspot.com
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-05-10 9:49 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-16 1:08 util-linux-v2.25:mountpoint misnamed or bugged, and "-d" bugged L A Walsh
2017-05-10 9:47 ` Karel Zak
2017-05-10 9:49 ` Karel Zak
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.