LKBEN11657: How to add files in a Disk Image on MacOS.


Symptom

You have a dmg file and would like to edit it.

Cause

-

Solution

First you could check if the dmg file is realy read-only. This can be done by mounting it and you can just hover a file over it. If dropping the file is forebidden, it is read only.

Before you can make changes you need to make a writeable copy of the file. This can be done hdiutil.

hdiutil convert -format UDRW -o Writable-Copy.dmg Original.dmg

You can add files to the Writeable-Copy.dmg.

If you would like to make it Read-Only again, you can use the hdiutil again.

hdiutil convert -format UDRO -o NewReadOnly-Copy.dmg Writeable-Copy.dmg

Have fun.

Disclaimer:

The information provided in this document is intended for your information only. Lubby makes no claims to the validity of this information. Use of this information is at own risk!

About the Author

Author: Wim Peeters - Keskon GmbH & Co. KG

Wim Peeters is electronics engineer with an additional master in IT and over 30 years of experience, including time spent in support, development, consulting, training and database administration. Wim has worked with SQL Server since version 6.5. He has developed in C/C++, Java and C# on Windows and Linux. He writes knowledge base articles to solve IT problems and publishes them on the Lubby Knowledge Platform.

Latest update: 17.03.2023