Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Work Intent: Stop the disks query from spinning up array disks (#2018)

オープン
#2,105 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
64/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
linux, typescript

調査の方向性

Start in disks.service.ts at getDisks(), then read getPhysicalDisks(), parseDisk(), and blockDevices() to understand the current disk shape and partition handling. Run the existing disk-service tests before adding coverage for lsblk mapping, smartctl standby status, device filtering, and ensuring diskLayout() is no longer called. Done means disk-list queries avoid waking standby disks while preserving the expected disk fields and status behavior.

索引モデルが issue の本文から書いたものです。

説明

Overview

Fix #2018. Any query that goes through DisksService.getDisks() wakes every spun-down array disk: disks, disk(id), assignableDisks and the onboarding Internal Boot step (getAssignableDisks() / getInternalBootDevices()). Even { disks { id } } is enough. Anything that polls the disk list keeps large drives from staying in standby.

The cause is the same one #2090 / #2091 found for temperatures: getDisks() builds its list from diskLayout() in systeminformation, which on Linux runs smartctl -a -j and smartctl -H on every disk without -n standby.

I've been running the approach below as a runtime patch on my own server (Unraid 7.3, mixed array with 16 and 18 TB drives) for a few months. With the disks spun down, { disks { id } } spins up every large drive on stock, and none with the patch. The query also goes from several seconds to under 500 ms.

Technical Approach

  • Replace diskLayout() in getDisks() with a listing from lsblk -d -b -J -O, which only reads kernel metadata. Ideally this builds on getPhysicalDisks() from #2091 once it lands, adding the columns getDisks() needs (vendor, firmware revision, rotational) so there is a single place that lists disks.
  • Map each device to the shape diskLayout() returns today, so parseDisk() stays as it is: device, name (model), vendor, serialNum, firmwareRevision, interfaceType (from tran), size in bytes, and type as HD / SSD / NVMe (from rota and tran, same values diskLayout() returns). lsblk reports vendor: "ATA" for SATA drives, so in that case the vendor is derived from the model string.
  • Get smartStatus from smartctl -n standby -H -j <device>. Exit code 2 means the disk is in standby and was not queried, which maps to UNKNOWN.
  • Keep blockDevices() for partitions.
  • Tests: unit tests for the lsblk mapping (size in bytes, drive type, vendor fallback, filtering out loop/ram devices) and for the smartctl status mapping, plus a test that getDisks() no longer calls diskLayout().

Out of scope: the geometry fields on Disk (bytesPerSector, totalSectors, etc.) are non-nullable but diskLayout() already returns null for them on Linux, so selecting them errors today. This change would leave them as they are; happy to look at that separately.

Scope

  • API
  • Plugin
  • Web UI
  • Build/Deploy Process
  • Documentation

Timeline & Impact

  • Estimated time needed: a few days, since the logic already runs as a patch and mostly needs porting and tests. I'd start after #2091 is merged to avoid conflicts in disks.service.ts.
  • Potential impacts: smartStatus becomes UNKNOWN for disks in standby instead of waking them to read it. No schema changes.

Pre-submission Checklist

  • I have searched for similar work/issues
  • I understand this needs approval before starting
  • I am willing to make adjustments based on feedback
主要言語
TypeScript
スター
115
フォーク
23
平均マージ
4日 1時間
マージ済み PR(30日)
7

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

unraid/api のほかの issue

unraid/api の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。