Timeline for List only bind mounts
Current License: CC BY-SA 3.0
12 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Mar 23, 2016 at 23:12 | comment | added | Melab | You say that binds mounts are parameters of a "mount operation", but I don't see how that would prevent the kernel from maintaining any record of a particular mount being a bind mount. In fact, it must retain some record of it or store some flag that indicates a particular mount is a bind mount in order for it to know to connect a certain directory to another as if it were a traditional mount. | |
| Nov 19, 2013 at 22:56 | comment | added | l0b0 | @aculich You should post findmnt as an answer. It only works if the target directory is not another mount point, by the way. Try for example sudo mount --bind / foo && findmnt | grep foo | |
| Oct 23, 2013 at 15:34 | history | edited | Gilles 'SO- stop being evil' | CC BY-SA 3.0 | mention the possibility of /etc/mtab being a symlink to /proc/mounts |
| Oct 23, 2013 at 15:16 | comment | added | orb | Incidentaly, '[,(]bind[,)]' is also the monster who ate your shield in the original Legend of Zelda. | |
| Mar 6, 2012 at 21:47 | comment | added | Gilles 'SO- stop being evil' | @aculich I see the same results on mount from util-linux 2.20.1 on Debian testing. Kernel 2.6.32 in both cases, I don't think it matters for the /etc/mtab content but I'm not sure. | |
| Mar 6, 2012 at 21:44 | comment | added | aculich | @Gilles I deleted my errant comment to remove confusion. You're right, it is indeed POSIX-compliant. Also now I understand the reason we are seeing different behavior of mount and /etc/mtab. You are using Debian stable which has the older version of util-linux-ng; I am using Debian testing which has a newer version that no longer seems to have the same /etc/mtab behavior, which is maybe why @rozcietrzewiacz did not see bind in in /etc/mtab if his distribution is also using a newer version? | |
| Mar 6, 2012 at 21:10 | comment | added | Gilles 'SO- stop being evil' | @aculich </etc/mtab awk … is POSIX-compliant (I forget whether it's supported in Bourne). Please check your facts. I can confirm that /etc/mtab has the bind option for a filesystem mounted with mount --bind /source /target on Debian stable (mount from util-linux-ng 2.17.2). | |
| Mar 6, 2012 at 18:16 | comment | added | aculich | @Gilles What mount --version are you using that records any bind information in /etc/mtab? I am using version 2.20.1 and I looked at the latest sources and in neither case do I see bind information recorded anywhere that would allow you to grep for bind. On the other hand, what I suggested in my answer does in fact list bind mounts created with --bind as well as using the bind option. | |
| Mar 6, 2012 at 16:39 | comment | added | aculich | @Gilles Actually, you can do this simply using findmnt | fgrep [ as explained here. | |
| Sep 2, 2011 at 13:20 | vote | accept | l0b0 | ||
| Aug 4, 2011 at 21:15 | history | edited | Gilles 'SO- stop being evil' | CC BY-SA 3.0 | mention that the subtree is visible in /proc/$pid/mountinfo |
| Aug 4, 2011 at 16:45 | history | answered | Gilles 'SO- stop being evil' | CC BY-SA 3.0 |