Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    How can I show all HDD on pfsense

    Scheduled Pinned Locked Moved General pfSense Questions
    6 Posts 4 Posters 13.8k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      sudo
      last edited by

      ex. for linux I use command fdisk -l and for pfsense what's command can I use?
      because I want to use command dd for clone HDD.

      1 Reply Last reply Reply Quote 0
      • C
        clarknova
        last edited by

        'fdisk'

        db

        1 Reply Last reply Reply Quote 0
        • W
          wallabybob
          last edited by

          Try shell command sysctl kern.disks On my system:```

          sysctl kern.disks

          kern.disks: ad2 ad0

          1 Reply Last reply Reply Quote 0
          • S
            sudo
            last edited by

            Thank you all, now I use dmesg command and I have found HDD.

            1 Reply Last reply Reply Quote 0
            • W
              wallabybob
              last edited by

              The advantage of the sysctl is that the result is always correct. If you have enough system logging happening the system startup output will disappear out of the dmesg output. I notice my pfsense box has a file /var/log/dmesg.boot which appears to be the most recent system startup output (dmesg output just after startup). I don't think /var/log/dmesg.boot is a general FreeBSD facility - perhaps it is specific to pfSense.

              Also the sysctl should track all disk device names. If searching startup output you need to look for ad devices, da devices (SCSI and USB drives) and possibly various forms of raid devices, depending on how general you want to make whatever you are doing.

              1 Reply Last reply Reply Quote 0
              • F
                fluca1978
                last edited by

                @wallabybob:

                I don't think /var/log/dmesg.boot is a general FreeBSD facility - perhaps it is specific to pfSense.

                It is indeed, /var/run/dmesg.boot contains the dmesg buffer just after the boot even in a FreeBSD system.
                There is another reason why dmesg could not be right command for finding disks: dmesg shows the kernel buffer message, so if the kernel is long lived and has outputted several messages, dmesg has scrolled and disk information is lost.
                Other commands that will work are:

                atacontrol list
                

                for ata devices and

                camcontrol devlist
                

                for scsi, usb devices.

                1 Reply Last reply Reply Quote 1
                • First post
                  Last post
                Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.