LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-12-2016, 07:56 AM   #1
SpiTon
LQ Newbie
 
Registered: Apr 2016
Posts: 2

Rep: Reputation: Disabled
mount bind problem


On CentOS release 6.7, there's file system problem.
Aftert reboot /home is set under /home (/home/home) like followings.

# ls -l /home
total 48
-rw------- 1 root root 7168 Nov 15 19:10 aquota.group
-rw------- 1 root root 7168 Jan 25 11:09 aquota.user
drwxr-x--- 2 root root 4096 Jan 18 21:55 backups
drwxr-xr-x 4 root root 4096 Jan 1 11:59 home
drwxr-xr-x 8 root root 4096 Apr 5 01:10 log
drwx------ 2 root root 16384 Nov 15 18:58 lost+found
drwxr-xr-x 6 mysql mysql 4096 Dec 13 22:34 mysql


# df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/mapper/VolGroup-lv_root
12778200 2946824 9175608 25% /
tmpfs 961176 0 961176 0% /dev/shm
/dev/vda1 487652 205564 256488 45% /boot
/dev/vdb 41153856 549492 38507212 2% /mnt/extradiskA
/dev/vdb 41153856 549492 38507212 2% /home

I have set on fstab /home with 'mount bind' but it seems like bind is not effective.

/etc/fstab is following.

# cat /etc/fstab

#
# /etc/fstab
# Created by anaconda on Mon Jul 28 08:21:01 2014
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
/dev/mapper/VolGroup-lv_root / ext4 defaults,usrquota,grpquota 1 1
UUID=9a855356-ee00-4ae7-a185-226566ce1dba /boot ext4 defaults 1 2
UUID=093c9b95-8336-4682-9927-132dbdf2f082 /mnt/extradiskA ext4 defaults,usrquota,grpquota 1 2
/dev/mapper/VolGroup-lv_swap swap swap defaults 0 0
tmpfs /dev/shm tmpfs defaults 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
/mnt/extradiskA/home /home none bind 0 0
/mnt/extradiskA/log /var/log none bind 0 0
/mnt/extradiskA/mysql /var/lib/mysql none bind 0 0
/mnt/extradiskA/.backup /.backup none bind 0 0
/mnt/extradiskA/.daily_backup /.daily_backup none bind 0 0
/mnt/extradiskA/backups /var/backups none bind 0 0
 
Old 04-12-2016, 08:25 AM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
It appears to be doing what you asked. The /home shows the same details in df as /mnt/extradiskA because the bind mount is simply remounting the SAME device in a different location accordingly you'll see the SAME device and usage in df.

/dev/vdb 41153856 549492 38507212 2% /mnt/extradiskA
/dev/vdb 41153856 549492 38507212 2% /home

If you do ls -l /mnt/extradiskA do you see a subdirectory called home there?

If you do ls -l /mnt/extradiskA/home and ls -l /home do you see the same files in both? If so the bind mount worked.

The bind mount while it does make the mount restricted to the subdirectory you specified (/mnt/extradiskA/home in your case) it does NOT limit the size to that subdirectory - the size is based on the underlying mount just as if you ran "df -hP /mnt/extradiskA/home" would show you the underlying mount, /mnt/extradiskA.
 
Old 04-12-2016, 08:28 PM   #3
SpiTon
LQ Newbie
 
Registered: Apr 2016
Posts: 2

Original Poster
Rep: Reputation: Disabled
The problem is not mounted.
'/mnt/extradiskA/home /home none bind 0 0' on fstab is not recognized correctly.
It is interpreted not bind type.
So df shows '/dev/vdb 41153856 549492 38507212 2% /home'
Do you know how to fix?
 
Old 04-13-2016, 07:26 AM   #4
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
Quote:
Originally Posted by SpiTon View Post
df shows '/dev/vdb 41153856 549492 38507212 2% /home'
It IS mounted if df shows that.

You appear to be thinking it will show the device as /mnt/extradiskA/home but as I noted in my previous answer it actually will show the real device which is /dev/vdb.

I suspect what you're seeing about the bind type is occurring because you're trying mount /home again even though it is already mounted.

What happens if you:
a) umount /home
b) df /home
c) mount /home (with no other options on command line)
d) df /home (again)

Be sure to provide full output rather than summarizing so we can see the exact errors if any.

Last edited by MensaWater; 04-13-2016 at 07:48 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Need help with a mount --bind problem ... sandygws Linux - General 8 09-19-2013 12:10 PM
Vsftp ntfs --bind mount problem ¿F M J¿ Linux - Newbie 1 08-29-2008 12:26 AM
Mount --bind & NFS problem BerlinBadger Linux - Networking 2 12-02-2005 12:25 PM
mount --bind (fstab problem) renski Linux - General 2 11-17-2005 03:50 PM
Multiple mount --bind's to 1 mount point ? Etraman Slackware 6 12-23-2004 07:18 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:24 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration