<?xml version="1.0" encoding="UTF-8"?>        <rss version="2.0"
             xmlns:atom="http://www.w3.org/2005/Atom"
             xmlns:dc="http://purl.org/dc/elements/1.1/"
             xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
             xmlns:admin="http://webns.net/mvcb/"
             xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
             xmlns:content="http://purl.org/rss/1.0/modules/content/">
        <channel>
            <title>
									MacOS - Mount/Unmount DMG file from Terminal (works for ISO and IMG as well) - Apple/Mac Hardware				            </title>
            <link>https://www.tweaking4all.com/forum/applemac-hardware/macos-mount-unmount-dmg-file-from-terminal-works-for-iso-and-img-as-well/</link>
            <description>Tweaking4All.com Discussion Board</description>
            <language>en-US</language>
            <lastBuildDate>Mon, 20 Apr 2026 12:19:26 +0000</lastBuildDate>
            <generator>wpForo</generator>
            <ttl>60</ttl>
							                    <item>
                        <title>MacOS - Mount/Unmount DMG file from Terminal (works for ISO and IMG as well)</title>
                        <link>https://www.tweaking4all.com/forum/applemac-hardware/macos-mount-unmount-dmg-file-from-terminal-works-for-iso-and-img-as-well/#post-4401</link>
                        <pubDate>Mon, 19 Sep 2022 08:03:52 +0000</pubDate>
                        <description><![CDATA[Mounting a Disk Image File (DMG) from the Terminal: 
(this works the same for ISO and IMG files as well)
hdiutil attach /path/to/your/diskimage.dmg
When the .dmg is mounted, a message wil...]]></description>
                        <content:encoded><![CDATA[<p>Mounting a Disk Image File (<strong>DMG</strong>) from the Terminal: </p>
<p>(this works the same for <strong>ISO</strong> and <strong>IMG</strong> files as well)<br /><br /></p>
<pre contenteditable="false">hdiutil attach /path/to/your/diskimage.dmg</pre>
<p><br />When the .dmg is mounted, a message will display something like this (not that hditul will try to use the dmg filename as the directory name it creates in /Volumes):</p>
<pre contenteditable="false">$ hdiutil attach diskimage.dmg                                                                                           9:49
Checksumming Gesamte Disk (Apple_HFS : 0)…
...........................................................................................................................................
        Gesamte Disk (Apple_HFS : 0): verified   CRC32 $75753E80
verified   CRC32 $83E2BD54
/dev/disk2          	                               	/Volumes/diskimage</pre>
<p><br />Unmounting a DMG from the Terminal is just as easy:</p>
<div>
<pre contenteditable="false">hditul detach /Volumes/diskimage</pre>
</div>
<div> </div>
<div>or (CAUTION: where /dev/disk2 is the one hdiutil created this during mounting the DMG file)</div>
<div> </div>
<div>
<pre contenteditable="false">hditul detach /dev/disk2</pre>
</div>
<p><br />If you are not sure anymore what was mounted where, then try using this to see a list:</p>
<pre contenteditable="false">hdiutil info</pre>
<p><br />This will output something like this (depending on your situation of course):</p>
<p> </p>
<pre contenteditable="false">framework       : 623.100.1
driver          : 623.100.1
================================================
image-path      : /Users/hans/Downloads/diskimage.dmg
image-alias     : /Users/hans/Downloads/diskimage.dmg
shadow-path     : &lt;none&gt;
icon-path       : /System/Library/PrivateFrameworks/DiskImages.framework/Resources/CDiskImage.icns
image-type      : UDIF read-only compressed (zlib)
system-image    : false
blockcount      : 32768
blocksize       : 512
writeable       : false
autodiskmount   : TRUE
removable       : TRUE
image-encrypted : false
mounting user   : hans
mounting mode   : &lt;unknown&gt;
process ID      : 52538
framework name  : DiskImages
/dev/disk2		/Volumes/diskimage</pre>]]></content:encoded>
						                            <category domain="https://www.tweaking4all.com/forum/applemac-hardware/">Apple/Mac Hardware</category>                        <dc:creator>Hans</dc:creator>
                        <guid isPermaLink="true">https://www.tweaking4all.com/forum/applemac-hardware/macos-mount-unmount-dmg-file-from-terminal-works-for-iso-and-img-as-well/#post-4401</guid>
                    </item>
							        </channel>
        </rss>
		