Re: How to symlink devfs devices?

2009-07-09 Thread Sagara Wijetunga
Paul B. Mahol writes: 



Is it possible to create a symlink to a device and use the symlink in place
of the real device name in FreeBSD, especially in version 7.2? 


1. A disk
   /dev/camera - /dev/da0s1


devfs.conf(5)


2. A network device
   re0 - lan0


same as above, but there is way to completly hide re0:
# ifconfig re0 name lan0 



Hi FreeBSD community 

Thank you all for replies. 

Yes, USB Mass Storage devices could be symlinked (may be others too) but 
ethernet devices cannot be symlinked but ethernet interfaces can be renamed. 

I have one more question, how do I know what device is attached to an 
ethernet interface after it is renamed? 


Regards
Sagara
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


How to symlink devfs devices?

2009-07-08 Thread Sagara Wijetunga
Hi 

Is it possible to create a symlink to a device and use the symlink in place 
of the real device name in FreeBSD, especially in version 7.2? 


1. A disk
  /dev/camera - /dev/da0s1 


2. A network device
  re0 - lan0 


Kind regards
Sagara
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: How to symlink devfs devices?

2009-07-08 Thread Paul B. Mahol

 Is it possible to create a symlink to a device and use the symlink in place
 of the real device name in FreeBSD, especially in version 7.2?

 1. A disk
/dev/camera - /dev/da0s1

devfs.conf(5)

 2. A network device
re0 - lan0

same as above, but there is way to completly hide re0:
# ifconfig re0 name lan0

-- 
Paul
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: How to symlink devfs devices?

2009-07-08 Thread Roland Smith
On Wed, Jul 08, 2009 at 05:49:24PM +, Paul B. Mahol wrote:
 
  Is it possible to create a symlink to a device and use the symlink in place
  of the real device name in FreeBSD, especially in version 7.2?
 
  1. A disk
 /dev/camera - /dev/da0s1

 devfs.conf(5)

Geneally, yes. But not in this case, I think. You don't want any old usb
device to be linked to /dev/camera! USB devices are enumerated in the
sequence thay are plugged in. So there is no hard guarantee that the
camera will always be available as da0s1. It might be da1s1 if another
USB drive was plugged in earlier.

And not all cameras represent themselves as disk devices (USB mass
storage). Lots of modern ones use PTP
[http://en.wikipedia.org/wiki/Picture_Transfer_Protocol].

So in this case it might be better to use HAL (via hald(8))
[http://freedesktop.org/wiki/Software/hal].

Roland
-- 
R.F.Smith   http://www.xs4all.nl/~rsmith/
[plain text _non-HTML_ PGP/GnuPG encrypted/signed email much appreciated]
pgp: 1A2B 477F 9970 BA3C 2914  B7CE 1277 EFB0 C321 A725 (KeyID: C321A725)


pgpWgQ1vvTcwH.pgp
Description: PGP signature


Re: How to symlink devfs devices?

2009-07-08 Thread Polytropon
On Wed, 08 Jul 2009 07:33:42 -0500, Sagara Wijetunga sag...@tomahawk.com.sg 
wrote:
 Hi 
 
 Is it possible to create a symlink to a device and use the symlink in place 
 of the real device name in FreeBSD, especially in version 7.2? 
 
 1. A disk
/dev/camera - /dev/da0s1 
 
 2. A network device
re0 - lan0 

That's no problem: Use the link statement: link source target,
such as

linkda0s1   camera
linkre0 lan0

in you /etc/devfs.conf file. See the manual page for this file for
more information, or see the example entries in this file.



-- 
Polytropon
From Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: How to symlink devfs devices?

2009-07-08 Thread RW
On Wed, 8 Jul 2009 21:45:48 +0200
Roland Smith rsm...@xs4all.nl wrote:

 On Wed, Jul 08, 2009 at 05:49:24PM +, Paul B. Mahol wrote:
  
   Is it possible to create a symlink to a device and use the
   symlink in place of the real device name in FreeBSD, especially
   in version 7.2?
  
   1. A disk
  /dev/camera - /dev/da0s1
 
  devfs.conf(5)
 
 Geneally, yes. But not in this case, I think. You don't want any old
 usb device to be linked to /dev/camera! USB devices are enumerated in
 the sequence thay are plugged in. So there is no hard guarantee that
 the camera will always be available as da0s1. It might be da1s1 if
 another USB drive was plugged in earlier.
 
 And not all cameras represent themselves as disk devices (USB mass
 storage). Lots of modern ones use PTP
 [http://en.wikipedia.org/wiki/Picture_Transfer_Protocol].
 
 So in this case it might be better to use HAL (via hald(8))
 [http://freedesktop.org/wiki/Software/hal]

although if it is a standard usb mass storage device, you can mount it
via it's msdos volume label, or a generic label written to the device by
glabel. Both methods are described in the glabel(8).

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org