Skip to content

Commit

Permalink
Simplify getting the initial drive list.
Browse files Browse the repository at this point in the history
  • Loading branch information
dak180 committed Dec 15, 2024
1 parent 3bbdd1c commit 81e780d
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions disk-burnin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,7 @@ function get_drive_list() {
local drives
local localDriveList

if [ "${systemType}" = "BSD" ]; then
localDriveList="$(sysctl -n kern.disks | sed -e 's:nvd:nvme:g')"
else
# shellcheck disable=SC2010
localDriveList="$(ls -l "/sys/block" | grep -v 'devices/virtual' | sed -e 's:[[:blank:]]\{1,\}: :g' | cut -d ' ' -f "9" | sed -e 's:n[0-9]\{1,\}$::g' | uniq )"
# lsblk -n -l -o NAME -E PKNAME | tr '\n' ' '
fi
localDriveList="$(smartctl --scan | cut -d ' ' -f "1" | sed -e 's:/dev/::')"

if [ "${systemType}" = "BSD" ]; then
# This sort breaks on linux when going to four leter drive ids: "sdab"; it works fine for bsd's numbered drive ids though.
Expand Down

0 comments on commit 81e780d

Please sign in to comment.