LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Mounting IMG file (https://www.linuxquestions.org/questions/linux-newbie-8/mounting-img-file-4175612923/)

GJQ 08-30-2017 10:58 AM

Mounting IMG file
 
Dear LQ member
I am currently having problem mounting img file.Appreciate anyone to have a step by step I am trying to convert the IMG file to ISO for installation of the OS to Macbook. My Errors details as below:

macbook@macbook-MacBook ~/Desktop $ dmg2img /home/macbook/Desktop/MacOSXUpd10.5.5.dmg /home/macbook/Desktop/MacOSXUpd10.5.5.img

dmg2img v1.6.5 (c) vu1tur (to@vu1tur.eu.org)

/home/macbook/Desktop/MacOSXUpd10.5.5.dmg --> /home/macbook/Desktop/MacOSXUpd10.5.5.img


decompressing:
opening partition 0 ... 100.00% ok
opening partition 1 ... 100.00% ok
opening partition 2 ... 100.00% ok
opening partition 3 ... 100.00% ok
opening partition 4 ... 100.00% ok
opening partition 5 ... 100.00% ok

Archive successfully decompressed as /home/macbook/Desktop/MacOSXUpd10.5.5.img
macbook@macbook-MacBook ~/Desktop $ mkdir /media/image
mkdir: cannot create directory ‘/media/image’: Permission denied
macbook@macbook-MacBook ~/Desktop $ sudo -s
[sudo] password for macbook:
macbook-MacBook Desktop # mkdir /media/image
macbook-MacBook Desktop # sudo modprobe hfsplus
macbook-MacBook Desktop # sudo mount -t hfsplus -o loop MacOSXUpd10.5.5.img /media/image
mount: wrong fs type, bad option, bad superblock on /dev/loop0,
missing codepage or helper program, or other error

In some cases useful info is found in syslog - try
dmesg | tail or so.





Appreciate to all the help
Thank you

grail 08-30-2017 08:25 PM

What happens if you remove the -t hfsplus?

Was there any valuable information in dmesg or syslog? (as suggested)

IsaacKuo 08-30-2017 08:50 PM

If this img file contains more than one partition, then it may be an image of the device (including multiple partitions and a partition table) rather than an image of just a partition (which is what's needed to mount via loop).

frankbell 08-30-2017 09:38 PM

This old LQ thread may help: https://www.linuxquestions.org/quest...g-file-882386/

jefro 08-30-2017 10:11 PM

http://osxdaily.com/2011/12/17/mount...e-in-mac-os-x/ mount it and use it from macos?

GJQ 08-30-2017 10:26 PM

Hi Grail
I got this error when mounting -t hfsplus as you advised.

macbook@macbook-MacBook ~ $ sudo mount -o loop MacOSXUpd10.5.5.img /media/image[sudo] password for macbook:
mount: MacOSXUpd10.5.5.img: failed to setup loop device: No such file or directory
macbook@macbook-MacBook ~ $

Thank you

GJQ 08-30-2017 10:34 PM

Quote:

Originally Posted by jefro (Post 5753984)

Hi Jefro
Right now the macbook is install with Linux Mint 18.2. I have got rEFind install in the Macbook. When I slot in the original DVD that contain the OS in the Macbook CD/DVD Drive and reboot the system I am able to see the Mac OS in rEFind and when I select it,nothing go and it revert back to Linux Mint OS which is install in the system.

I have gone to Apple site and download mac OS 10.5.5 in DMG format and have converted into IMG. The file has been converted successfully. I am now stuck at mounting the IMG file into folder Media/IMAGE as advise by http://dailytechnologiesupdate.blogs...in-ubuntu.html, I have got the Media/Image folder created.

Thank you

grail 08-31-2017 08:57 AM

Code:

mount: MacOSXUpd10.5.5.img: failed to setup loop device: No such file or directory
Are you sure your kernel has loop enabled in it? And it is loaded?

Try:
Code:

lsmod | grep loop
If no output you may need to modprobe it and then try again.

schneidz 08-31-2017 09:15 AM

Quote:

Originally Posted by IsaacKuo (Post 5753962)
If this img file contains more than one partition, then it may be an image of the device (including multiple partitions and a partition table) rather than an image of just a partition (which is what's needed to mount via loop).

yes, file would tell us the file type.
Code:

file MacOSXUpd10.5.5.img
kpartx is useful for mounting disk images with multiple partitions. not sure if it is available for mac.

should this be moved to the other-*nix sub-forum.

GJQ 08-31-2017 09:51 AM

Hi Grail
Please the output as below

macbook@macbook-MacBook ~ $ lsmod | grep loop
macbook@macbook-MacBook ~ $ lsmod | grep loop
macbook@macbook-MacBook ~ $

How do I check loop enabled and is loaded?

Thank you

GJQ 08-31-2017 09:53 AM

Quote:

Originally Posted by schneidz (Post 5754117)
yes, file would tell us the file type.
Code:

file MacOSXUpd10.5.5.img
kpartx is useful for mounting disk images with multiple partitions. not sure if it is available for mac.

should this be moved to the other-*nix sub-forum.

Hi schneidz
Please see output as below

macbook@macbook-MacBook ~/Desktop $ file MacOSXUpd10.5.5.img
MacOSXUpd10.5.5.img: Apple Driver Map, blocksize 2048, blockcount 173721, devtype 0, devid 0, descriptors 0, contains[@0x800]: Apple Partition Map, map block count 4, start block 1, block count 15, name Apple, type Apple_partition_map, contains[@0x1000]: Apple Partition Map, map block count 4, start block 16, block count 1, name Macintosh, type Apple_Driver_ATAPI, contains[@0x1800]: Apple Partition Map, map block count 4, start block 18, block count 173700, name Mac_OS_X, type Apple_HFS, contains[@0x2000]: Apple Partition Map, map block count 4, start block 173718, block count 3, type Apple_Free
macbook@macbook-MacBook ~/Desktop $

schneidz 08-31-2017 10:39 AM

^ (code tags please)
does kpartx work ?:
Code:

kpartx -av MacOSXUpd10.5.5.img

GJQ 08-31-2017 09:33 PM

Quote:

Originally Posted by schneidz (Post 5754137)
^ (code tags please)
does kpartx work ?:
Code:

kpartx -av MacOSXUpd10.5.5.img

Hi Schneidz
Please find the output as below:

macbook@macbook-MacBook ~ $ kpartx -av MacOSXUpd10.5.5.img
/dev/mapper/control: open failed: Permission denied
Failure to communicate with kernel device-mapper driver.
Incompatible libdevmapper (unknown version) and kernel driver (unknown version).
device mapper prerequisites not met
macbook@macbook-MacBook ~ $

Thank you

grail 08-31-2017 11:54 PM

Probably need to run kpartx as root, ie sudo.

Try running the modprobe first:
Code:

modprobe loop
lsmod | grep loop

Assuming you now get output for the above you can try the mount again.

Although it may still error if a multi-partitioned image.

schneidz 09-01-2017 06:39 AM

i just remembered you can fdisk image backups. this mite yield some basic info:
Code:

sudo fdisk -l MacOSXUpd10.5.5.img


All times are GMT -5. The time now is 09:24 PM.