Find when new hardware is connected on FreeBSD
All other answers are good, if you want only to check if a device is connected (checking kernel messages with dmesg
, check in /var/log
files and use some tools like usbconfig
, pciconf
or camcontrol
).
But, if you want more (handle a message and execute a program or something like that when you plug your device), you can use devd.
When you connect a device, FreeBSD kernel will generate messages:
- when you plug your device, an
attach
message is generated - when you unplug your device, a
detach
message is generated - and more (see
devd.conf
man page if you want more information).
FreeBSD uses devd
by default, and its configuration is stored in /etc/devd/
and /etc/devd.conf
. If you use linux, the same features exist with devfs
and udev
.
You can find some examples in /usr/share/examples/etc/devd.conf
.
dmesg | grep -i USB
will give you the list of connected
To get information about USB devices. usbconfig
can help give it a try.
or
pciconf -lv
pciconf diagnostic utility for the PCI bus