Linux Bockdevice library for Node.js
List all block devices
options.probeprobe devices for PARTUUID and PTUUID
Find information about block device
options.deviceNamedevice name, e.g. loop0options.probeprobe device for PARTUUID and PTUUID
Find information about block device
options.devicePathdevice path, e.g. /dev/loop0options.probeprobe device for PARTUUID and PTUUID
Name of the block device, e.g. "loop0"
Size of block device in sectors (512-byte blocks)
Size of block device in bytes
Major device number
Minor device number
Partition table UUID, if probed and available
params.flagsopen flags, can be either"r","w"or"r+"
A partition has all fields of a block device, but additionally following fields.
Start offset of partition inside block device in sectors (512-byte blocks)
Start offset of partition inside block device in bytes
Partition number
Partition UUID, if probed and available
import blockdev from "linux-blockdev";
const blockDevices = await blockdev.findAll();
console.log("blockDevices =", JSON.stringify(blockDevices, null, 2));