Skip to content

Instantly share code, notes, and snippets.

@dubcl
Last active September 4, 2017 17:48
Show Gist options
  • Save dubcl/ebcbe7c45116a959ec13410f66c28e08 to your computer and use it in GitHub Desktop.
Save dubcl/ebcbe7c45116a959ec13410f66c28e08 to your computer and use it in GitHub Desktop.
mount img
$ sudo fdisk -l image.img
Disk image.img: 1 GiB, 1073741824 bytes, 2097152 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: dos
Disk identifier: 0x9ed733a5
Device Boot Start End Sectors Size Id Type
image.img1 2048 2097151 2095104 1023M 83 Linux
################
Calculate offset: Start * Sectors
2048 * 512 = 1048576
################
mount -o loop,offset=1048576 /foo/image.img /bar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment