Mountpoint to device translation?

From: John Heiden (jheiden2@pop3.utoledo.edu)
Date: Fri Nov 01 2002 - 12:09:48 EST


Dear Sun Managers,

I'm trying to write a script, and in one line I need to get the raw
device that
a partition is mounted at, when given the mount point.

So for example, I am given the mount point of "/" and then I have been
trying (in vain) to get from /etc/vfstab the value back of
/dev/rdsk/c0t0d0s0

So far I have been playing with the following line

raw=`cat /etc/vfstab | awk '$1==$fs' {print $2}`

Can anyone tell me why this doesn't return anything?

If I try the following, it works, but doesn't really allow me to pass in
the
mount point so I can look up various other mount points.

raw=`cat /etc/vfstab | awk '$1=="/"' {print $2}`

I have also tried

raw=`cat /etc/vfstab | awk '$1=="$fs"' {print $2}`

But that returns nothing.

Anyway, any ideas would be greatly appreciated!

John

John Heiden
Network Engineer
The University of Toledo
Toledo, OH 43606
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers



This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 23:25:11 EDT