Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

gpt

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gpt

GUID Partition Table (GPT)

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

GPT - GUID Partition Table

npm npm downloads build status

Install via npm

$ npm install --save gpt

What can I do with this?

  • Format disks / images
  • Fix a partition table, recover a deleted partition
  • Recover the GUID Partition Table from its backup
  • Locate partitions which are inaccessible / ignored by the OS
  • Verify the integrity of the primary GPT against its backup

Usage

var GPT = require( 'gpt' )
// Parse a buffer read from disk
var gpt = GPT.parse( buffer, options )
// Or, create a new one
var gpt = new GPT({
  // The block size of the device
  // the GPT will be written to
  // (optional, defaults to 512)
  blockSize: 512,
  // Header size in bytes
  // (min. 92, defaults to 92)
  headerSize: 92,
  // LBA of current GPT copy
  currentLBA: 1,
  // LBA of backup GPT
  backupLBA: 123456,
  // LBA of first "user-space" block
  firstLBA: 34,
  // LBA of last "user-space" block
  lastLBA: 556789,
  // LBA of partition table
  // (defaults to 2)
  tableOffset: 2,
  // Number of partition entries
  // (min. 128, defaults to 128)
  entries: 128,
  // Size of partition entry in bytes
  // (defaults to 128)
  entrySize: 128,
})
// Get the buffers
var buffer = gpt.toBuffer()
var headerBuffer = gpt.toBuffer( true, false )
var tableBuffer = gpt.toBuffer( false, true )
// Verify against a backup GPT
gpt.verify( backupGPT )

Keywords

FAQs

Package last updated on 04 Oct 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc