Overview
If you are using an External SSD/Harddisk and the Proxmox can't detect the SMART status, this post might help you.
In a previous blog, I showed how to use smartctl tool with external SSDs/Harddisks. The problem with in previous blog post was that smartctl was not automatically detecting my external SSD controller and the SMART query command failed. The fix is very easy. You should detect the controller chip and tell smartctl with -d flag. For more details, you can head to the previous blog post.
TDLR:
Problem was default command can't detect the device type:
$ smartctl -i /dev/sdb
/dev/sdb: Unknown USB bridge [0x0bda:0x0bda (0x2001)]
Please specify device type with the -d option.
Fixed with specifying the correct device type:
$ smartctl -i -d sntrealtek /dev/sdb
=== START OF INFORMATION SECTION ===
Model Number: KBG50ZNV256G KIOXIA
...
If you can't query your SSD's SMART values with the default command, Proxmox can't too. In this blog, we will wrap the smartctl so Proxmox won't have problem while querying the SMART status of my external SSD.
- First, login to the Proxmox host server.
- I am using the
rootaccount directly. - If you are not using
root, please addsudoto beginning of the commands below. - Note that you need
sudoprivileges for this solution.
- I am using the
- Create a bash script somewhere in your server.
vim ~/smartctl.external
- Copy and paste the script below to the file.
- What this script basically do is adding
-d sntrealtekflag if the queried device is/dev/sdb. It doesn't do anything to another devices or flags. - ⚠️ Please change the
/dev/sdband-d sntrealtekaccording to your requirements.
- What this script basically do is adding
#!/usr/bin/env bash
SMARTCTL=/usr/sbin/smartctl.orig
OPTIONS=("$@")
for((i=1; i<$#; ++i)); do
# Check for /dev/sdb and add the Realtek option
if [[ "${OPTIONS[i]}" == "/dev/sdb" ]]; then
realtek_option="-d sntrealtek"
# Add the "-d sntrealtek" option to the list of options
OPTIONS=($realtek_option "${OPTIONS[@]}")
fi
done
exec $SMARTCTL "${OPTIONS[@]}"
- Now rename the original
smartctltool.
cp /usr/sbin/smartctl /usr/sbin/smartctl.orig
- Replace the wrapper script with the original
smartctl
cp ~/smartctl.external /usr/sbin/smartctl
- Set the permissions of the wrapper script.
chmod 755 /usr/sbin/smartctl
- (Optional) Change the attribute of the wrapper script so it won't be changed by updates or by mistake.
chattr +i /usr/sbin/smartctl
- Now make sure that the default command returns the SMART values:
$ smartctl -i /dev/sdb
=== START OF INFORMATION SECTION ===
Model Number: KBG50ZNV256G KIOXIA
...
- Return to the Proxmox and click on the
reloadon the Disks page to reload the SMART values. - The
UNKNOWNstatus should bePASSEDnow.
- You can also view the full SMART details.

Top comments (0)