diff --git a/app.py b/app.py
index 5b0716f..449f7a4 100644
--- a/app.py
+++ b/app.py
@@ -240,6 +240,18 @@ def _flatten_lsblk(nodes):
result.extend(_flatten_lsblk(node.get("children")))
return result
+def _device_serial(device):
+ """Read a disk serial from sysfs when lsblk cannot expose it in Docker."""
+ name = Path(device).name
+ for path in (Path("/sys/class/block") / name / "device/serial", Path("/sys/block") / name / "device/serial"):
+ try:
+ value = path.read_text().strip()
+ if value:
+ return value
+ except OSError:
+ continue
+ return ""
+
def format_transfer_rate(value):
"""Convert mdstat rates such as 133628K/sec into a readable value."""
if not value or value == "—":
@@ -340,7 +352,8 @@ def raid_status():
info = host_items[0] if host_items else {}
except (ValueError, AttributeError):
info = {}
- disk.update({"size": format_bytes(info.get("size") or 0) if info.get("size") else "—", "model": info.get("model") or "—", "serial": info.get("serial") or "—"})
+ serial = info.get("serial") or _device_serial(disk["device"])
+ disk.update({"size": format_bytes(info.get("size") or 0) if info.get("size") else "—", "model": info.get("model") or "—", "serial": serial or "—"})
if SMART_ENABLED and shutil.which("smartctl"):
smart_device = disk["device"].replace("/dev/", f"{HOST_DEVICE_PATH.rstrip('/')}/", 1)
smart_output, _ = _read_command(["smartctl", "-H", smart_device], timeout=6)
diff --git a/templates/index.html b/templates/index.html
index 0b1861d..5c40800 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -195,4 +195,4 @@ document.querySelectorAll('.service-logo img').forEach(img=>{img.style.width='20
setInterval(()=>{document.querySelectorAll('.service-logo svg').forEach(svg=>{svg.style.width='19px';svg.style.height='19px';svg.style.fill='none';svg.style.stroke='currentColor';svg.style.strokeWidth='1.8';svg.style.strokeLinecap='round';svg.style.strokeLinejoin='round'});document.querySelectorAll('.service-logo img').forEach(img=>{img.style.width='20px';img.style.height='20px';img.style.objectFit='contain'})},500);
const settingsBackdrop=document.querySelector('#settingsBackdrop');const closeSettings=()=>settingsBackdrop.classList.add('hidden');document.querySelector('#settingsOpen').addEventListener('click',()=>{loadPreferences();settingsBackdrop.classList.remove('hidden')});document.querySelector('#settingsClose').addEventListener('click',closeSettings);document.querySelector('#settingsCancel').addEventListener('click',closeSettings);settingsBackdrop.addEventListener('click',event=>{if(event.target===settingsBackdrop)closeSettings()});document.querySelector('#settingsSave').addEventListener('click',()=>{localStorage.setItem('preferred-audio',document.querySelector('#preferredAudio').value);localStorage.setItem('preferred-subs',document.querySelector('#preferredSubs').value);loadPreferences();closeSettings()});
-
+