Only list ext4 block devices
This commit is contained in:
@@ -339,14 +339,14 @@ async function getBlockDevices() {
|
||||
let info;
|
||||
|
||||
try {
|
||||
info = JSON.parse(execSync('lsblk --paths --json --list --bytes', { encoding: 'utf8' }));
|
||||
info = JSON.parse(execSync('lsblk --paths --json --list --fs', { encoding: 'utf8' }));
|
||||
} catch (e) {
|
||||
console.error('Failed to list disks:', e);
|
||||
throw new BoxError(BoxError.INTERNAL_ERROR, e);
|
||||
}
|
||||
|
||||
// remove empty disks (disks with partitions)
|
||||
const devices = info.blockdevices.filter(d => d.size);
|
||||
// filter only for ext4 disks
|
||||
const devices = info.blockdevices.filter(d => d.fstype === 'ext4');
|
||||
|
||||
debug(`getBlockDevices: Found ${devices.length} devices. ${devices.map(d => d.name).join(', ')}`);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user