Install via npm
$ npm install --save blockdevice
- example/mbr.js: Reading the Master Boot Record of a device
- options: Object
- fs: require( 'fs' ), optional; custom 'fs' instance
- fd: Number, optional; file descriptor
- path: String, optional if
fd
is given - mode: String, optional if
fd
is given - blockSize: Number, optional
- size: Number, optional
- headsPerTrack: Number, optional
- sectorsPerTrack: Number, optional
- id: Number
- callback: function( err, fd )
- callback: function( err )
- size: Number, initial block size to be checked
- step: Number, block size increment
- limit: Number, maximum block size to be checked
- callback: function( err, blockSize )
- step: Number, size increment
- callback: function( err, size )
- options: Object
- firstLBA: Number, first logical block of partition
- lastLBA: Number, last logical block of partition
- cylinder: Number
- head: Number
- sector: Number
- offset: Number
- length: Number
- buffer: Buffer, optional
- callback: function( err, buffer, bytesRead )
INTERNAL. Used by .readBlocks()
.
- fromLBA: Number
- toLBA: Number
- buffer: Buffer, optional
- callback: function( err, buffer, bytesRead )
- offset: Number
- buffer: Buffer
- callback: function( err, bytesWritten )
INTERNAL. Used by .writeBlocks()
.
- fromLBA: Number
- buffer: Buffer
- callback: function( err, bytesWritten )
- options: Object
- firstLBA: Number, first logical block of partition
- lastLBA: Number, last logical block of partition
- lba: Number, logical block address
INTERNAL. Determines if a given LBA is out of bounds of the partition.
- from: Number
- to: Number
- buffer: Buffer
- callback: function( err, buffer, bytesRead )
- from: Number
- data: Buffer
- callback: function( err, bytesWritten )