LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
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 08-29-2013, 06:20 AM   #1
pvsarat
LQ Newbie
 
Registered: Aug 2013
Posts: 4

Rep: Reputation: Disabled
Display Paticular Mount point


Hi All,

I am new to Linux enviornment.

Can you please share the command to list a paticular mount
Example:

Suppose if we want to display files of Sarat - We will do like below
ls -ltr Sara*
In the same can we display mount points like this?
df /ias/*
 
Old 08-29-2013, 06:41 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387
Running df on its own shows all the mount points.

If /ias is a mount point then you can run df /ias to show only the ias mount point information.

If you want to know which mount point a directory/file belongs to you can do the following: df /path/to/file_directory

Do not use the * (df /ias/*), this will expand to all files and/or dirs in /ias/.
 
Old 08-29-2013, 06:50 AM   #3
pvsarat
LQ Newbie
 
Registered: Aug 2013
Posts: 4

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by druuna View Post
Running df on its own shows all the mount points.

If /ias is a mount point then you can run df /ias to show only the ias mount point information.

If you want to know which mount point a directory/file belongs to you can do the following: df /path/to/file_directory

Do not use the * (df /ias/*), this will expand to all files and/or dirs in /ias/.
Thank you for the reply

Sorry I didn't frame my question properly here - I just want to list mount point which starts with /ias/*

The output should come like below - Is there any command to query like below

/ias/a006/oradata/M503
/ias/a013/oradata/M500
/ias/a007/oradata/M501
 
Old 08-29-2013, 07:13 AM   #4
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387
Quote:
Originally Posted by pvsarat View Post
Sorry I didn't frame my question properly here - I just want to list mount point which starts with /ias/*

The output should come like below - Is there any command to query like below

/ias/a006/oradata/M503
/ias/a013/oradata/M500
/ias/a007/oradata/M501
Are you sure that you are using the correct terminology?

A mount point is a single directory which is used to mount a partition. Asking for a list of mount points that start with /ias doesn't make sense.

If there are any mount points inside /ias you can do the following: mount | grep "ias"
 
Old 08-29-2013, 07:49 AM   #5
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 2,166

Rep: Reputation: 751Reputation: 751Reputation: 751Reputation: 751Reputation: 751Reputation: 751Reputation: 751
Quote:
Originally Posted by druuna View Post
A mount point is a single directory which is used to mount a partition. Asking for a list of mount points that start with /ias doesn't make sense.
Makes perfect sense. The fact that a mount point is a single directory doesn't mean it can't exist within an other directory.
 
Old 08-29-2013, 08:02 AM   #6
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387
Quote:
Originally Posted by TenTenths View Post
The fact that a mount point is a single directory doesn't mean it can't exist within an other directory.
This is 100% true.

I'm not saying that you cannot have mount points (deep) inside a directory structure, I myself have mount points inside another mount point.

I am however not sure if the question asked by the OP makes sense. Can we assume that M503, M500 and M501 are mount points? Are there other directories at the same location (say M300 and M199) which aren't mount points?

Anyway: mount | grep "ias" will show all mount points that have /ias in their name/path.
 
1 members found this post helpful.
Old 08-29-2013, 08:15 AM   #7
pvsarat
LQ Newbie
 
Registered: Aug 2013
Posts: 4

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by druuna View Post
This is 100% true.

I'm not saying that you cannot have mount points (deep) inside a directory structure, I myself have mount points inside another mount point.

I am however not sure if the question asked by the OP makes sense. Can we assume that M503, M500 and M501 are mount points? Are there other directories at the same location (say M300 and M199) which aren't mount points?

Anyway: mount | grep "ias" will show all mount points that have /ias in their name/path.
When i give df -h in my server it is displaying like this
X341-/XXXX/w001/export_541: df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/ias--vg18-091_001
68G 180M 65G 1% /ias/a006/oradata/M503
/dev/mapper/ias--vg18-091_002
194G 188M 184G 1% /ias/a013/oradata/M500
/dev/mapper/ias--vg18-091_003
194G 188M 184G 1% /ias/a007/oradata/M501
/dev/mapper/ESP_VG3-419_01
116G 63G 48G 57% /ESP/u200/oradata
/dev/mapper/ESP_VG5-419_01
3.9G 3.1G 622M 84% /ESP/u001/oradata
/dev/mapper/ESP_VG5-419_02
12G 8.1G 3.0G 74% /ESP/u003/oradata
/dev/mapper/ESP_VG5-419_03
12G 8.1G 3.0G 74% /ESP/u004/oradata
/dev/mapper/ESP_VG5-419_04
77G 71G 2.8G 97% /ESP/u005/oradata
/dev/mapper/ESP_VG5-419_05
97G 53G 39G 58% /ESP/u006/oradata
/dev/mapper/ESP_VG5-419_06
9.7G 151M 9.0G 2% /ESP/u007/oradata
/dev/mapper/ESP_VG5-419_07

But i want to disply only the /ias mount point - Is there any command to list only /ias mount points like the below
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/ias--vg18-091_001
68G 180M 65G 1% /ias/a006/oradata/M503
/dev/mapper/ias--vg18-091_002
194G 188M 184G 1% /ias/a013/oradata/M500
/dev/mapper/ias--vg18-091_003
194G 188M 184G 1% /ias/a007/oradata/M501
 
Old 08-29-2013, 08:21 AM   #8
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387
It seems that the M<number> entries are the only ones that reside in /ias.

Give this a try:
Code:
df -Ph | grep "ias"
I used an extra flag for df (the P flag), this to make sure the output is on one line and not on two.
 
1 members found this post helpful.
Old 08-29-2013, 08:38 AM   #9
pvsarat
LQ Newbie
 
Registered: Aug 2013
Posts: 4

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by druuna View Post
It seems that the M<number> entries are the only ones that reside in /ias.

Give this a try:
Code:
df -Ph | grep "ias"
I used an extra flag for df (the P flag), this to make sure the output is on one line and not on two.
Thank you - I got what i want
 
Old 08-29-2013, 08:41 AM   #10
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387
You're welcome

BTW: can you put up the [SOLVED] tag (in the upper right corner or the Thread Tools menu).
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Shell script to display Read Only (ro) mount point in Linux monty_0309 Linux - Newbie 5 01-14-2012 11:25 AM
command to display the device-fs-uuid-mount point htamayo Linux - Newbie 2 10-26-2010 03:44 PM
puppy+grub saves ram installed mount point as HD install mount point agualust Linux - Newbie 0 04-10-2009 12:23 PM
mount NFS to mount point then share out the mount point ionic_slim Linux - Networking 2 04-20-2008 01:17 PM


All times are GMT -5. The time now is 10:27 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration