Skip to content

Instantly share code, notes, and snippets.

@gpolitis
Created July 31, 2011 17:03
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gpolitis/1116968 to your computer and use it in GitHub Desktop.
Save gpolitis/1116968 to your computer and use it in GitHub Desktop.
Fix Number of Hidden Sectors in NTFS Bios Parameter Block
#!/bin/sh
DEVICE=$1
SECTOR=$(sfdisk -luS|grep $DEVICE|gawk '{print $2}')
echo $SECTOR | gawk '{printf("%c%c%c%c",$1,rshift($1,8),rshift($1,16),rshift($1,24))}' | dd bs=1 count=4 seek=28 of=$DEVICE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment