script to list drives by hardware name, type and mountpoint
#!/bin/bash echo "Brand/Model - Device - Mountpoint - Connection" echo "-----------------------------------------------" for dev in /sys/block/sd*; do devname=$(basename "$dev") [[ "$devname" =~ [0-9]$ ]] && continue model=$(cat "$dev/device/model" 2>/dev/null) vendor=$(cat "$dev/device/vendor" 2>/dev/null) devpath="/dev/$devname" mountpoint=$(lsblk -no MOUNTPOINT "$devpath" 2>/dev/null | grep -v '^$' | head -n1) # check if any symlink to this device exists in by-path with 'usb' in path if ls -l /dev/disk/by-path/ | grep -w "$devname" | grep -q usb; then connection="USB" else connection="ATA" fi echo "$vendor $model - $devpath - ${mountpoint:-not mounted} - $connection" done