LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Display Paticular Mount point (https://www.linuxquestions.org/questions/linux-newbie-8/display-paticular-mount-point-4175475141/)

pvsarat 08-29-2013 05:20 AM

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/*

druuna 08-29-2013 05:41 AM

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/.

pvsarat 08-29-2013 05:50 AM

Quote:

Originally Posted by druuna (Post 5018114)
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

druuna 08-29-2013 06:13 AM

Quote:

Originally Posted by pvsarat (Post 5018120)
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"

TenTenths 08-29-2013 06:49 AM

Quote:

Originally Posted by druuna (Post 5018133)
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.

druuna 08-29-2013 07:02 AM

Quote:

Originally Posted by TenTenths (Post 5018158)
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.

pvsarat 08-29-2013 07:15 AM

Quote:

Originally Posted by druuna (Post 5018168)
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

druuna 08-29-2013 07:21 AM

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.

pvsarat 08-29-2013 07:38 AM

Quote:

Originally Posted by druuna (Post 5018181)
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

druuna 08-29-2013 07:41 AM

You're welcome :)

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


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