Configuration options for StorageDevice model instances.

This interface defines the complete configuration structure for individual storage devices, including hardware identification, mount information, and runtime metrics. These options are typically populated from storage device discovery services and WebSocket updates.

Example: Basic Usage

const device = StorageDevice.instance('usb-backup')
.options({
mountDir: '/media/usb-drive',
vendor: 'SanDisk',
model: 'Ultra USB 3.0',
label: 'BACKUP_DRIVE',
nodeId: 'primary',
local: true,
removed: false,
runTimeMs: 1800000,
syspath: '/sys/devices/usb1'
})
.build();
interface StorageDeviceOptions {
    mountDir: string;
    removed: boolean;
    vendor: string;
    runTimeMs: number;
    model: string;
    nodeId: string;
    local: boolean;
    label: string;
    syspath: string;
}

Hierarchy

  • KosParentAware
    • StorageDeviceOptions

Properties

mountDir: string

File system mount directory path where the device is accessible. Empty string indicates the device is not currently mounted.

Example

"/media/usb-drive"

Example

"/mnt/backup-storage"

Example

"" // Not mounted
removed: boolean

Indicates whether the storage device has been physically removed. When true, the device is no longer accessible and mount operations will fail.

Default

false
vendor: string

Hardware vendor/manufacturer name of the storage device. Used for device identification and display purposes.

Example

"SanDisk"

Example

"Western Digital"

Example

"Samsung"
runTimeMs: number

Total runtime in milliseconds since the device was first connected. Tracks cumulative usage time for analytics and maintenance scheduling.

Example

1800000 // 30 minutes

Example

3600000 // 1 hour
model: string

Hardware model name/number of the storage device. Combined with vendor for complete device identification.

Example

"Ultra USB 3.0"

Example

"My Passport"

Example

"EVO Select 64GB"
nodeId: string

KOS node identifier where this storage device is physically connected. Used in multi-node systems to track device distribution.

Example

"primary"

Example

"secondary"

Example

"embedded-node-1"
local: boolean

Indicates if the device is connected to the local node (true) or remote node (false). Determines accessibility and operation capabilities from current context.

Default

true
label: string

File system label/name assigned to the storage device. Used for user-friendly identification and mount point organization.

Example

"BACKUP_DRIVE"

Example

"CONFIG_STORAGE"

Example

"DATA_ARCHIVE"
syspath: string

System device path in the Linux device tree. Low-level hardware identifier for device tracking and diagnostics.

Example

"/sys/devices/pci0000:00/usb1/1-2"

Example

"/sys/devices/mmc0/mmc0:0001"

Example

"/sys/devices/platform/sdhci"