Sponsored Content
Full Discussion: Mount point bind issues
Top Forums UNIX for Beginners Questions & Answers Mount point bind issues Post 302994511 by drysdalk on Thursday 23rd of March 2017 04:05:26 PM
Old 03-23-2017
Hi,

Great, glad you got that sorted. One last thing that may disappoint, however. If you're doing this because you're hoping to basically add the free space of the /prod/OpenCSS filesystem to the existing /var/lib/pgsql filesystem...well, then you're out of luck.

That's not how bind mounts work, or what they're for. They're purely for providing an alternative path to access the same content in multiple places, and nothing else. The free space you'll see will be that of the original filesystem, since all the calls are being routed through to the original filesystem - the new one (in your scenario) isn't actually going to be used at all.

For example, watch what happens if I do a bind mount of my /boot filesystem to a new directory, /mnt/misc:

Code:
$ df -h /boot
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda1       240M  110M  114M  49% /boot
$ df -h /mnt/misc
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda2       225G  132G   82G  62% /
$ sudo /bin/mount --bind /boot /mnt/misc
$ df -h /boot
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda1       240M  110M  114M  49% /boot
$ df -h /mnt/misc
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda1       240M  110M  114M  49% /mnt/misc
$ sudo /bin/umount /mnt/misc
$ df -h /boot
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda1       240M  110M  114M  49% /boot
$ df -h /mnt/misc
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda2       225G  132G   82G  62% /
$

So as you can see, the disc space and all other properties of the bind mount destination are the same as the source, since in reality all you're doing is providing an additional path for accessing the source, and nothing more.

Hope this helps.
This User Gave Thanks to drysdalk For This Post:
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

mount point

hi people, I'm trying to create a mount point, but am having no sucess at all, with the following: mount -F ufs /dev/dsk/diskname /newdirectory but i keep getting - mount-point /newdirectory doesn't exist. What am i doing wrong/missing? Thanks Rc (1 Reply)
Discussion started by: colesy
1 Replies

2. UNIX for Dummies Questions & Answers

auto mount point

hi can i know what is the command to create auto mount point in my unix server? is there any directory which i have to go? (1 Reply)
Discussion started by: legato
1 Replies

3. UNIX for Advanced & Expert Users

mount point lists

is there any command to know the list of mount points in a server.i need only the mount point lists.i tried using df but it was not helpful.i am using Solaris (1 Reply)
Discussion started by: dr46014
1 Replies

4. AIX

Creating a new mount point

Hello, I have an AIX Oracle database server that I need to create a new filesystem/mount where I can create a new ORacle home to install 11g on. What are the needed steps to create this? There are mounts for Oracle 9i and 10g already. Thank you. - David (7 Replies)
Discussion started by: dkranes
7 Replies

5. Solaris

Mount Point Sorting?

Dear Gurus, Could it be possible to have the output of df -k sorted? The df -k output messed up after recent power trip. Also, is there any folders that I should look into to reduce the root size (other than /var/adm and /var/crash) after server crash? Many thanks in advance. ... (2 Replies)
Discussion started by: honmin
2 Replies

6. UNIX for Dummies Questions & Answers

mount --bind

I read it create hard link but I want to be sure, what does this command do exactly? Thank in advance. (1 Reply)
Discussion started by: programAngel
1 Replies

7. Red Hat

Linux Bind mount issues.

Hi All, we have an issue in bind mounting LINUX. we are able to see the bound mounts in mount command and df -h <file system name> but they are not visible in normal df -h command. all these mounts are local mounts. we have a /xyz is mount and abc is a directory in /xyz ( /xyz/abc ) ... (1 Reply)
Discussion started by: Naveen.6025
1 Replies

8. Emergency UNIX and Linux Support

Help with autos and mount bind

I have a sftp server running on Centos 5.10. It servers as upload/download interface for three users who basically are chrooted to three different locations. User A -- > /home/REGIONA/ User B -- > /home/REGIONB/ User C -- > /home/REGIONC/ The users run certain application procedures on... (4 Replies)
Discussion started by: maverick_here
4 Replies

9. UNIX for Beginners Questions & Answers

Can we have 2 mount point under the same name but at different directory?

guys i would like to know can we have 2 mount point which is same name but on different directory? (3 Replies)
Discussion started by: leecopper
3 Replies

10. UNIX for Beginners Questions & Answers

How to create a new mount point with 600GB and add 350 GBexisting mount point? IN AIX

How to create a new mount point with 600GB and add 350 GBexisting mount point Best if there step that i can follow or execute before i mount or add diskspace IN AIX Thanks (2 Replies)
Discussion started by: Thilagarajan
2 Replies
BIND(2) 							System Calls Manual							   BIND(2)

NAME
bind, mount, unmount - change name space SYNOPSIS
#include <u.h> #include <libc.h> int bind(char *name, char *old, int flag) int mount(int fd, char *old, int flag, char *aname) int unmount(char *name, char *old) DESCRIPTION
Bind and mount modify the file name space of the current process and other processes in its name space group (see fork(2)). For both calls, old is the name of an existing file or directory in the current name space where the modification is to be made. The name old is evaluated as described in intro(2), except that no translation of the final path element is done. For bind, name is the name of another (or possibly the same) existing file or directory in the current name space. After a successful bind call, the file name old is an alias for the object originally named by name; if the modification doesn't hide it, name will also still refer to its original file. The evaluation of new happens at the time of the bind, not when the binding is later used. The fd argument to mount is a file descriptor of an open network connection or pipe to a file server. The old file must be a directory. After a successful mount the file tree served (see below) by fd will be visible with its root directory having name old. The flag controls details of the modification made to the name space. In the following, new refers to the file as defined by name or the root directory served by fd. Either both old and new files must be directories, or both must not be directories. Flag can be one of: MREPL Replace the old file by the new one. Henceforth, an evaluation of old will be translated to the new file. If they are directories (for mount, this condition is true by definition), old becomes a union directory consisting of one directory (the new file). MBEFORE Both the old and new files must be directories. Add the constituent files of the new directory to the union directory at old so its contents appear first in the union. After an MBEFORE bind or mount, the new directory will be searched first when evaluating file names in the union directory. MAFTER Like MBEFORE but the new directory goes at the end of the union. The flags are defined in <libc.h>. In addition, there is an MCREATE flag that can be OR'd with any of the above. When a create system call (see open(2)) attempts to create in a union directory, and the file does not exist, the elements of the union are searched in order until one is found with MCREATE set. The file is created in that directory; if that attempt fails, the create fails. With mount, the file descriptor fd must be open for reading and writing and prepared to respond to 9P messages (see Section 5). After the mount, the file tree starting at old is served by a kernel mnt(3) device. That device will turn operations in the tree into messages on fd. Aname selects among different file trees on the server; the null string chooses the default tree. The file descriptor fd is automatically closed by a successful mount call. The effects of bind and mount can be undone by unmount. If name is zero, everything bound to or mounted upon old is unbound or unmounted. If name is not zero, it is evaluated as described above for bind, and the effect of binding or mounting that particular result on old is undone. SOURCE
/sys/src/libc/9syscall SEE ALSO
bind(1), intro(2), fcall(2), auth(2) (particularly amount), intro(5), mnt(3), srv(3) DIAGNOSTICS
The return value is a positive integer (a unique sequence number) for success, -1 for failure. These routines set errstr. BUGS
Mount will not return until it has successfully attached to the file server, so the process doing a mount cannot be the one serving. BIND(2)
All times are GMT -4. The time now is 11:28 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy