0

This question already has an answer here:

I created an alpine container with limited user.
When I run mount it shows me the following mounted list:

/home $ mount
overlay on / type overlay (rw,relatime,lowerdir=/var/lib/docker/overlay2/l/KCJQAGEW3UGOWIQ7UW5GDGWTOX:/var/lib/docker/overlay2/l/3JHGYTRTJDTUB7XAC2O3KY5H5V:/var/lib/docker/overlay2/l/CKRPXHOCDWFPZKZXBYX7MPUCA5:/var/lib/docker/overlay2/l/CFGI4PXVRIJRHPKXWK43PE4DZV:/var/lib/docker/overlay2/l/ZZFYGGBCUSMZ7IYP7WI6MWZFQN:/var/lib/docker/overlay2/l/33RI7BKMPTVKCWIELOGMUJ4J4N:/var/lib/docker/overlay2/l/5UVFPCW3G5AI4AV5FJPS26LBOA:/var/lib/docker/overlay2/l/AJ43E4MYURSH2SELF7GBM5V2N5:/var/lib/docker/overlay2/l/FX3YMXLJ5YQAWHGVLIEREQP6JM:/var/lib/docker/overlay2/l/I5OK5J522A4AMEDRJT4IS7C5FT:/var/lib/docker/overlay2/l/6C2J4DBBK4GUNQDQ4GO2WL7VTL:/var/lib/docker/overlay2/l/XTPDACLCJEZPLVH4I52PDC4XAL:/var/lib/docker/overlay2/l/DEHT4RSODLVYYQ65X7FNDTWUC7:/var/lib/docker/overlay2/l/J2ITJDS3MK3ZMTJKHLKAPTFZRY,upperdir=/var/lib/docker/overlay2/b8d14eb619c6fff58c9940cd78f4696975b157dffd5f6f6a6de00bca6d776c62/diff,workdir=/var/lib/docker/overlay2/b8d14eb619c6fff58c9940cd78f4696975b157dffd5f6f6a6de00bca6d776c62/work)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
tmpfs on /dev type tmpfs (rw,nosuid,size=65536k,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=666)
sysfs on /sys type sysfs (ro,nosuid,nodev,noexec,relatime)
tmpfs on /sys/fs/cgroup type tmpfs (ro,nosuid,nodev,noexec,relatime,mode=755)
cgroup on /sys/fs/cgroup/systemd type cgroup (ro,nosuid,nodev,noexec,relatime,xattr,release_agent=/lib/systemd/systemd-cgroups-agent,name=systemd)
cgroup on /sys/fs/cgroup/net_cls,net_prio type cgroup (ro,nosuid,nodev,noexec,relatime,net_cls,net_prio)
cgroup on /sys/fs/cgroup/freezer type cgroup (ro,nosuid,nodev,noexec,relatime,freezer)
cgroup on /sys/fs/cgroup/memory type cgroup (ro,nosuid,nodev,noexec,relatime,memory)
cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup (ro,nosuid,nodev,noexec,relatime,cpu,cpuacct)
cgroup on /sys/fs/cgroup/pids type cgroup (ro,nosuid,nodev,noexec,relatime,pids)
cgroup on /sys/fs/cgroup/blkio type cgroup (ro,nosuid,nodev,noexec,relatime,blkio)
cgroup on /sys/fs/cgroup/perf_event type cgroup (ro,nosuid,nodev,noexec,relatime,perf_event)
cgroup on /sys/fs/cgroup/hugetlb type cgroup (ro,nosuid,nodev,noexec,relatime,hugetlb)
cgroup on /sys/fs/cgroup/devices type cgroup (ro,nosuid,nodev,noexec,relatime,devices)
cgroup on /sys/fs/cgroup/cpuset type cgroup (ro,nosuid,nodev,noexec,relatime,cpuset)
mqueue on /dev/mqueue type mqueue (rw,nosuid,nodev,noexec,relatime)
/dev/xvda1 on /etc/resolv.conf type ext4 (rw,relatime,discard,data=ordered)
/dev/xvda1 on /etc/hostname type ext4 (rw,relatime,discard,data=ordered)
/dev/xvda1 on /etc/hosts type ext4 (rw,relatime,discard,data=ordered)
shm on /dev/shm type tmpfs (rw,nosuid,nodev,noexec,relatime,size=65536k)  

When I run cat /etc/mtab or /proc/mounts it shows me a much larger list then :

