system: return the mounted and unmounted block devices (as long as xfs or ext4)

This commit is contained in:
Girish Ramakrishnan
2025-09-23 17:30:09 +02:00
parent 8668ff8939
commit f92cdf36f5
7 changed files with 43 additions and 38 deletions
+4 -3
View File
@@ -327,13 +327,14 @@ async function getBlockDevices() {
const result = [];
for (const device of devices) {
const mountpoints = Array.isArray(device.mountpoints) ? device.mountpoints : [ device.mountpoint ]; // we only support one mountpoint here old lsblk only exposed one via .mountpoint
if (mountpoints.includes('/') || mountpoints.includes('/boot')) continue; // cannot be used for backups and volumes
const mountpoints = Array.isArray(device.mountpoints)
? (device.mountpoints[0] === null ? [] : device.mountpoints) // convert [ null ] to []
: (device.mountpoint ? [ device.mountpoint ] : []); // old lsblk only exposed one .mountpoint
result.push({
path: device.name,
size: device.fsavail || 0,
type: device.fstype,
type: device.fstype, // when null, it is not formatted
uuid: device.uuid,
rota: device.rota, // false (ssd) true (hdd) . unforuntately, this is not set correctly when virtualized (like in DO)
mountpoints