Skip to main content

Questions tagged [hdiutil]

hdiutil is a command line tool for manipulating disk images (attach, verify, burn, etc).

Filter by
Sorted by
Tagged with
2 votes
0 answers
52 views

Sparse disk image error 'No space left on device' while limit not reached

I created a sparse disk image of 400 GB with hdiutil command on an empty 500 GB external drive. After I have attached the disk image, I copy data to it. After about 17 GB of data I get an error ...
Robertico's user avatar
  • 121
1 vote
1 answer
39 views

How to attach a DMG with different mount AND browse name?

I have a DMG foo.dmg which when I attach it via hdiutil attach foo.dmg appears in the Terminal under path /Volumes/foo and in the Finder side bar as "foo". Now when attaching the DMG I want ...
halloleo's user avatar
  • 1,417
0 votes
0 answers
24 views

Why does using the same name for -volname and -srcfolder result in 'operation not permitted' error?

I have a file called installer.app. I am using the script below to create a DMG: appName=installer installerFile=installer.app dmgFile=installer.dmg hdiutil create -volname "${appName}" -...
slow_learner's user avatar
1 vote
0 answers
47 views

How to clone entire drive of 2018 MacBook Pro?

I have a 2018 MacBook Pro I borrowed and need to return. I already have a cloud backup but wanted a full disk clone for extra safety. All my attempts are done in Recovery Mode. I first tried to clone ...
Joy Jin's user avatar
  • 2,833
0 votes
1 answer
242 views

hdiutil: create failed - Operation timed out

I am trying to create a Backup.dmg disk image in a folder on an SMB file system. Using Disk Utility Using hdiutil hdiutil create -size 4t -fs APFS -volname backup Backup.dmg Both operations start, ...
Eric Kolotyluk's user avatar
0 votes
0 answers
184 views

Should hdiutil create image from physical or synthesized disk?

When using hdiutil to create a backup image from a terminal in recovery mode (Command-R) hdiutil create -srcdevice /dev/disk3 /Volumes/backups/<name> where disk3 is the "synthesized" ...
samus's user avatar
  • 204
0 votes
0 answers
103 views

How do I compress an encrypted time machine disk image?

I have an archived read-only Time Machine drive sitting on a NAS. It is a straight dump (made with dd) of a CoreStorage encrypted HFS+ hard disk. It's taking up 10TB, and I expect that the much of the ...
Glyph's user avatar
  • 1,622
1 vote
1 answer
326 views

hdiutil within "darling" can't do anything but "attach" and "detach". Can it be improved or something else?

When I run hdiutil within Darling I get: Darling [/Volumes/SystemRoot/home/user]$ hdiutil Usage: hdiutil <action> Possible actions: attach [options] <file> Mounts a .dmg file &...
Сергей Попков's user avatar
1 vote
1 answer
1k views

Error hdiutil: create failed - File exists -> but the file does not exist until this command fails

Trying to create a .dmg file on an NFS share. % rm -f store.dmg && ls -l store.dmg ls: store.dmg: No such file or directory % hdiutil create -size 300g -fs APFS -volname Temp store....
James Risner's user avatar
8 votes
1 answer
5k views

All of a sudden can't open .dmg files on Monterey

My MacBook Pro 13" M1 crashed last night, I think because I switched off my external USB-C monitor. I logged in as normal but since then I am not able to open .dmg files. When I try to open using ...
Hackeron's user avatar
  • 266
2 votes
0 answers
54 views

How dangerous is 'sudo hdiutil eject -force /Volumes/path' for filesystem integrity in terms of cache flushing and open file integrity?

I find myself having some trouble sometimes with ejecting volumes normally. Usually this seems to happen with volumes that really don't (or shouldn't) have any files open that are non-negotiably being ...
ylluminate's user avatar
  • 5,461
0 votes
0 answers
200 views

Owner and group of an hdiutil attached disk image

It's known that a disk image attached with ignored owners (vsdbutil -c prints disabled) will have owner and group to match whatever user is accessing the disk. However, the following bit from diskutil'...
Kentzo's user avatar
  • 380
1 vote
1 answer
856 views

Why use the legacy Apple Partition Map scheme for macOS install media?

Several guides to creating disk images of macOS install media (using the createinstallmedia command) recommend creating the disk image like this: hdiutil create \ -size 10g \ -type UDTO -...
rgov's user avatar
  • 589
1 vote
1 answer
445 views

Shrink disk image to eliminate free space

I created a larger-than-necessary writable disk image, copied content to it, then shrunk the partition with diskutil resizeVolume. This left a big gap at the end of the partition table: MEDIA: "&...
rgov's user avatar
  • 589
2 votes
0 answers
2k views

hdiutil image still busy after unmout

I'm using hdiutil managing disk images. I mount the images with the following command: $ hdiutil mount test.dmg And I unmount them like this: $ umount /Volume/device_name It works fine, the device ...
sammy's user avatar
  • 21
1 vote
2 answers
549 views

How extract a Time Machine snapshot as a full machine volume?

From an old Time Machine backup (Backups.backupdb folder) on a physical external disk I would like to extract some snapshots to other external disks as complete machine volumes. These resulting ...
halloleo's user avatar
  • 1,417
3 votes
1 answer
3k views

Using hdiutil to create a blank .dmg image in the current directory

As a workaround to this issue, I want to use the hdiutil to create a blank image in the current directory. The settings should be identical to these of the GUI Disk Utility (File > New Image > ...
Foad's user avatar
  • 163
1 vote
1 answer
1k views

Creating floppy disk images from folders of data files for VirtualBox

VirtualBox is able to pass floppy disk images (in a format called IMA) to VMs. For a data preservation project, I need to create a lot of those images. My host system is macOS 11.6 Big Sur, and I have ...
jstarek's user avatar
  • 3,586
1 vote
1 answer
3k views

How to properly unmount image (dmg / sparsebundle)

[macOS Mojave 10.14.6] I've recently discovered r/w disk images and the particularly fascinating sparse bundle. As I understand it, an image (the .dmg or .sparsebundle itself) is "attached" ...
caffeinatedbits's user avatar
1 vote
0 answers
503 views

hdiutil fails to create APFS sparseimage: "no mountable file systems"

In macOS Catalina (10.15.7), I'd like to create and mount a sparse, writeable disk image that uses APFS. Specifically, this works if I create Test.sparseimage on my local disk. I'm just unable to ...
Dan Smith's user avatar
0 votes
1 answer
653 views

hdiutil convert -format UDRW not truly editable

Trying to add a single file to an existing ISO I ran into a bit of hiccup I can't see through. Here it is: Having never done it before but encouraged by reading the advice from this question: Add/...
CodeCanoer's user avatar
4 votes
1 answer
2k views

How to mount a .dmg file with a different volume name (or modify it once mounted)?

MacOS Catalina, 10.15.6 Given a .dmg file, foo.dmg, I want to be able to attach it so that its contents will be visible in the Finder application under the Locations section with an arbitrary name, ...
Alex Tereshenkov's user avatar
0 votes
0 answers
112 views

Extract certain files from iso with fastest speed

I have several blu-ray iso downloaded from the internet, and it seems like the iso is compressed, so the reading speed is limited to about 10 MB/s max (the drive containing it is about 125MB/s max), ...
Joy Jin's user avatar
  • 2,833
2 votes
0 answers
900 views

Error creating a macOS install media on a virtual volume

I'm trying to make some .iso files with the install medium for the last versions of macOS (From El Capitán to Catalina), so I can burn them in a USB flash drive. I have found several guides and ...
MasterGeekMX's user avatar
2 votes
1 answer
445 views

hdiutil attach -shadow not working

This question is for those of you familiar with command-line tools and disk images. I'm stumped! Previously, I could mount a read-only disk image with a "shadow" file to make it read-write using this ...
Matthew Strax-Haber's user avatar
1 vote
1 answer
871 views

How to mount the pc/iso partition of an iso file when it also contains an HFS partition?

I have a disc image with the .iso file extension. Mounting this brings up contents that look much like I would expect from something 20 years ago on a pre-OSX Mac. When I do a mount command in ...
John O's user avatar
  • 391
1 vote
1 answer
314 views

How to calculate RAM disk size on OS X Mojave—500 or 512 byte block size?

I created an APFS RAM disk on macOS X 10.14 Mojave using these commands: diskutil partitionDisk $(hdiutil attach -nomount ram://12582912) 1 GPTFormat APFS 'RAMDisk' '100%' Which should create a 6 GB ...
John's user avatar
  • 1,071
3 votes
3 answers
1k views

Can I attach a .dmg without mounting the drive that it is sitting in?

I have a .dmg sitting on an external drive (which also contains other data). The .dmg is an image of a failed drive so I can't mount it but I want to attach the .dmg without mounting the partition it ...
tripleman's user avatar
0 votes
1 answer
243 views

How can I hide a ramdisk from Finder?

I'm creating ramdisks on MacOS following the usual procedure (ie: diskutil erasevolume HFS+ mydisk after hdiutil attach -nomount ram://SIZEINBLOCKS). They work, but they show up in Finder windows with ...
cesss's user avatar
  • 161
0 votes
2 answers
401 views

How to create a read-only shadow for existing RAM disk on macOS?

Read-only RAM disk can be created with method described in this post, so how to create a read-only shadow mount point for existing RAM disk while keeping the original mount point unchanged with ...
Vej's user avatar
  • 163
6 votes
1 answer
3k views

How to create a read-only RAM disk on macOS from the command line?

On macOS Catalina, a RAM disk with 512MB space can be created with the following command: diskutil eraseVolume HFS+ "RAMDisk" `hdiutil attach -nomount ram://1048576` On Ubuntu, a RAM disk and its ...
Vej's user avatar
  • 163
1 vote
0 answers
614 views

Mount Read-only Disk Image Without Breaking Spotlight?

I have a disk image with my main media library inside it, but I normally only mount this as read-only, as this prevents applications from touching anything inside (which can cause a lot of band files ...
Haravikk's user avatar
  • 1,657
3 votes
1 answer
479 views

Attach one .dmg file on different computers at the same time (hdiutil attach)

I have a question about "hdiutil attach" I've "created" (ctrl+c/ctrl+v) one bash script to execute some .app automatically. First im mounting shared folder: mount_smbfs -o nobrowse //SERVER/share "...
Dmytro's user avatar
  • 163
1 vote
1 answer
3k views

How to remove files from a sparsebundle file (previous Time Machine image)?

I have a sparsebundle file that I pulled off of an old Time Machine backup disk. I'd like to save the file if possible, but remove the media files from it (movies, music, etc.) because those are ...
ParanoidGeek's user avatar
4 votes
0 answers
2k views

Can I change a read/write .dmg file to read-only without copying?

I'm working on some automation for ingesting media from camera cards. I am using hdiutil to create a blank disk image, then copy the contents of the camera card onto that disk image. Then I'd love ...
arlovande's user avatar
6 votes
1 answer
1k views

Create dmg file on macOS 10.14 that can be opened on macOS 10.11

Running $ hdiutil create -size <size>b <.dmg-file> -srcfolder <directory> -ov -format UDBZ on macOS 10.14 creates a dmg file that can't be opened on macOS 10.11. Is there an option ...
Thomas S.'s user avatar
  • 193
2 votes
0 answers
2k views

Converting iso to img but hdiutil doesn't recognize iso file

I am trying to convert a iso file to img file using the hdiutil command in the cli terminal but it seems my hdiutil won't recognize the iso. hdiutil convert /mypathdir/ubuntu-16.04.4-desktop-amd64....
Sauro's user avatar
  • 21
3 votes
1 answer
9k views

How to Mount a Sparsebundle Disk Image from Time Machine Backup?

I have several sparse bundle disk images on my system, used for various purposes (mostly to prevent Time Machine from backing up the entirety of very large files). However, I'm planning to ...
Haravikk's user avatar
  • 1,657