Skip to content

Instantly share code, notes, and snippets.

@samueldr
Created October 30, 2020 19:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save samueldr/c2327ae415da301f9808ecc288169b34 to your computer and use it in GitHub Desktop.
Save samueldr/c2327ae415da301f9808ecc288169b34 to your computer and use it in GitHub Desktop.
~/tmp/tmp ⬤ echo | sfdisk test.img
Checking that no-one is using this disk right now ... OK
Disk test.img: 80 MiB, 83886080 bytes, 163840 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 94AD84CD-9900-488A-B4CA-545BB6FA8EA5
Old situation:
Device Start End Sectors Size Type
test.img1 2048 4095 2048 1M Linux filesystem
test.img2 4096 161791 157696 77M Linux filesystem
>>> Done.
New situation:
Disklabel type: gpt
Disk identifier: 94AD84CD-9900-488A-B4CA-545BB6FA8EA5
Device Start End Sectors Size Type
test.img1 2048 4095 2048 1M Linux filesystem
test.img2 4096 161791 157696 77M Linux filesystem
The partition table has been altered.
Syncing disks.
~/tmp/tmp ⬤ echo print | parted test.img
WARNING: You are not superuser. Watch out for permissions.
GNU Parted 3.3
Using /Users/samuel/tmp/tmp/test.img
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print
Model: (file)
Disk /Users/samuel/tmp/tmp/test.img: 83.9MB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
1 1049kB 2097kB 1049kB no-fs
2 2097kB 82.8MB 80.7MB primary
(parted)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment