add fsused to block_devices output
This commit is contained in:
+2
-1
@@ -324,7 +324,7 @@ async function getLogs(unit, options) {
|
||||
|
||||
// this gets block devices as opposed to mounted filesystems. this is used for configuring backups and volumes in the frontend
|
||||
async function getBlockDevices() {
|
||||
const output = await shell.spawn('lsblk', ['--paths', '--json', '--list', '--fs', '--output', '+rota'], { encoding: 'utf8' });
|
||||
const output = await shell.spawn('lsblk', ['--paths', '--bytes', '--json', '--list', '--fs', '--output', '+rota,fsused,fsavail'], { encoding: 'utf8' });
|
||||
const info = safe.JSON.parse(output);
|
||||
if (!info) throw new BoxError(BoxError.INTERNAL_ERROR, `failed to parse lsblk: ${safe.error.message}`);
|
||||
|
||||
@@ -340,6 +340,7 @@ async function getBlockDevices() {
|
||||
result.push({
|
||||
path: device.name,
|
||||
size: device.fsavail || 0,
|
||||
used: device.fsused || 0,
|
||||
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)
|
||||
|
||||
Reference in New Issue
Block a user