As 62914560 points exactly 60MiB into the file, I think the best guess would be that the Raspian disk image is actually partitioned. The offset tells mount
(or actually losetup
) the actual offset of the root file-system (I suggest this is the second of two partitions, the first most-probably being /boot
resp. the bootloader/firmware files).
The problem here is that even though the loop
driver actually supports partitioned images, the number of maximum partitions per loop
device has to be specified as a module parameter when loading the module (or on the kernel command line). As there are many distros out there that won't do this by default, ...,offset=XXX
is the most reliable way to cope with partitioned images when loop
uses the default parameter (which is 0, hence no partition support).
You can test whether your loop
driver was loaded with partition-support by looking into /sys/module/loop/parameters/max_part
. On my current system (ArchLinux), after loading loop
without parameters this is:
$ cat /sys/module/loop/parameters/max_part
0
To enable partitioning-support, you will have to unload loop
and load it again with the desired value for the max_part
options, e.g.
# modprobe -r loop
# modprobe loop max_part=8
After this, you could try to manually set-up the loop-device for your image by doing
# losetup /dev/loop0 /path/to/<date>-wheezy-raspbian.img
Now, you should not only see /dev/loop0
representing the whole image, but (as long as my theory is correct ;) also have /dev/loop0p1
, /dev/loop0p2
, etc., for all partitions in the image (see losetup
script example).
Edit:
If you want to do this yourself the tedious way (I'd suggest simply reloading loop
with the correct max_part
option and simply using the partitions), you could find out which offset is required by using fdisk
directly on the image-file (shown with an ArchLinux ISO, as I had it on hand, but the idea is the same):
$ fdisk -l archlinux-2016.03.01-dual.iso
Disk archlinux-2016.03.01-dual.iso: 268.3 MiB, 281339392 bytes, 549491 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: 0x2237702c
Device Boot Start End Sectors Size Id Type
archlinux-2016.03.01-dual.iso1 * 0 1452031 1452032 709M 0 Empty
archlinux-2016.03.01-dual.iso2 172 63659 63488 31M ef EFI (FAT-12/16/32)
The second partition starts at sector 172 with a sector size of 512 bytes. Multiplying both values gives you the offset in bytes, thus to mount the partition, you'll use:
# mount -o loop,offset=$((172*512)) archlinux-2016.03.01-dual.iso /mnt
# ls -l /mnt
total 4
drwxr-xr-x 4 root root 2048 Mar 1 15:49 EFI
drwxr-xr-x 3 root root 2048 Mar 1 15:49 loader
Voila.
fdisk -l date>-wheezy-raspbian.img
please. – Rui F Ribeiro Mar 16 '16 at 15:17-l
– Rui F Ribeiro Mar 16 '16 at 17:20