Operating System - HP-UX
1753830 Members
9219 Online
108806 Solutions
New Discussion юеВ

Re: checking mount point directory

 
SOLVED
Go to solution
James R. Ferguson
Acclaimed Contributor

Re: checking mount point directory

Hi Patrice:

EXCELLENNT POINT!...and I run MC/ServiceGuard too!!!...

One of the things I've done in my cluster's fstab files is to place the pound (#) mark over the device special file name (field-1). This reminds me of the mount point although 'mount' complains mildly during bootup.

With my regards and my thanks for your corrections, Jim. :-))

...JRF...
Carlos Fernandez Riera
Honored Contributor

Re: checking mount point directory

Gooooood .... Discussion.

Maybe you know why i prefer mount command!!

I did not think in S/G neither.

Note my grep contain caret "^" This is begin of line and space " " as separator.

Fine, Patrice.


unsupported
Andy Monks
Honored Contributor
Solution

Re: checking mount point directory

Everyone seems to be overlooking the easist and most reliable way :-

#!/usr/bin/sh
if [ `/usr/bin/ls -ldi . | awk '{ print $1}'` = 2 ]
then
echo This is a mount point
else
echo This is not a mount point
fi

Each filesystem has it's own *root* directory. All root directories have the inode number 2 :-)

Andy
Dan Hetzel
Honored Contributor

Re: checking mount point directory

Hey Andy,

That's by far the most elegant solution !! You deserve at least 20 (or more) for that one.

It's surprising that no one else even thought about that one...

You kicked our a$@es !!
8-(

Good show !

Dan
Everybody knows at least one thing worth sharing -- mailto:dan.hetzel@wildcroft.com
Carlos Fernandez Riera
Honored Contributor

Re: checking mount point directory

My 10 points to Andy 8-O.

Now, we can go far away:

Find / -inum 2

Jim: Following your Philosofy you must add /SD_CDROM, /cdrom, /tmp_mnt ...

unsupported
Damian Benavent Pla
Occasional Contributor

Re: checking mount point directory

Hi boys and girls.

I thank everybody for your help.

I agree with Dan: Andy Monks suggested the most elegant solution.

I'll try to post other interesting questions...