Proxmox 3.0 - appearance of "bind" mounts

dlasher

Renowned Member
Mar 23, 2011
242
30
93
in pmx2.3 'bind' mounts (IE passthroughs for containers) didn't show up in the 'df'. Now, they do. makes DF kinda confusing.. any way to suppress them being listed, or am I doing this wrong?

IE:
Code:
/var/lib/vz/private/200     8388608      573428    7815180   7% /var/lib/vz/root/200
/dev/sda1               19535109584 17320853355 2214256229  89% /var/lib/vz/root/200/raid/windows
/dev/sda1               19535109584 17320853355 2214256229  89% /var/lib/vz/root/200/home
/dev/sda1               19535109584 17320853355 2214256229  89% /var/lib/vz/root/200/raid/temp
tmpfs                       4194304           0    4194304   0% /var/lib/vz/root/200/lib/init/rw
tmpfs                       4194304           0    4194304   0% /var/lib/vz/root/200/dev/shm



you get the idea.

Am I doing this wrong for proxmox3.0? I created /etc/vz/conf/xxx.mount like:

Code:
#!/bin/sh
mount -n --bind /raid/windows /var/lib/vz/root/200/raid/windows
mount -n --bind /raid/home /var/lib/vz/root/200/home
mount -n --bind /raid/temp /var/lib/vz/root/200/raid/temp
 
Hate to reply to my own post, but it looks like the "-n" or "--no-mtab" options are being ignored under Proxmox3 -- not sure why yet.
 
Hate to reply to my own post, but it looks like the "-n" or "--no-mtab" options are being ignored under Proxmox3 -- not sure why yet.

I guess /etc/mtab is no longer used the usual way. Instead it is now a symlink to /proc/mounts.
 
I guess /etc/mtab is no longer used the usual way. Instead it is now a symlink to /proc/mounts.

You're right, that's what I see:y

Code:
lrwxrwxrwx  1 root root        12 May 31 00:11 mtab -> /proc/mounts

On this machine I only have a dozen or so bind mounts.. I can't imagine how crowded it must be on virtual hosting platforms with hundreds of bind mounts....

This seems like a bug, since I can check older versions of debian, and they're using that same symlink, but mount -n works

Code:
ii  mount                            2.20.1-5.3                   amd64        Tools for mounting and manipulating filesystems
 
This seems like a bug, since I can check older versions of debian, and they're using that same symlink, but mount -n works

AFAIK /proc/mounts should be virtualized for containers, so containers only see what they mount. But I am quite sure 'mount -n' will not work.
 
AFAIK /proc/mounts should be virtualized for containers, so containers only see what they mount. But I am quite sure 'mount -n' will not work.


The problem is not what the containers see, but what debian sees underneath. Bind mounts don't show in DF or /etc/mtab in pmx2.3, but do in pmx3.0.
 
Debian just see what the container see (/proc/mounts)

I'm sorry, I feel like I'm either being unclear or talking in circles.

If you look at the man page for "mount" you'll see the following entry:

-n, --no-mtab
Mount without writing in /etc/mtab. This is necessary for example when /etc is on a read-only filesystem.


-n is not working in 3.0. It's writing to /etc/mtab or /proc/mounts

-n worked correctly in 2.3.

I'm doing research trying to figure out why, but it's broken.
 
If you look at the man page for "mount" you'll see the following entry:

-n, --no-mtab

Mount without writing in /etc/mtab. This is necessary for example when /etc is on a read-only filesystem.

-n is not working in 3.0. It's writing to /etc/mtab or /proc/mounts
-n worked correctly in 2.3.

The option '-n' was created exactly to disable writing anything to /etc/mtab. This means, that the utility does not open this file for writing and does not write there anything, if the option is specified.

/proc/mounts works different. It is a virtual file, where the kernel keeps information about mount points, known for the kernel. This is why you do not see any difference using different options with 'mount'.

I think, you can replace symbolic link /etc/mtab -> /proc/mounts with a normal file. Then "mount" should work as in 2.3 - it should write there what you expected. Of course, the file system with /etc/mtab should not be mounter as read only. As minimum, you can try it.

Best regards,
yarick123
 
Thanks for the replies.. it is something systemic to debian 7. I did a fresh db7 install into a VM, and checked the behavior of mount -n, and it works the same (the mounts show in the mtab) as proxmox3 is right now.

I'll try what you suggested in the VM, see if it breaks anything.

(Ironically, debian 6, which pmx2.3 is based on, also linked /etc/mtab to /proc/mounts, but mount -n worked there... still not sure why)
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!