12

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.

Alex Chamberlain
  • 15,530
  • 14
  • 67
  • 113
Mokus
  • 983
  • 5
  • 10
  • 19

3 Answers3

12

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.

Alex Chamberlain
  • 15,530
  • 14
  • 67
  • 113
2

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>

Peter Green
  • 6,476
  • 1
  • 19
  • 24
0

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.

MatsK
  • 2,791
  • 3
  • 16
  • 20
user3817445
  • 101
  • 1