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 01-13-2013, 04:36 AM   #1
raananh
LQ Newbie
 
Registered: Jan 2013
Posts: 2

Rep: Reputation: Disabled
How do I find the target directory (not the target fs) of a mount -bind


Hi,
Let's say someone entered the following command without my knowledge:
mount -o bind /CommonData/BindTarget /MyData/BindSource

I can see that /MyData/BindSource is a mount point by using "mount" or "df".

My questions:
1. Can I tell if /MyData/BindSource is a bind mount or a regular mount?
2. If yes, how can I find the bind target path? (in this example /CommonData/BindTarget)

All I managed to find using mount and df is the filesystem (or the device) that contains /CommonData/BindTarget (for example the fs that is mounted on /CommonData), but not the actual path sub directory inside it that is the bind target (e.g. /CommonData/BindTarget).

Its probably something very simple to find, but I've googled some and didn't find info.

Thanks,
raananh
 
Old 01-13-2013, 08:52 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Code:
grep bind /etc/mtab
# or nicer:
awk '/bind/ {print "source: "$1" bind target: "$2 }' /etc/mtab
# but it's basically the same nfo
 
1 members found this post helpful.
Old 01-13-2013, 09:18 AM   #3
raananh
LQ Newbie
 
Registered: Jan 2013
Posts: 2

Original Poster
Rep: Reputation: Disabled
Thanks a lot!
I don't have /etc/mtab on my linux (android phone) but I googled "mtab" thanks to you, and discovered I could find the bind info on my linux like that:
Code:
cat /proc/self/mountinfo
Then I can use text manipulation to isolate what I need.
Thanks,
raananh
 
  


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
[SOLVED] mv: target `filename' is not a directory dai_bach Programming 9 12-20-2012 07:58 AM
Making a symlink follow its target when the target moves pwabrahams Linux - Software 3 03-08-2011 07:04 PM
cp: target \r' is not a directory --- URGENT thanks dnaqvi Linux - General 5 04-23-2010 03:18 PM
Source Directory for Target Kernel halfpower Debian 1 05-22-2006 10:48 AM
samba + target directory robyso Linux - Networking 0 07-11-2003 05:07 AM

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

All times are GMT -5. The time now is 12:58 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