Is there a command I can use to show which SATA ports are unused?
No, but you can do the reverse. You can list which ports are being used. Then look up (in the manual) how many ports there are on the motherboard, subtract how many are already in use and get the number of remaining ports.
This assumes that you have one SATA drive connected per SATA connector (e.g. no port multipliers).
There are several ways to to this.
If all SATA controllers have drivers loaded (fairly normal), then I find fdisk -l
to list all disks the easiest way.
If you no longer have fdisk (it is being replaced my more modern variants such as gpart), then you can read the boot log. Some googling show that CentOS has this available via dmesg, but you can also read the log files directly. There are probably in /var/log/dmesg.log, /var/run/dmesg.boot or in /var/log/boot. (Keeping this a tad generic for people not using CentOS).
Then there is lspci
. This lists all PCI and PCI-e devices, inclusding SATA controllers. Add -v
to get easier readable output.
Or use dmidecode
. This asks the BIOS for information. If the output from this command seems overwhelming, limit it with the -t NR
option.