LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-30-2017, 10:58 AM   #1
GJQ
Member
 
Registered: Jun 2009
Location: Malaysia
Distribution: Ubuntu 11.04
Posts: 104

Rep: Reputation: 17
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
 
Old 08-30-2017, 08:25 PM   #2
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 9,818

Rep: Reputation: 3083Reputation: 3083Reputation: 3083Reputation: 3083Reputation: 3083Reputation: 3083Reputation: 3083Reputation: 3083Reputation: 3083Reputation: 3083Reputation: 3083
What happens if you remove the -t hfsplus?

Was there any valuable information in dmesg or syslog? (as suggested)
 
Old 08-30-2017, 08:50 PM   #3
IsaacKuo
Senior Member
 
Registered: Apr 2004
Location: Baton Rouge, Louisiana, USA
Distribution: Debian 9 Stretch
Posts: 2,381
Blog Entries: 8

Rep: Reputation: 408Reputation: 408Reputation: 408Reputation: 408Reputation: 408
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).
 
1 members found this post helpful.
Old 08-30-2017, 09:38 PM   #4
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 17,386
Blog Entries: 27

Rep: Reputation: 5405Reputation: 5405Reputation: 5405Reputation: 5405Reputation: 5405Reputation: 5405Reputation: 5405Reputation: 5405Reputation: 5405Reputation: 5405Reputation: 5405
This old LQ thread may help: https://www.linuxquestions.org/quest...g-file-882386/
 
1 members found this post helpful.
Old 08-30-2017, 10:11 PM   #5
jefro
Moderator
 
Registered: Mar 2008
Posts: 20,836

Rep: Reputation: 3370Reputation: 3370Reputation: 3370Reputation: 3370Reputation: 3370Reputation: 3370Reputation: 3370Reputation: 3370Reputation: 3370Reputation: 3370Reputation: 3370
http://osxdaily.com/2011/12/17/mount...e-in-mac-os-x/ mount it and use it from macos?
 
Old 08-30-2017, 10:26 PM   #6
GJQ
Member
 
Registered: Jun 2009
Location: Malaysia
Distribution: Ubuntu 11.04
Posts: 104

Original Poster
Rep: Reputation: 17
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
 
Old 08-30-2017, 10:34 PM   #7
GJQ
Member
 
Registered: Jun 2009
Location: Malaysia
Distribution: Ubuntu 11.04
Posts: 104

Original Poster
Rep: Reputation: 17
Quote:
Originally Posted by jefro View Post
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
 
Old 08-31-2017, 08:57 AM   #8
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 9,818

Rep: Reputation: 3083Reputation: 3083Reputation: 3083Reputation: 3083Reputation: 3083Reputation: 3083Reputation: 3083Reputation: 3083Reputation: 3083Reputation: 3083Reputation: 3083
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.
 
Old 08-31-2017, 09:15 AM   #9
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fedora-30
Posts: 5,290

Rep: Reputation: 916Reputation: 916Reputation: 916Reputation: 916Reputation: 916Reputation: 916Reputation: 916Reputation: 916
Quote:
Originally Posted by IsaacKuo View Post
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.

Last edited by schneidz; 08-31-2017 at 09:18 AM.
 
Old 08-31-2017, 09:51 AM   #10
GJQ
Member
 
Registered: Jun 2009
Location: Malaysia
Distribution: Ubuntu 11.04
Posts: 104

Original Poster
Rep: Reputation: 17
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
 
Old 08-31-2017, 09:53 AM   #11
GJQ
Member
 
Registered: Jun 2009
Location: Malaysia
Distribution: Ubuntu 11.04
Posts: 104

Original Poster
Rep: Reputation: 17
Quote:
Originally Posted by schneidz View Post
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 $
 
Old 08-31-2017, 10:39 AM   #12
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fedora-30
Posts: 5,290

Rep: Reputation: 916Reputation: 916Reputation: 916Reputation: 916Reputation: 916Reputation: 916Reputation: 916Reputation: 916
^ (code tags please)
does kpartx work ?:
Code:
kpartx -av MacOSXUpd10.5.5.img
 
Old 08-31-2017, 09:33 PM   #13
GJQ
Member
 
Registered: Jun 2009
Location: Malaysia
Distribution: Ubuntu 11.04
Posts: 104

Original Poster
Rep: Reputation: 17
Quote:
Originally Posted by schneidz View Post
^ (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
 
Old 08-31-2017, 11:54 PM   #14
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 9,818

Rep: Reputation: 3083Reputation: 3083Reputation: 3083Reputation: 3083Reputation: 3083Reputation: 3083Reputation: 3083Reputation: 3083Reputation: 3083Reputation: 3083Reputation: 3083
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.
 
1 members found this post helpful.
Old 09-01-2017, 06:39 AM   #15
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fedora-30
Posts: 5,290

Rep: Reputation: 916Reputation: 916Reputation: 916Reputation: 916Reputation: 916Reputation: 916Reputation: 916Reputation: 916
i just remembered you can fdisk image backups. this mite yield some basic info:
Code:
sudo fdisk -l MacOSXUpd10.5.5.img
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Mounting .img file (chromiumos.img); can't mount it?? Help please? linus72 Linux - General 2 11-27-2009 08:11 PM
Mounting a .img file? RoaCh Of DisCor Linux - Newbie 2 07-12-2005 02:49 PM
Mounting IMG file on suse 9.3 fireedo Linux - General 3 05-23-2005 03:05 AM
mounting a .img file... username-inuse Linux - Software 3 05-01-2005 02:46 PM
mounting a img file kudos Slackware 2 04-30-2003 02:54 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:35 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration