Operating System - HP-UX
1821546 Members
2146 Online
109633 Solutions
New Discussion юеВ

directory tree showing mountpoints

 
SOLVED
Go to solution
Thomas Moersch
Occasional Advisor

directory tree showing mountpoints

Is anybody aware of a way to show a directory tree which would indicate mountpoints?
This could be a great time saver!

Thanks in advance.
8 REPLIES 8
harry d brown jr
Honored Contributor

Re: directory tree showing mountpoints


maybe something like this: http://hpux.ee.ualberta.ca/hppd/hpux/Gnome/gfv-0.2.1/

bdf, showmount and exportfs also work.

live free or die
harry d brown jr
Live Free or Die
Thomas Moersch
Occasional Advisor

Re: directory tree showing mountpoints

The gui sounds interesting but is not possible on my servers. GUIs are out.
Maybe a combination of bdf, showmount, find, du etc. will haev to do.

;-)

Thomas
harry d brown jr
Honored Contributor

Re: directory tree showing mountpoints

Maybe http://hpux.ee.ualberta.ca/hppd/hpux/hpux/Users/cls-1.8/ and modify the color for mounted directories?

live free or die
harry d brown jr
Live Free or Die
Bill Hassell
Honored Contributor
Solution

Re: directory tree showing mountpoints

bdf shows the mountpoints. I'm not sure what else you would need. Thed source for the mountpoint is the first element and the attachment point (mountpoint) is the last element. For mounts that are hierarchical (like /var/adm/sw) the mounpoint will have the fullpath. bdf also accepts a filename or any directory and the result will be the mountpoint for the given file/directory.

bdf does make scripting a pain because of long source names such as NFS that get split onto two lines. There is an easy workaround though. This code snippet will handle split lines and remove the title line:

bdf | while read SOURCE SIZ USED FREE PCT MOUNT
do
[ "$SIZ" = "kbytes" ] && continue
[ "$SIZ" = "" ] && read SIZ USED FREE PCT MOUNT
echo $SOURCE $SIZ $USED $FREE $PCT $MOUNT
done



Bill Hassell, sysadmin
Suraj Singh_1
Trusted Contributor

Re: directory tree showing mountpoints

Do you mean something like "TREE" command in MS-DOS?

Interesting !!
What we cannot speak about we must pass over in silence.
C. Beerse_1
Regular Advisor

Re: directory tree showing mountpoints

My memory points to `find` with the "--mount" or "-xdev" option to not enter mountpoints. Something like `find . -xdev -print` (or "-ls" or "-exec ls -ld {} \;")

Just tune this to how you like to see mountpoints.
make everything as simple as possible, not simpler (A.Einstein??)
Jannik
Honored Contributor

Re: directory tree showing mountpoints

find ./ -xdev -type d
jaton
john korterman
Honored Contributor

Re: directory tree showing mountpoints

Hi,
this might do what you request, but it takes forever to execute: try it with a directory starting point as "$1":

#!/usr/bin/sh

find "$1" -type f -print| while read line
do
bdf "$line" | tail -1| awk -v filename=$line '{print filename " mounted on:" $NF}'
done

regards,
John K.
it would be nice if you always got a second chance