Linux Bockdevice library for Node.js
List all block devices
options.probe
probe devices for PARTUUID and PTUUID
Find information about block device
options.deviceName
device name, e.g. loop0options.probe
probe device for PARTUUID and PTUUID
Find information about block device
options.devicePath
device path, e.g. /dev/loop0options.probe
probe 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.flags
open 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));