How can I show all HDD on pfsense



  • 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.



  • 'fdisk'



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

    sysctl kern.disks

    kern.disks: ad2 ad0



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



  • 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.



  • @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.


Locked