/home $ cat /etc/mtab
overlay / overlay rw,relatime,lowerdir=/var/lib/docker/overlay2/l/KCJQAGEW3UGOWIQ7UW5GDGWTOX:/var/lib/docker/overlay2/l/3JHGYTRTJDTUB7XAC2O3KY5H5V:/var/lib/docker/overlay2/l/CKRPXHOCDWFPZKZXBYX7MPUCA5:/var/lib/docker/overlay2/l/CFGI4PXVRIJRHPKXWK43PE4DZV:/var/lib/docker/overlay2/l/ZZFYGGBCUSMZ7IYP7WI6MWZFQN:/var/lib/docker/overlay2/l/33RI7BKMPTVKCWIELOGMUJ4J4N:/var/lib/docker/overlay2/l/5UVFPCW3G5AI4AV5FJPS26LBOA:/var/lib/docker/overlay2/l/AJ43E4MYURSH2SELF7GBM5V2N5:/var/lib/docker/overlay2/l/FX3YMXLJ5YQAWHGVLIEREQP6JM:/var/lib/docker/overlay2/l/I5OK5J522A4AMEDRJT4IS7C5FT:/var/lib/docker/overlay2/l/6C2J4DBBK4GUNQDQ4GO2WL7VTL:/var/lib/docker/overlay2/l/XTPDACLCJEZPLVH4I52PDC4XAL:/var/lib/docker/overlay2/l/DEHT4RSODLVYYQ65X7FNDTWUC7:/var/lib/docker/overlay2/l/J2ITJDS3MK3ZMTJKHLKAPTFZRY,upperdir=/var/lib/docker/overlay2/b8d14eb619c6fff58c9940cd78f4696975b157dffd5f6f6a6de00bca6d776c62/diff,workdir=/var/lib/docker/overlay2/b8d14eb619c6fff58c9940cd78f4696975b157dffd5f6f6a6de00bca6d776c62/work 0 0
proc /proc proc rw,nosuid,nodev,noexec,relatime 0 0
tmpfs /dev tmpfs rw,nosuid,size=65536k,mode=755 0 0
devpts /dev/pts devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=666 0 0
sysfs /sys sysfs ro,nosuid,nodev,noexec,relatime 0 0
tmpfs /sys/fs/cgroup tmpfs ro,nosuid,nodev,noexec,relatime,mode=755 0 0
cgroup /sys/fs/cgroup/systemd cgroup ro,nosuid,nodev,noexec,relatime,xattr,release_agent=/lib/systemd/systemd-cgroups-agent,name=systemd 0 0
cgroup /sys/fs/cgroup/net_cls,net_prio cgroup ro,nosuid,nodev,noexec,relatime,net_cls,net_prio 0 0
cgroup /sys/fs/cgroup/freezer cgroup ro,nosuid,nodev,noexec,relatime,freezer 0 0
cgroup /sys/fs/cgroup/memory cgroup ro,nosuid,nodev,noexec,relatime,memory 0 0
cgroup /sys/fs/cgroup/cpu,cpuacct cgroup ro,nosuid,nodev,noexec,relatime,cpu,cpuacct 0 0
cgroup /sys/fs/cgroup/pids cgroup ro,nosuid,nodev,noexec,relatime,pids 0 0
cgroup /sys/fs/cgroup/blkio cgroup ro,nosuid,nodev,noexec,relatime,blkio 0 0
cgroup /sys/fs/cgroup/perf_event cgroup ro,nosuid,nodev,noexec,relatime,perf_event 0 0
cgroup /sys/fs/cgroup/hugetlb cgroup ro,nosuid,nodev,noexec,relatime,hugetlb 0 0
cgroup /sys/fs/cgroup/devices cgroup ro,nosuid,nodev,noexec,relatime,devices 0 0
cgroup /sys/fs/cgroup/cpuset cgroup ro,nosuid,nodev,noexec,relatime,cpuset 0 0
mqueue /dev/mqueue mqueue rw,nosuid,nodev,noexec,relatime 0 0
/dev/xvda1 /etc/resolv.conf ext4 rw,relatime,discard,data=ordered 0 0
/dev/xvda1 /etc/hostname ext4 rw,relatime,discard,data=ordered 0 0
/dev/xvda1 /etc/hosts ext4 rw,relatime,discard,data=ordered 0 0
shm /dev/shm tmpfs rw,nosuid,nodev,noexec,relatime,size=65536k 0 0
overlay /run/docker.sock overlay rw,relatime,lowerdir=/var/lib/docker/overlay2/l/S3PCHQ53SAJYG5NZDNDQRU2XVE:/var/lib/docker/overlay2/l/62KIXQKVJBTRJ7SDUUYXZTSKCG:/var/lib/docker/overlay2/l/3725JLZLCOWYHRBEQP2J2QTNLA:/var/lib/docker/overlay2/l/VAGTKGBRCRYURRHYPLOMX6OOYS:/var/lib/docker/overlay2/l/KR6OCZTSJSXVHCKE5OVUQZRXKL:/var/lib/docker/overlay2/l/7BYHCEWKEAEE6EE5RZZ4SLDNQP:/var/lib/docker/overlay2/l/QSHWL6OBX4IRECFZEUTNTL4NC5:/var/lib/docker/overlay2/l/IEZLIF47GKVK3LXEDKTMQ3TZVG:/var/lib/docker/overlay2/l/BQ46TLLYUESHFVNKIBWHBWRSDP:/var/lib/docker/overlay2/l/IJYHXGW2NISOJTGYBST4HO2FW5:/var/lib/docker/overlay2/l/S7YI2SX46AKDOR4Y6V5N374AG4:/var/lib/docker/overlay2/l/TKTKBRROVY2AZ3SA446NJ4DC3Y:/var/lib/docker/overlay2/l/LMUO357ONLFEBEMMBMIVSYCQFO:/var/lib/docker/overlay2/l/P6VC5SYL5PJ55NABY7EKZGWUYY:/var/lib/docker/overlay2/l/I7ECJ5P5HFIPF2EUGIDQHRYELU:/var/lib/docker/overlay2/l/AUMVWZNGS3S4XNKDP4MUOD4ISJ:/var/lib/docker/overlay2/l/FDDSOXSMTMH4XZV6Q3ADNAA2VW:/var/lib/docker/overlay2/l/VAPXZHHJKAFCCIBF3RZNECEC7S:/var/lib/docker/overlay2/l/PK3TV6ZJUQYZUWA4TYZ4LQXQOT:/var/lib/docker/overlay2/l/YODPLRFWRSGNFVZ6SCQ3FVYRNS:/var/lib/docker/overlay2/l/6VCZPIJSKSLUW7ZR2OMS4OSYXW:/var/lib/docker/overlay2/l/ELLZBUAIOMXSHNCQZCGGKZYODO:/var/lib/docker/overlay2/l/HBC6DIHTS4YUQWK54KBSC6H5LM:/var/lib/docker/overlay2/l/3KKP5YZSANTIPPGCUEECHNZ52T:/var/lib/docker/overlay2/l/67BTI5QHRSVQMPSTYUHT4DMMK5:/var/lib/docker/overlay2/l/XLK6527B67ITIEEJLWCKV3YBPG,upperdir=/var/lib/docker/overlay2/d486d915eb64f61ea0d87f1fdef0ad6d092a70ec30e043c5843486131dfacf26/diff,workdir=/var/lib/docker/overlay2/d486d915eb64f61ea0d87f1fdef0ad6d092a70ec30e043c5843486131dfacf26/work 0 0
devpts /dev/console devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=666 0 0
proc /proc/bus proc ro,relatime 0 0
proc /proc/fs proc ro,relatime 0 0
proc /proc/irq proc ro,relatime 0 0
proc /proc/sys proc ro,relatime 0 0
proc /proc/sysrq-trigger proc ro,relatime 0 0
tmpfs /proc/acpi tmpfs ro,relatime 0 0
tmpfs /proc/kcore tmpfs rw,nosuid,size=65536k,mode=755 0 0
tmpfs /proc/keys tmpfs rw,nosuid,size=65536k,mode=755 0 0
tmpfs /proc/timer_list tmpfs rw,nosuid,size=65536k,mode=755 0 0
tmpfs /proc/timer_stats tmpfs rw,nosuid,size=65536k,mode=755 0 0
tmpfs /proc/sched_debug tmpfs rw,nosuid,size=65536k,mode=755 0 0
tmpfs /proc/scsi tmpfs ro,relatime 0 0
tmpfs /sys/firmware tmpfs ro,relatime 0 0  

