I just downloaded the Debian and Arch Linux files and I would like to mount before I burn into the SD card. How can I mount the img?

I tried to mount but I'm getting the following error:

sudo mount -o loop archlinuxarm-13-06-2012.img /mnt/
mount: you must specify the filesystem type

Is that yaffs2? How can I mount the yaffs2, as far as I know it's not supported yet under Ubuntu 12.04, and I couldn't find any package.


3 Answers 3


The Hard Way

Read my other answer on Is it possible to update, upgrade and install software before flashing an image?.

You need to calculate the offset of the filesystem you wish to mount.

The Easy, yet experimental way

Consider using my new utility piimg. Just build and run

$ sudo ./piimg mount archlinuxarm-13-06-2012.img /mnt

NOTE This hasn't been fully tested yet.

What does piimg do?

piimg performs a series of mounts by analysing the image and setting up the correct loop devices and mounts. It mounts / first, then /boot, binds/dev (recursively), binds /sys and creates /proc. You need to do the opposite to unmount, but there should be a umount subcommand soon.

DISCLAIMER I, Alex Chamberlain, am the lead developer of piimg. As such, I may be biased towards the use of piimg in relation to other methods.

  • @iungi Which method did you use? Commented Jul 17, 2012 at 8:29
  • Thank you for this valuable work. I just pointed out that it is necessary to install the package libparted0-dev to build correctly. I will use your utility and I'll point out potential problems. Just a little note: it seems more logical to install in /usr/local/sbin a program reserved for root ! Best regards.
    – user6426
    Commented Mar 11, 2013 at 21:55
  • <br/> Another note, there is an oversight in your command line:<br/> $ sudo ./piimg mount sd.img /mnt
    – user6428
    Commented Mar 11, 2013 at 22:25
  • @MarkBooth I haven't worked on piimg for a long time. I guess that the docs for that need updating, rather than this answer (given it doesn't tell you how to build it!) Commented Mar 12, 2013 at 11:15
  • @MarkBooth Oh there were 2. Yes, it needs updating. Done Commented Mar 12, 2013 at 11:15

The problem is that the image is a complete disk image including a partition table, not an image of an individual partition.

Theres a couple of ways round this, one way is to calculate an offset and use that for mounting (see alex's answer for more details).

Another way if you have a recent kernel and a recent version of losetup is to use the -P option to losetup e.g.

losetup -P -f <filename>

this will create a series of device nodes. The main /dev/loop<number> node and also nodes for each partition at /dev/loop<number>p<number> . You can then work with the device like any other paritioned device.

When you have finished you can remove the loopback device with

losetup -d /dev/loop<number>


The super easy way: gnome-disks

Then click the 'hamburger' next to 'Disks' and choose the option 'Attach Disk Image (.Iso, .Img)'.

I used it without problems to mount a Dietpi Raspberry Pi image with WinDiskImager.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.