[geeks] Swapping Sparc boxes...

Caleb Shay caleb at webninja.com
Sat Dec 20 03:25:19 CST 2003


David L Kindred (Dave) wrote:

>
>Perhaps some standardization on a fundamental system based on
>full-specification with "aliasing" of some sort (like good old symbolic
>links).  Somewhere let the system know that "/dev/dlt" is really
>"/dev/rmt/c3t2d0BEST" so you can reference "/dev/dlt" when reading
>tapes.
>  
>
Well, with Linux+devfs, you can either use:

REGISTER        .*           COPY    /lib/dev-state/$devname $devpath
CHANGE          .*           COPY    $devpath /lib/dev-state/$devname
CREATE          .*           COPY    $devpath /lib/dev-state/$devname
DELETE          .*           CFUNCTION GLOBAL unlink /lib/dev-state/$devname
RESTORE         /lib/dev-state

in your devfsd.conf to have devfsd remember any symlinks you make and 
restore them when the device is found again and delete them when the 
device is removed

OR

you can just have devfs create any symlink you like with something like

LOOKUP          ^dlt$           CFUNCTION GLOBAL mksymlink 
${mntpnt}/rmt/c3t2d0BEST dlt
REGISTER        ^rmt/c3t2d0BEST$  CFUNCTION GLOBAL mksymlink ${devpath} dlt
UNREGISTER      ^rmt/c3t2d0BEST$  CFUNCTION GLOBAL unlink dlt

This would also handle the possibility that you unloaded the module for 
your dlt drive and would remove the symlink if the module wasn't loaded 
AND would reference the full device name if you tried to access 
/dev/dlt, so if your modules.conf was properly configured to load the 
given module on access to /dev/rmt/c32d0BEST, would automagically load 
the module and seemlessly give you access to /dev/dlt when you tried to 
access it.

Cheers,

Caleb Shay
caleb at webninja.com



More information about the geeks mailing list