Why mount doesn't show me the full list of mounted files ?

marked as duplicate by Wouter Verhelst, X Tian, msp9011, Rui F Ribeiro, Kiwy May 20 at 11:50

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • findmnt may be a better option; the output is certainly easier to read. – Seamus May 13 at 17:50
  • maybe mount list all related devices to current chroot, while /proc/mounts reflects all – alecxs May 15 at 23:52
  • @alecxs "maybe /proc/mounts reflects all" -- or maybe not. The purported dupe doesn't explain the difference. I cannot make off-the-cuff any sense of the devpts /dev/console mount (at least on my machine, bind mounts are not listed in /proc/mounts) – mosvy May 18 at 18:44
0

The Question is not accurate. According to man page it is expected behavior that mount does not reflect /proc/mounts.

It is possible that the files /etc/mtab and /proc/mounts don't match on systems with a regular mtab file. The first file is based only on the mount command options, but the content of the second file also depends on the kernel and others settings (e.g. on a remote NFS server -- in certain cases the mount command may report unreliable information about an NFS mount point and the /proc/mounts file usually contains more reliable information.) This is another reason to replace the mtab file with a symlink to the /proc/mounts file.

Regarding /etc/mtab i can partially answer the question. It is a table maintained from mount, or a symlink to /proc/mounts. In the first case, a discrepancy can occur if you explicit instruct mount not to write a entry (for example).

In the second case, if /etc/mtab is symlinked to /proc/mounts, i have no explanation why mount can not read all entries

Not the answer you're looking for? Browse other questions tagged or ask your own question.