hdiutil: create - No such file or directory

I am trying to create a dmg of the high sierra Recovery HD partition, using terminal,
(going to create a bootable USB with the Recover HD stuff by 'restore'ing from this dmg)

but this command


sudo hdiutil create -srcdevice disk0s3 ../RecoveryHD.dmg

and

sudo hdiutil create -srcdevice disk0s3 RecoveryHD.dmg


(and other variations, all executed from the desktop directory)


gives


hdiutil: create - No such file or directory


MacBook mid 2012 High Sierra. I am missing something stupid here, but no idea what



Joe C.

MacBook Pro (15-inch Mid 2012), OS X El Capitan (10.11.4)

Posted on Jul 8, 2018 8:36 PM

Reply
Question marked as Top-ranking reply

Posted on Jul 11, 2018 7:17 PM

Try the following:

sudo diskutil mount /dev/disk0s3

df | grep disk0s3

It actually mounted the Recovery partition (on High Sierra), where you could create a .dmg from the mounted Recovery file system.


On the High Sierra system, I have access to, /dev/disk1s3 was the recovery partition (It is an SSD based Mac). When I mounted it, it appeared as /Volumes/Recovery and an ls on the mounted file system shows:

ls -Rl /Volumes/Recovery

total 0

drwxr-xr-x 3 root wheel 96 Dec 31 2016 ./

drwxr-xr-x+ 4 root wheel 128 Jul 1 17:34 ../

drwxr-xr-x 13 root wheel 416 Jun 23 15:15 80C07111-95EA-4191-830B-614E539AAE52/


/Volumes/Recovery/80C07111-95EA-4191-830B-614E539AAE52:

total 1063560

drwxr-xr-x 13 root wheel 416 Jun 23 15:15 ./

drwxr-xr-x 3 root wheel 96 Dec 31 2016 ../

drwxr-xr-x 5 root wheel 160 Jun 23 15:15 .diagnostics/

-rw-r--r--@ 1 root wheel 1984 May 29 18:53 BaseSystem.chunklist

-rw-r--r--@ 1 root wheel 485329910 May 29 18:15 BaseSystem.dmg

-rw-r--r--@ 1 root wheel 5082 May 17 23:41 PlatformSupport.plist

-r--r--r--@ 1 root wheel 480 May 29 17:03 SystemVersion.plist

-rw-r--r--@ 1 root wheel 576056 Jun 23 15:15 boot.efi

-rw-r--r--@ 1 root wheel 2738 May 29 18:12 boot.efi.j137ap.im4m

-rw-r--r-- 1 root wheel 397 Jun 23 15:15 com.apple.Boot.plist

-rw-r--r--@ 2 root wheel 29299999 May 8 19:01 immutablekernel

-rw-r--r--@ 1 root wheel 2738 May 29 18:12 immutablekernel.j137ap.im4m

-rw-r--r--@ 2 root wheel 29299999 May 8 19:01 prelinkedkernel


/Volumes/Recovery/80C07111-95EA-4191-830B-614E539AAE52/.diagnostics:

total 5568

drwxr-xr-x 5 root wheel 160 Jun 23 15:15 ./

drwxr-xr-x 13 root wheel 416 Jun 23 15:15 ../

-rw-r--r--@ 1 root wheel 328 May 29 18:53 AppleDiagnostics.chunklist

-rw-r--r--@ 1 root wheel 2839919 May 29 18:13 AppleDiagnostics.dmg

-rw-r--r--@ 1 root wheel 977 Apr 30 12:25 Info.plist

And then I was able to create a .dmg using

sudo hdiutil create -srcfolder /Volumes/Recovery Downloads/tmp.recovery.dmg

...................................................................................................

created: /Users/raharris/Downloads/tmp.recovery.dmg


ls -lh Downloads/tmp.recovery.dmg

-rw-r--r--@ 1 root staff 492M Jul 11 22:15 Downloads/tmp.recovery.dmg

Does that help?

Similar questions

17 replies
Question marked as Top-ranking reply

Jul 11, 2018 7:17 PM in response to freesoftwarewiz

