#!/bin/bash
# NAME
# getSerial.sh - Get HDD/SDD serial number
echo ""
echo "Device name and Serial Number"
filename="/tmp/devices"
lsblk |grep disk | awk '{print $1}' > $filename
sed -i -e 's/^/\/dev\//' $filename
while read -r device
do
serial=$(smartctl -i $device |grep Serial)
printf '%s - %s\n' "$device" "$serial"
done < $filename
# -------------------------------------------------------------------
# EndOfFile
# -------------------------------------------------------------------
.
No comments:
Post a Comment