I've been writing some script utilities for hard drives, with the intention of having a non-graphical, quick to boot, text menu-driven system to perform operations such as SMART tests and secure erase. I had been using FreeBSD to develop, but the incompatibility with many HP UEFI implementations makes this not the best choice. I have been looking into Void Linux, as it provides a very basic install with no GUI as I desire.
There are certain commands that I use in the script that are different between Void Linux and FreeBSD, but I have been able to find the counterpart to most. One command I have used that i am having problems with is one that pulls just the drive device names, excluding CD-ROM devices.
On FreeBSD, I can run
to get output like:
On the Linux installations I have worked with (both Void and Ubuntu) the kern.disks sysctl does not exist, and I cannot find any equivalent. Everything I have found through searching is a utility that returns far more information than I need, and would require complex processing to get just the device names.
Any advise on the best way to extract this information in Linux?
There are certain commands that I use in the script that are different between Void Linux and FreeBSD, but I have been able to find the counterpart to most. One command I have used that i am having problems with is one that pulls just the drive device names, excluding CD-ROM devices.
On FreeBSD, I can run
Code:
sysctl -n kern.disks
Code:
da0 ada0 cd0
On the Linux installations I have worked with (both Void and Ubuntu) the kern.disks sysctl does not exist, and I cannot find any equivalent. Everything I have found through searching is a utility that returns far more information than I need, and would require complex processing to get just the device names.
Any advise on the best way to extract this information in Linux?