Try the following:

sudo diskutil mount /dev/disk0s3

df | grep disk0s3

It actually mounted the Recovery partition (on High Sierra), where you could create a .dmg from the mounted Recovery file system.


On the High Sierra system, I have access to, /dev/disk1s3 was the recovery partition (It is an SSD based Mac). When I mounted it, it appeared as /Volumes/Recovery and an ls on the mounted file system shows:

ls -Rl /Volumes/Recovery

total 0

drwxr-xr-x 3 root wheel 96 Dec 31 2016 ./

drwxr-xr-x+ 4 root wheel 128 Jul 1 17:34 ../

drwxr-xr-x 13 root wheel 416 Jun 23 15:15 80C07111-95EA-4191-830B-614E539AAE52/


/Volumes/Recovery/80C07111-95EA-4191-830B-614E539AAE52:

total 1063560

drwxr-xr-x 13 root wheel 416 Jun 23 15:15 ./

drwxr-xr-x 3 root wheel 96 Dec 31 2016 ../

drwxr-xr-x 5 root wheel 160 Jun 23 15:15 .diagnostics/

-rw-r--r--@ 1 root wheel 1984 May 29 18:53 BaseSystem.chunklist

-rw-r--r--@ 1 root wheel 485329910 May 29 18:15 BaseSystem.dmg

-rw-r--r--@ 1 root wheel 5082 May 17 23:41 PlatformSupport.plist

-r--r--r--@ 1 root wheel 480 May 29 17:03 SystemVersion.plist

-rw-r--r--@ 1 root wheel 576056 Jun 23 15:15 boot.efi

-rw-r--r--@ 1 root wheel 2738 May 29 18:12 boot.efi.j137ap.im4m

-rw-r--r-- 1 root wheel 397 Jun 23 15:15 com.apple.Boot.plist

-rw-r--r--@ 2 root wheel 29299999 May 8 19:01 immutablekernel

-rw-r--r--@ 1 root wheel 2738 May 29 18:12 immutablekernel.j137ap.im4m

-rw-r--r--@ 2 root wheel 29299999 May 8 19:01 prelinkedkernel


/Volumes/Recovery/80C07111-95EA-4191-830B-614E539AAE52/.diagnostics:

total 5568

drwxr-xr-x 5 root wheel 160 Jun 23 15:15 ./

drwxr-xr-x 13 root wheel 416 Jun 23 15:15 ../

-rw-r--r--@ 1 root wheel 328 May 29 18:53 AppleDiagnostics.chunklist

-rw-r--r--@ 1 root wheel 2839919 May 29 18:13 AppleDiagnostics.dmg

-rw-r--r--@ 1 root wheel 977 Apr 30 12:25 Info.plist

And then I was able to create a .dmg using

sudo hdiutil create -srcfolder /Volumes/Recovery Downloads/tmp.recovery.dmg

...................................................................................................

created: /Users/raharris/Downloads/tmp.recovery.dmg


ls -lh Downloads/tmp.recovery.dmg

-rw-r--r--@ 1 root staff 492M Jul 11 22:15 Downloads/tmp.recovery.dmg

Does that help?

Jul 9, 2018 5:58 AM in response to freesoftwarewiz

You need to specify the actual file system path to the device. In a Unix operating system, especially when working from the command line, everything is a file, including devices. In this case the device is the file /dev/disk0s3


sudo hdiutil create -srcdevice /dev/disk0s3 recovery.dmg

Preparing imaging engine…

Reading whole disk (Apple_HFS : 0)…

................................................................................ ..............................

(CRC32 $8484BC04: whole disk (Apple_HFS : 0))

Adding resources…

................................................................................ ..............................

Elapsed Time: 3.462s

File size: 557568450 bytes, Checksum: CRC32 $EA5E6881

Sectors processed: 1269536, 1165505 compressed

Speed: 164.3Mbytes/sec

Savings: 14.2%

created: /Users/me/recovery.dmg

Jul 11, 2018 6:09 AM in response to BobHarris

