From 03374fa784726189e76e339d7907f5e9273fc609 Mon Sep 17 00:00:00 2001 From: Jared Vititoe Date: Tue, 6 Jan 2026 15:16:35 -0500 Subject: [PATCH] Add USB drive SMART support with multiple bridge chipset attempts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit **Issue**: osd.2 is a USB-connected 1TB drive that couldn't read SMART Error was: "Read Device Identity failed: scsi error unsupported field" This is typical for USB-attached drives that need bridge-specific flags. **Solution**: Added USB transport detection and multiple fallback methods: - SAT (SCSI-ATA Translation) - most common USB bridges - usbjmicron - JMicron USB bridge chipsets - usbcypress - Cypress USB bridge chipsets - Generic USB fallback - SCSI passthrough Also added USB/SAT attempt to unknown transport types as fallback. **Debug Enhancement**: - Now shows detected transport type in debug output - Helps diagnose why SMART fails **Note**: USB drives in Ceph clusters are unconventional but functional. This OSD appears to be temporary/supplemental storage capacity. If SMART still fails after this update, the USB bridge may be incompatible with smartmontools, which is acceptable for temporary storage. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 --- ceph_osd_analyzer.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/ceph_osd_analyzer.py b/ceph_osd_analyzer.py index 2c534f5..d38f86f 100644 --- a/ceph_osd_analyzer.py +++ b/ceph_osd_analyzer.py @@ -162,6 +162,16 @@ def get_smart_data_remote(device_path, hostname): f"smartctl -a -j {device_path} -d nvme", # Try without sudo f"sudo smartctl -a -j {device_path}", ] + elif tran == "usb": + # USB-connected drives need special device type flags + commands_to_try = [ + f"sudo smartctl -a -j {device_path} -d sat", # SAT (SCSI-ATA Translation) + f"sudo smartctl -a -j {device_path} -d usbjmicron", # JMicron USB bridge + f"sudo smartctl -a -j {device_path} -d usbcypress", # Cypress USB bridge + f"sudo smartctl -a -j {device_path} -d usb", # Generic USB + f"sudo smartctl -a -j {device_path} -d scsi", # SCSI passthrough + f"sudo smartctl -a -j {device_path}", # Auto-detect + ] elif tran == "sata": commands_to_try = [ f"sudo smartctl -a -j {device_path}", @@ -169,10 +179,11 @@ def get_smart_data_remote(device_path, hostname): f"sudo smartctl -a -j {device_path} -d ata", ] else: - # Unknown or no transport, try generic approaches + # Unknown or no transport, try generic approaches including USB commands_to_try = [ f"sudo smartctl -a -j {device_path}", f"smartctl -a -j {device_path}", + f"sudo smartctl -a -j {device_path} -d sat", # Try USB/SAT f"sudo smartctl -a -j {device_path} -d auto", ] @@ -186,6 +197,7 @@ def get_smart_data_remote(device_path, hostname): if DEBUG: print(f"{Colors.RED}DEBUG: All SMART methods failed for {device_path} on {hostname}{Colors.END}") + print(f"{Colors.YELLOW}DEBUG: Transport type detected: {tran if tran else 'unknown'}{Colors.END}") return None