FreeBSD Hardware Specs Command

Posted on 2007-07-22
Last Modified: 2013-11-22
Can someone please tell me how to find out the hardware specs for a machine running FreeBSD?
Question by:adm-computing
    LVL 2

    Accepted Solution

    There are a number of avenues to explore, as root :


    Which will give you the boot log and should include a good overview of device drivers etc being loaded.

    'pciconf -l' will give you a slightly more indepth look at your pci devices.

    You also have :


    To look at for memory statistics.

    You also have 'sysctl -a | grep dev' which will respond with much the same information as dmesg but in a different layout.

    'kldstat' will list loaded modules which may or may not help you identify hardware.

    If you're used to Linux more you can replicate limited linux /proc functionality using :

    'mount_linprocfs proc /proc'

    and then browse this folder as you would Linux for more information.

    Some interesting files :


    If there is something specific you're looking for that isn't covered by the above please post with details.

    Author Comment

    Thanks for the reply. 'dmesg' doesnt do anything for me, but the others are helpful, in particular 'sysctl -a | grep dev'. However, where can I find something as simple as the processor speed? I couldnt see that being returned using any of the commands you recommended.
    LVL 2

    Assisted Solution

    Did you mean dmesg didn't work or it didn't give you the information you needed?

    You really should have it, it's a stock command. Are you running as root? I'm also assuming a relatively recent version of FreeBSD (5.x, 6.x)

    bash# uname -rs
    FreeBSD 6.2-RELEASE
    bash# which dmesg

    The first few lines of dmesg output should tell you the cpu info :

    CPU: Intel(R) Pentium(R) D CPU 3.00GHz (2992.52-MHz 686-class CPU)
      Origin = "GenuineIntel"  Id = 0xf47  Stepping = 7
      AMD Features=0x20100000<NX,LM>
      AMD Features2=0x1<LAHF>
      Cores per package: 2
    real memory  = 1072218112 (1022 MB)
    avail memory = 1040101376 (991 MB)
    FreeBSD/SMP: Multiprocessor System Detected: 2 CPUs
     cpu0 (BSP): APIC ID:  0
     cpu1 (AP): APIC ID:  1

    Failing that if you use the procfs tip above you can find it in /proc/cpuinfo :

    processor       : 0
    vendor_id       : GenuineIntel
    cpu family      : 6
    model           : 16
    model name      : Intel(R) Pentium(R) D CPU 3.00GHz
    stepping        : 7
    processor       : 1
    vendor_id       : GenuineIntel
    cpu family      : 6
    model           : 16
    model name      : Intel(R) Pentium(R) D CPU 3.00GHz
    stepping        : 7
    flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 b19 b21 mmxext mmx fxsr xmm b26 b27 b28 b29 3dnow
    cpu MHz         : 2992.52
    bogomips        : 2992.52

    You could also use sysctl :

    sysctl -a | grep hw.model

    Which should return the vendor string from the cpu :

    hw.model: Intel(R) Pentium(R) D CPU 3.00GHz

    Is it a full FreeBSD box you have? or some kindof virtual server? I have seen some virtualised FreeBSD machines (not using jails) which have had some very...odd...setup configurations.

    Author Comment

    'dmesg' doesnt return an error but it doesnt return any output either:

    bash-2.05b# dmesg
    bash-2.05b# uname -rs
    FreeBSD 5.4-RELEASE
    bash-2.05b# which dmesg

    Any ideas why? It is a full FreeBSD box too. 'sysctl -a' does work for me though.
    LVL 2

    Expert Comment

    dmesg requires access to the kernel message buffer which you can turn off for non root users :

    mail# dmesg
    dmesg: sysctl kern.msgbuf: Operation not permitted

    But root (in a non jailed system) should have access to it. There are a few sysctl variables related to it, mine are set like this :

    bash# sysctl -a | grep msgbuf
    kern.msgbuf_clear: 0
    kern.consmsgbuf_size: 8192
    security.bsd.unprivileged_read_msgbuf: 0

    The last entry is the one stopping non root users looking at the message buffer. I suspect the other interesting one from your point of view would be kern.msgbuf_clear. That implies that if it's set to '1' the message buffer is cleared instantly / periodically. Might be worth checking to see what it's set to.

    You could have a look at :


    Which should have the contents - but they may be empty if your actual dmesg command is not functioning as expected.

    Are you sure you're not running as root within a jail?

    If your 'ps aux' listing has a 'J' character next to the process states :

    www     97284  0.0  0.4  6524  4364  ??  SJ    9:55AM   0:00.01 /usr/local/sbin/httpd -DSSL
    root    24721  0.0  0.1  1532   856  p1  R+J  10:08AM   0:00.00 ps aux

    You're in a jailed environment. This would be fairly transparent to you if set up correctly.

    I'm not sure if you set the server up yourself or not, I'm making the assumption you didn't as you're looking for hardware info.
    LVL 61

    Expert Comment

    Install "dmicecode" port and it will read whatever your BIOS holds like serial numbers, memory banks etc.

    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    Introduction Regular patching is part of a system administrator's tasks. However, many patches require that the system be in single-user mode before they can be installed. A cluster patch in particular can take quite a while to apply if the machine…
    Why Shell Scripting? Shell scripting is a powerful method of accessing UNIX systems and it is very flexible. Shell scripts are required when we want to execute a sequence of commands in Unix flavored operating systems. “Shell” is the command line i…
    Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
    This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    23 Experts available now in Live!

    Get 1:1 Help Now