1

I have an img file. I mount it using this command

mount -o loop,offset=70254592 image/2016-05-10-raspbian-jessie-lite.img /mnt/raspberry-rootfs

But I must do that every time I power up my computer. Is there a method to mount it using the fstab file?

I don't know what to put in the system type. I tried iso9660 and ext4 but this doesn't work. The fdisk -l command gives me this output:

Disk 2016-05-10-raspbian-jessie-lite.img: 1,3 GiB, 1386217472 bytes, 2707456 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: 0x84f9d19f

Device                               Boot  Start     End Sectors  Size Id Type
2016-05-10-raspbian-jessie-lite.img1        8192  137215  129024   63M  c W95 FAT3
2016-05-10-raspbian-jessie-lite.img2      137216 2707455 2570240  1,2G 83 Linux
  • 1
    what is the result of ` mount |grep rapsberry ` when you have mounted manualy ? – Archemar Nov 28 '16 at 10:18
  • @Archemar, it gives ext4 /home/mdababi/Bureau/Tools/image/2016-05-10-raspbian-jessie-lite.img on /mnt/raspberry-rootfs type ext4 (rw,relatime,data=ordered) – Dababi Nov 28 '16 at 10:23
  • will it mount if you use ' mount -o loop,offset=70254592 -t ext4 image/2016-05-10-raspbian-jessie-lite.img /mnt/raspberry-rootfs' (please note ` -t ext4 ` ) ? – Archemar Nov 28 '16 at 10:35
  • yes this worked. – Dababi Nov 28 '16 at 10:43
0

It looks like img is a two part, vfat and ext4.

I would try

/path/to.img /mount/point ext4 loop,offset=70254592 2 0 

with

  • /path/to.img being /home/mdababi/Bureau/Tools/image/2016-05-10-raspbian-jessie-‌​lite.img
  • /mount.point /mnt/raspberry-rootfs

depending on your need, you may add read-only (ro) flag as well on fourth field.

edit: replace 0 with 2 in fifth field, thus mount will be tried once all other directories are mounted.

  • unfortunatly, this doesn't work. When i reboot my computer, it enter in emergency mode. – Dababi Nov 28 '16 at 10:50
  • try without loop option. – Archemar Nov 28 '16 at 10:52
  • no it doesn't work. – Dababi Nov 28 '16 at 11:05
  • Don't use parallel mount! Your system uses parallel mount for all devices, so it tries to mount /path/... when /path/... isn't mounted yet. – Ipor Sircer Nov 28 '16 at 11:16
  • @IporSircer , I understand the problem now. I know that the kernel mounts the racine / read only and then starts the init process (SysVinit startup). So when the /path is mounted ? – Dababi Nov 28 '16 at 13:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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