How does /dev/pf get created?

Jeremy Chadwick koitsu at FreeBSD.org
Fri Jan 25 10:05:16 PST 2008


On Fri, Jan 25, 2008 at 09:54:19AM -0800, Gavin Spomer wrote:
> I followed your instructions to a "T" and then after I rebooted, I double checked everything to make sure I didn't do
>    anything stupid. Still no /dev/pf. Running kldstat still shows that pf.ko didn't get loaded. Trying to load it via your
>    instructions (kldload -v pf) I get:
> 
>       kldload: can't load pf: No such file or directory

This would indicate that /boot/kernel/pf.ko is missing.  It doesn't
appear it was built during your last buildkernel/installkernel.

An example of kldload working properly:

eos# ls -l /boot/kernel/if_nge*
-r-xr-xr-x  1 root  wheel  27793 Jan 15 00:17 /boot/kernel/if_nge.ko
eos# kldload if_nge
eos# kldstat
Id Refs Address    Size     Name
 1   10 0xc0400000 3f5b50   kernel
 2    1 0xc07f6000 64340    acpi.ko
 4    2 0xc81b5000 2e000    pf.ko
 5    1 0xc83e2000 2000     accf_http.ko
 6    1 0xcaf50000 3000     pflog.ko
 7    1 0xcd810000 7000     if_nge.ko
eos# kldunload if_nge
eos# kldstat
Id Refs Address    Size     Name
 1    6 0xc0400000 3f5b50   kernel
 2    1 0xc07f6000 64340    acpi.ko
 4    2 0xc81b5000 2e000    pf.ko
 5    1 0xc83e2000 2000     accf_http.ko
 6    1 0xcaf50000 3000     pflog.ko

>    When I ran this before following your instructions I got something like: (I'm doing this partially from memory)
> 
>       kldload: can't load pf.ko: File exists
> 
>    That doesn't make a lick of sense to me.

This is what kldload will say (for most modules) when you already have
said module built in to the kernel.  The kernel module utilities on
FreeBSD are not very "user-friendly" when it comes to error messages;
your confusion in this regard is nothing to be ashamed of.

If /dev/pf isn't being created despite pf being built-in, it could
indicate some strange bug in the pf module (where it prefers to be
loaded as a kernel module), OR, a problem with devfs (the filesystem
that controls /dev on FreeBSD) on your machine.

Can you provide the output of df, and the contents of /etc/fstab?

>    Stupid (?) question: Is there a way to manually create /dev/pf or can it be copied from another system?

No, it needs to be automatically created by pf via devfs.

>    Thanks for taking the time to help this quasi-newbie. :)

No problem.  It's a learning experience, and over time you'll eventually
be able to help others.  :-)

-- 
| Jeremy Chadwick                                    jdc at parodius.com |
| Parodius Networking                           http://www.parodius.com/ |
| UNIX Systems Administrator                      Mountain View, CA, USA |
| Making life hard for others since 1977.                  PGP: 4BD6C0CB |



More information about the freebsd-pf mailing list