Skip to content

Instantly share code, notes, and snippets.

@fessyfoo
Created February 12, 2013 18:51
Show Gist options
  • Select an option

  • Save fessyfoo/4772245 to your computer and use it in GitHub Desktop.

Select an option

Save fessyfoo/4772245 to your computer and use it in GitHub Desktop.
copy partition tables from one disk to another using sfdisk
#!/bin/sh
bail () {
echo "$@"
exit 1;
}
test -z "$2" && bail "Usage: $0 FROMDEV TODEV"
set -x
sfdisk -d "$1" | sfdisk "$2"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment