I like to play with the BeagleBone Black (BBB) board. Sometimes I need to edit or add files to the image before running on the board so it's useful to be able to mount the image directly on my Linux PC to work on it.
After you extracted the image you must use fdisk to find the offset we'll use to mount the image partition:
Press 'p' to print image detail and you get:
Command (m for help): p Disk bone-debian-8.2-console-armhf-2015-11-29-2gb.img: 1782 MB, 1782579200 bytes 184 heads, 31 sectors/track, 610 cylinders, total 3481600 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 Disk identifier: 0x77b67e54 Device Boot Start End Blocks Id System bone-debian-8.2-console-armhf-2015-11-29-2gb.img1 * 2048 3481599 1739776 83 Linux Command (m for help):
you need the partition start sector: 2048 . Then you must multiply it with the sector size (512):
2048 * 512 = 1048576
that number must be used as offset to mount the image:
mkdir /mnt/bbb-image mount -o loop,offset=1048576 bone-debian-8.2-console-armhf-2015-11-29-2gb.img /mnt/bbb-image
Now whatever you do in the mounted partition will be available when you'll run the image on a real BBB.
For example I usually mount the image partition as explained to have a local sysroot to build Qt libs for my BBB. In a next article I'll explain better how to built Qt.