<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: checking mount point directory in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/checking-mount-point-directory/m-p/2497361#M20280</link>
    <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Some of the answers will not work in this :&lt;BR /&gt;&lt;BR /&gt;You have 2 mountpoins :&lt;BR /&gt;&lt;BR /&gt;/firstmountpoint&lt;BR /&gt;/firstmountpoint/adirectory/secondmountpoint&lt;BR /&gt;&lt;BR /&gt;If you check /firstmountpoint/adirectory, &lt;BR /&gt;some of the previous will answer OK but its false.&lt;BR /&gt;&lt;BR /&gt;My solution works in this case.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;Patrice.</description>
    <pubDate>Thu, 22 Feb 2001 16:30:02 GMT</pubDate>
    <dc:creator>MARTINACHE</dc:creator>
    <dc:date>2001-02-22T16:30:02Z</dc:date>
    <item>
      <title>checking mount point directory</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/checking-mount-point-directory/m-p/2497354#M20273</link>
      <description>Is there any operator in POSIX shell to check if a directory is a mount point ?&lt;BR /&gt;&lt;BR /&gt;test command (and shell built-in test command) has got some operators like "-f", "-x", ... etc.</description>
      <pubDate>Thu, 22 Feb 2001 15:45:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/checking-mount-point-directory/m-p/2497354#M20273</guid>
      <dc:creator>Damian Benavent Pla</dc:creator>
      <dc:date>2001-02-22T15:45:13Z</dc:date>
    </item>
    <item>
      <title>Re: checking mount point directory</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/checking-mount-point-directory/m-p/2497355#M20274</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;i don't know any test operator for this but here my suggestion:&lt;BR /&gt;&lt;BR /&gt;grep -q " $dir " /etc/mnttab&lt;BR /&gt;if [ $? = 0 ]&lt;BR /&gt;then&lt;BR /&gt;  echo "Directory $dir is a mount point"&lt;BR /&gt;else&lt;BR /&gt;  echo "Directory $dir is NOT a mount point"&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;The variable dir has to be the absolute path.&lt;BR /&gt;&lt;BR /&gt;Regards</description>
      <pubDate>Thu, 22 Feb 2001 15:53:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/checking-mount-point-directory/m-p/2497355#M20274</guid>
      <dc:creator>Andreas Voss</dc:creator>
      <dc:date>2001-02-22T15:53:30Z</dc:date>
    </item>
    <item>
      <title>Re: checking mount point directory</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/checking-mount-point-directory/m-p/2497356#M20275</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Supposing that $DIRNAME is the name of your directory.&lt;BR /&gt;&lt;BR /&gt;You can do :&lt;BR /&gt;&lt;BR /&gt;if [ $DIRNAME = `bdf $DIRNAME | tail -1 | awk {'print $6}'` ];&lt;BR /&gt;then ...&lt;BR /&gt;else ...&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;Patrice</description>
      <pubDate>Thu, 22 Feb 2001 15:55:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/checking-mount-point-directory/m-p/2497356#M20275</guid>
      <dc:creator>MARTINACHE</dc:creator>
      <dc:date>2001-02-22T15:55:48Z</dc:date>
    </item>
    <item>
      <title>Re: checking mount point directory</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/checking-mount-point-directory/m-p/2497357#M20276</link>
      <description>Hi Damian:&lt;BR /&gt;&lt;BR /&gt;One way is to grep for the mountpoint in question in /etc/fstab:&lt;BR /&gt;&lt;BR /&gt;WHAT=/home&lt;BR /&gt;if [ `grep -c $WHAT /etc/fstab` -gt 0 ]&lt;BR /&gt;then&lt;BR /&gt;echo "$WHAT is a mountpoint"&lt;BR /&gt;else&lt;BR /&gt;echo "$WHAT isn't a mountpoint"&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Thu, 22 Feb 2001 15:58:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/checking-mount-point-directory/m-p/2497357#M20276</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2001-02-22T15:58:09Z</dc:date>
    </item>
    <item>
      <title>Re: checking mount point directory</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/checking-mount-point-directory/m-p/2497358#M20277</link>
      <description>Hi Damian,&lt;BR /&gt;&lt;BR /&gt;As usual, many ways lead to Rome...&lt;BR /&gt;&lt;BR /&gt;[ $DIR = $(df $DIR | cut -f1 -d" ") ] &amp;amp;&amp;amp; echo mount point&lt;BR /&gt;&lt;BR /&gt;DIR must contain a full pathname&lt;BR /&gt;&lt;BR /&gt;Best regards,&lt;BR /&gt;&lt;BR /&gt;Dan</description>
      <pubDate>Thu, 22 Feb 2001 16:08:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/checking-mount-point-directory/m-p/2497358#M20277</guid>
      <dc:creator>Dan Hetzel</dc:creator>
      <dc:date>2001-02-22T16:08:16Z</dc:date>
    </item>
    <item>
      <title>Re: checking mount point directory</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/checking-mount-point-directory/m-p/2497359#M20278</link>
      <description>I have read man sh-posix and i dont find any flag for test that return if is mount-point.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;To write a simple code i would prefer use of moun command instead of /etc/fstab: mount_point are directory and when it has a file_system mounted is a mount_point&lt;BR /&gt;&lt;BR /&gt;D=/home&lt;BR /&gt;MP=`mount | grep -c "^$D "`&lt;BR /&gt;&lt;BR /&gt;echo $MP&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 22 Feb 2001 16:17:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/checking-mount-point-directory/m-p/2497359#M20278</guid>
      <dc:creator>Carlos Fernandez Riera</dc:creator>
      <dc:date>2001-02-22T16:17:45Z</dc:date>
    </item>
    <item>
      <title>Re: checking mount point directory</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/checking-mount-point-directory/m-p/2497360#M20279</link>
      <description>Hi !&lt;BR /&gt;&lt;BR /&gt;Other way&amp;gt;&lt;BR /&gt;&lt;BR /&gt;/usr/sbin/mount | cut -d" " -f 1 | grep $(pwd)&lt;BR /&gt;if [ $? -eq 0 ]&lt;BR /&gt;then&lt;BR /&gt;   echo "$(pwd) is mount point "&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;regards, Saa&lt;BR /&gt;$(pwd) is actual directory You can change it any variable</description>
      <pubDate>Thu, 22 Feb 2001 16:19:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/checking-mount-point-directory/m-p/2497360#M20279</guid>
      <dc:creator>Sandor Horvath_2</dc:creator>
      <dc:date>2001-02-22T16:19:48Z</dc:date>
    </item>
    <item>
      <title>Re: checking mount point directory</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/checking-mount-point-directory/m-p/2497361#M20280</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Some of the answers will not work in this :&lt;BR /&gt;&lt;BR /&gt;You have 2 mountpoins :&lt;BR /&gt;&lt;BR /&gt;/firstmountpoint&lt;BR /&gt;/firstmountpoint/adirectory/secondmountpoint&lt;BR /&gt;&lt;BR /&gt;If you check /firstmountpoint/adirectory, &lt;BR /&gt;some of the previous will answer OK but its false.&lt;BR /&gt;&lt;BR /&gt;My solution works in this case.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;Patrice.</description>
      <pubDate>Thu, 22 Feb 2001 16:30:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/checking-mount-point-directory/m-p/2497361#M20280</guid>
      <dc:creator>MARTINACHE</dc:creator>
      <dc:date>2001-02-22T16:30:02Z</dc:date>
    </item>
    <item>
      <title>Re: checking mount point directory</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/checking-mount-point-directory/m-p/2497362#M20281</link>
      <description>Hi (again):&lt;BR /&gt;&lt;BR /&gt;Patrice makes a very good point.  A better evaluation of /etc/fstab should look like this:&lt;BR /&gt;&lt;BR /&gt;WHAT=[[:space:]]/home[[:space:]] &lt;BR /&gt;if [ `grep -c $WHAT /etc/fstab` -gt 0 ] &lt;BR /&gt;then &lt;BR /&gt;echo "$WHAT is a mountpoint" &lt;BR /&gt;else &lt;BR /&gt;echo "$WHAT isn't a mountpoint" &lt;BR /&gt;fi &lt;BR /&gt;&lt;BR /&gt;This puts white-space surrounding the /home token in the example chosen, and correctly queries /etc/fstab for its presence, unambiguously.&lt;BR /&gt;&lt;BR /&gt;I choose to interrogat /etc/fstab rather with the assumption that one is interested in directories which have been defined for mounting as opposed to directories which are already mounted.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Thu, 22 Feb 2001 17:22:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/checking-mount-point-directory/m-p/2497362#M20281</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2001-02-22T17:22:12Z</dc:date>
    </item>
    <item>
      <title>Re: checking mount point directory</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/checking-mount-point-directory/m-p/2497363#M20282</link>
      <description>Hi (again),&lt;BR /&gt;&lt;BR /&gt;James, your script will not work only if you use Service Guard (Mountpoint are in package configuration files)&lt;BR /&gt;&lt;BR /&gt;;-)&lt;BR /&gt;&lt;BR /&gt;Patrice.</description>
      <pubDate>Thu, 22 Feb 2001 17:42:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/checking-mount-point-directory/m-p/2497363#M20282</guid>
      <dc:creator>MARTINACHE</dc:creator>
      <dc:date>2001-02-22T17:42:32Z</dc:date>
    </item>
    <item>
      <title>Re: checking mount point directory</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/checking-mount-point-directory/m-p/2497364#M20283</link>
      <description>Hi Patrice:&lt;BR /&gt;&lt;BR /&gt;EXCELLENNT POINT!...and I run MC/ServiceGuard too!!!...&lt;BR /&gt;&lt;BR /&gt;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.&lt;BR /&gt;&lt;BR /&gt;With my regards and my thanks for your corrections, Jim. :-))&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Thu, 22 Feb 2001 17:56:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/checking-mount-point-directory/m-p/2497364#M20283</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2001-02-22T17:56:28Z</dc:date>
    </item>
    <item>
      <title>Re: checking mount point directory</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/checking-mount-point-directory/m-p/2497365#M20284</link>
      <description>Gooooood .... Discussion.&lt;BR /&gt;&lt;BR /&gt;Maybe you know why i prefer mount command!!&lt;BR /&gt;&lt;BR /&gt;I did not think in S/G neither.&lt;BR /&gt;&lt;BR /&gt;Note my grep contain caret "^" This is begin of line and space " " as separator.&lt;BR /&gt;&lt;BR /&gt;Fine, Patrice.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 22 Feb 2001 22:10:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/checking-mount-point-directory/m-p/2497365#M20284</guid>
      <dc:creator>Carlos Fernandez Riera</dc:creator>
      <dc:date>2001-02-22T22:10:13Z</dc:date>
    </item>
    <item>
      <title>Re: checking mount point directory</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/checking-mount-point-directory/m-p/2497366#M20285</link>
      <description>Everyone seems to be overlooking the easist and most reliable way :-&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;if [ `/usr/bin/ls -ldi . | awk '{ print $1}'` = 2 ]&lt;BR /&gt;then&lt;BR /&gt;echo This is a mount point&lt;BR /&gt;else&lt;BR /&gt;echo This is not a mount point&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;Each filesystem has it's own *root* directory. All root directories have the inode number 2 :-)&lt;BR /&gt;&lt;BR /&gt;Andy</description>
      <pubDate>Thu, 22 Feb 2001 23:12:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/checking-mount-point-directory/m-p/2497366#M20285</guid>
      <dc:creator>Andy Monks</dc:creator>
      <dc:date>2001-02-22T23:12:38Z</dc:date>
    </item>
    <item>
      <title>Re: checking mount point directory</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/checking-mount-point-directory/m-p/2497367#M20286</link>
      <description>Hey Andy,&lt;BR /&gt;&lt;BR /&gt;That's by far the most elegant solution !! You deserve at least 20 (or more) for that one.&lt;BR /&gt;&lt;BR /&gt;It's surprising that no one else even thought about that one... &lt;BR /&gt;&lt;BR /&gt;You kicked our a$@es  !!  &lt;BR /&gt;8-(&lt;BR /&gt;&lt;BR /&gt;Good show !&lt;BR /&gt;&lt;BR /&gt;Dan&lt;BR /&gt;</description>
      <pubDate>Fri, 23 Feb 2001 07:18:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/checking-mount-point-directory/m-p/2497367#M20286</guid>
      <dc:creator>Dan Hetzel</dc:creator>
      <dc:date>2001-02-23T07:18:59Z</dc:date>
    </item>
    <item>
      <title>Re: checking mount point directory</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/checking-mount-point-directory/m-p/2497368#M20287</link>
      <description>My 10 points to Andy 8-O.&lt;BR /&gt;&lt;BR /&gt;Now, we can go far away:&lt;BR /&gt;&lt;BR /&gt;Find / -inum 2 &lt;BR /&gt;&lt;BR /&gt;Jim: Following your Philosofy you must add /SD_CDROM, /cdrom, /tmp_mnt ...&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 23 Feb 2001 08:24:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/checking-mount-point-directory/m-p/2497368#M20287</guid>
      <dc:creator>Carlos Fernandez Riera</dc:creator>
      <dc:date>2001-02-23T08:24:16Z</dc:date>
    </item>
    <item>
      <title>Re: checking mount point directory</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/checking-mount-point-directory/m-p/2497369#M20288</link>
      <description>Hi boys and girls.&lt;BR /&gt;&lt;BR /&gt;I thank everybody for your help.&lt;BR /&gt;&lt;BR /&gt;I agree with Dan: Andy Monks suggested the most elegant solution.&lt;BR /&gt;&lt;BR /&gt;I'll try to post other interesting questions...</description>
      <pubDate>Mon, 26 Feb 2001 14:04:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/checking-mount-point-directory/m-p/2497369#M20288</guid>
      <dc:creator>Damian Benavent Pla</dc:creator>
      <dc:date>2001-02-26T14:04:47Z</dc:date>
    </item>
  </channel>
</rss>