Never mind. This may go deeper than what I was thinking. I just gained access to a High Sierra system and I got similar results. Bummer! 😟

sudo hdiutil create -srcdevice /dev/disk1s3 Downloads/RecoveryHD.dmg

Password:

hdiutil: create failed - No such file or directory

My diskutil list

#: TYPE NAME SIZE IDENTIFIER

0: GUID_partition_scheme 500.3 GB disk0

1: EFI EFI 314.6 MB disk0s1

2: Apple_APFS Container disk1 500.0 GB disk0s2


/dev/disk1 (synthesized):

#: TYPE NAME SIZE IDENTIFIER

0: APFS Container Scheme - +500.0 GB disk1

Physical Store disk0s2

1: APFS Volume Macintosh HD 21.2 GB disk1s1

2: APFS Volume Preboot 20.7 MB disk1s2

3: APFS Volume Recovery 518.1 MB disk1s3 <<<<------

4: APFS Volume VM 1.1 GB disk1s4

My ls /dev/disk*

/bin/ls -leO@ /dev/disk*

brw-r----- 1 root operator - 1, 0 Jun 23 15:20 /dev/disk0

brw-r----- 1 root operator - 1, 1 Jun 23 15:20 /dev/disk0s1

brw-r----- 1 root operator - 1, 2 Jun 23 15:20 /dev/disk0s2

brw-r----- 1 root operator - 1, 3 Jun 23 15:20 /dev/disk1

brw-r----- 1 root operator - 1, 4 Jun 23 15:20 /dev/disk1s1

brw-r----- 1 root operator - 1, 5 Jun 23 15:20 /dev/disk1s2

brw-r----- 1 root operator - 1, 6 Jun 23 15:20 /dev/disk1s3

brw-r----- 1 root operator - 1, 7 Jun 23 15:20 /dev/disk1s4

Jul 10, 2018 2:56 PM in response to BobHarris

Diskutil shows:


/dev/disk0 (internal, physical):

#: TYPE NAME SIZE IDENTIFIER

0: GUID_partition_scheme *500.1 GB
disk0

1: EFI EFI 209.7 MB
disk0s1

2: Apple_CoreStorage Macintosh HD 499.2 GB
disk0s2

3: Apple_Boot Recovery HD 650.0 MB
disk0s3


And 1 of the 50 odd command versions I tried was:


sudo hdiutil create -srcdevice /dev/disk0s3 RecoveryHD.dmg

and

sudo hdiutil create -srcdevice /dev/disk0s3 RecovrHD.dmg

and

sudo hdiutil create -srcdevice /dev/disk0s3 HD.dmg

and on and on 🙂

Same error with all of them

Joe

Jul 11, 2018 11:28 AM in response to BobHarris

Yep. That was what I was afraid of - yet another example that Apple has now joined MS in ‘let’s do an update and make thinks stop working’ approach.


I was able to do this last year - on the same system - prior to “High” Sierra.

then suddenly none of the commands I used before worked any longer, nor

any of the variations I tried. Always the same stupid error.


and my system is HFS+. Since it is not SSD yet, just SATA HD, the High Sierra update did not force the system to convert to APFS.

Yet, Hdiutil just stopped doing what it used to - but nothing in the High Sierra docs to indicate a change or why this no longer works.


****, I haven’t even been able to find actual description of how to create a bootable Recovery USB drive for High Sierra - JUST on how to create an ‘install’ USB drive for it, and THAT DOES insist on converting your file system.


Joe

Jul 14, 2018 7:05 PM in response to BobHarris

High sierra SSD uses a different file system - APFS.


My system is HFS - even though it’s High Sierra. Because it is a normal SATA drive, it was not converted on update. The approach you tried does not work, neither did. Network reboot, or booting from an externl drive. hdiutil still gives same ridiculous error (or things like a process error), which I suspect hs nothing to do with the real error/problem.


it very well may hve something to do with High Sierra vs HPS+ and a recovery volume on that file system, since that is the update that apparently killed doing this operation.


but yours was a very logical idea. Thanks. 🙂


Joe

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

hdiutil: create - No such file or directory

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.