hdiutil

package module
v0.0.0-...-d31fcd5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 22, 2019 License: BSD-3-Clause Imports: 5 Imported by: 0

README

hdiutil

A package hdiutil implements a macOS hdiutil command wrapper.

CI (darwin) godoc.org codecov.io
circleci.com godoc.org codecov.io

Analytics

Support commands

  • attach
  • burn
  • checksum
  • chpass
  • compact
  • convert
  • create
  • detach
  • eject
  • erasekeys
  • flatten
  • imageinfo
  • info
  • internet-enable
  • isencrypted
  • makehybrid
  • mount
  • mountvol
  • plugins
  • pmap
  • resize
  • segment
  • udifderez
  • udifrez
  • unflatten
  • unmount
  • verify

Documentation

Overview

Package hdiutil implements a macOS hdiutil command wrapper.

HDIUTIL(1)              BSD General Commands Manual              HDIUTIL(1)
NAME
     hdiutil -- manipulate disk images (attach, verify, create, etc)

SYNOPSIS
     hdiutil verb [options]

DESCRIPTION
     hdiutil uses the DiskImages framework to manipulate disk images.
     Common verbs include attach, detach, verify, create, convert, and
     compact.

     The rest of the verbs are currently: help, info, burn, checksum,
     chpass, erasekeys, unflatten, flatten, imageinfo, isencrypted,
     mountvol, unmount, plugins, udifrez, udifderez, internet-enable,
     resize, segment, makehybrid, and pmap.

BACKGROUND
     Disk images are data containers that emulate disks.  Like disks, they
     can be partitioned and formatted.  Many common uses of disk images
     blur the distinction between the disk image container and its content,
     but this distinction is critical to understanding how disk images
     work.
     The terms "attach" and "detach" are used to distinguish the way disk
     images are connected to and disconnected from a system.
     "Mount" and "unmount" are the parallel filesystems options.

     For example, when you double-click a disk image in the macOS Finder,
     two separate things happen.
     First, the image is "attached" to the system just like an external
     drive.
     Then, the kernel and Disk Arbitration probe the new device for
     recognized file structures.
     If any are discovered that should be mounted, the associated volumes
     will mount and appear on the desktop.

     When using disk images, always consider whether an operation applies
     to the blocks of the disk image container or to the
     (often file-oriented) content of the image.
     For example, hdiutil verify verifies that the blocks stored in a
     read-only disk image have not changed since it was created.
     It does not check whether the filesystem stored within the image is
     self-consistent (as diskutil verifyVolume would).
     On the other hand, hdiutil create -srcfolder creates a disk image
     container, puts a filesystem in it, and then copies the specified
     files to the new filesystem.

Index

Constants

View Source
const (
	// AttachReadonly force the resulting device to be read-only.
	AttachReadonly attachRWType = readonly

	// AttachReadWrite attempt to override the DiskImages framework's decision to attach a particular image read-only.
	//
	// For example, AttachReadWrite can be used to modify the HFS+ filesystem on a HFS+/ISO hybrid CD image.
	AttachReadWrite attachRWType = readwrite

	// AttachKernel attempt to attach this image without a helper process; fail if unsupported.
	//
	// Only UDRW, UDRO, UDZO, ULFO, and UDSP images are supported in-kernel. Encryption and HTTP are supported by the kernel driver.
	AttachKernel attachKernel = true

	// AttachNoKernel attach with a helper process. This is (again) the default as of Mac OS X 10.5.
	AttachNoKernel attachKernel = false

	// AttachNotRemovable prevent this image from being detached. Only root can use this option.
	//
	// A reboot is necessary to cleanly detach an image attached with AttachNotRemovable.
	AttachNotRemovable attachNotRemovable = true

	// AttachMountRequired indicate to mount required.
	AttachMountRequired attachMount = "required"

	// AttachMountOptional indicate to mount optional.
	AttachMountOptional attachMount = "optional"

	// AttachMountSuppressed indicate to mount suppressed.
	AttachMountSuppressed attachMount = "suppressed"

	// AttachNoMount identical to AttachMountSuppressed.
	AttachNoMount attachNoMount = true

	// AttachNoBrowse render any volumes invisible in applications such as the macOS Finder.
	AttachNoBrowse attachNoBrowse = true

	// AttachOwnersOn owners on any filesystems be honored.
	AttachOwnersOn attachOwners = ownersOn

	// AttachOwnersOff owners on any filesystems be not honored.
	AttachOwnersOff attachOwners = ownersOff

	// AttachVerify do verify the image.
	AttachVerify attachVerify = true

	// AttachNoVerify do not verify the image.
	AttachNoVerify attachVerify = false

	// AttachIgnoreBadChecksums bad checksums should be ignored.
	AttachIgnoreBadChecksums attachIgnoreBadChecksums = true

	// AttachNoIgnoreBadChecksums bad checksums should be not ignored.
	AttachNoIgnoreBadChecksums attachIgnoreBadChecksums = false

	// AttachIdme do perform IDME actions on IDME images.
	AttachIdme attachIdme = true

	// AttachNoIdme do not perform IDME actions on IDME images.
	AttachNoIdme attachIdme = false

	// AttachIdmeReveal do reveal (in the Finder) the results of IDME processing.
	AttachIdmeReveal atachIdmeReveal = true

	// AttachNoIdmeReveal do not reveal (in the Finder) the results of IDME processing.
	AttachNoIdmeReveal atachIdmeReveal = false

	// AttachIdmeTrash do put IDME images in the trash after processing.
	AttachIdmeTrash attachIdmeTrash = true

	// AttachNoIdmeTrash do not put IDME images in the trash after processing.
	AttachNoIdmeTrash attachIdmeTrash = false

	// AttachAutoOpen do not auto-open volumes (in the Finder) after attaching an image.
	AttachAutoOpen attachAutoOpen = true

	// AttachNoAutoOpen do not auto-open volumes (in the Finder) after attaching an image.
	AttachNoAutoOpen attachAutoOpen = false

	// AttachAutoOpenRO do auto-open read-only volumes.
	AttachAutoOpenRO attachAutoOpenRO = true

	// AttachNoAutoOpenRO do not auto-open read-only volumes.
	AttachNoAutoOpenRO attachAutoOpenRO = false

	// AttachAutoOpenRW do auto-open read/write volumes.
	AttachAutoOpenRW attachAutoOpenRW = true

	// AttachNoAutoOpenRW do not auto-open read/write volumes.
	AttachNoAutoOpenRW attachAutoOpenRW = false

	// AttachAutoFsck do force automatic file system checking before mounting a disk image.
	AttachAutoFsck attachAutoFsck = true

	// AttachNoAutoFsck do not force automatic file system checking before mounting a disk image.
	AttachNoAutoFsck attachAutoFsck = false
)
View Source
const (
	// ConvertUDRW UDIF read/write image.
	ConvertUDRW convertFormot = 1 << iota
	// ConvertUDRO UDIF read-only image.
	ConvertUDRO
	// ConvertUDCO UDIF ADC-compressed image.
	ConvertUDCO
	// ConvertUDZO UDIF zlib-compressed image.
	ConvertUDZO
	// ConvertULFO UDIF lzfse-compressed image (OS X 10.11+ only).
	ConvertULFO
	// ConvertUDBZ UDIF bzip2-compressed image (Mac OS X 10.4+ only).
	ConvertUDBZ
	// ConvertUDTO DVD/CD-R master for export.
	ConvertUDTO
	// ConvertUDSP SPARSE (grows with content).
	ConvertUDSP
	// ConvertUDSB SPARSEBUNDLE (grows with content; bundle-backed).
	ConvertUDSB
	// ConvertUFBI UDIF entire image with MD5 checksum.
	ConvertUFBI
	// ConvertUDRo UDIF read-only (obsolete format).
	ConvertUDRo
	// ConvertUDCo UDIF compressed (obsolete format).
	ConvertUDCo
	// ConvertRdWr NDIF read/write image (deprecated).
	ConvertRdWr
	// ConvertRdxx NDIF read-only image (Disk Copy 6.3.3 format; deprecated).
	ConvertRdxx
	// ConvertROCo NDIF compressed image (deprecated).
	ConvertROCo
	// ConvertRken NDIF compressed (obsolete format).
	ConvertRken
	// ConvertDC42 Disk Copy 4.2 image (obsolete format).
	ConvertDC42
)
View Source
const (
	// CreateUDIF is the default type. If specified, a UDRW of the specified size will be created.
	CreateUDIF createType = 1 << iota
	// CreateSPARSE creates a UDSP, a read/write single-file image which expands as is is filled with data.
	CreateSPARSE
	// CreateSPARSEBUNDLE creates a UDSB, a read/write image backed by a directory bundle.
	CreateSPARSEBUNDLE
)
View Source
const (
	// CreateHFSPlus provides the HFS+.
	CreateHFSPlus createFS = 1 << iota
	// CreateHFSPlusJ provides the HFS+J.
	CreateHFSPlusJ
	// CreateJHFSPlus provides the JHFS+.
	CreateJHFSPlus
	// CreateHFSX provides the HFSX.
	CreateHFSX
	// CreateJHFSPlusX provides the JHFS+X.
	CreateJHFSPlusX
	// CreateAPFS provides the APFS.
	CreateAPFS
	// CreateFAT32 provides the FAT32.
	CreateFAT32
	// CreateExFAT provides the ExFAT.
	CreateExFAT
	// CreateUDF provides the UDF.
	CreateUDF
)
View Source
const (
	// CreateAutostretch do suppress automatically making backwards-compatible stretchable volumes when the volume size crosses the auto-stretch-size threshold (default: 256 MB). See also asr(8).
	CreateAutostretch createAutostretch = true

	// CreateNoAutostretch do not suppress automatically making backwards-compatible stretchable volumes when the volume size crosses the auto-stretch-size threshold (default: 256 MB). See also asr(8).
	CreateNoAutostretch createAutostretch = false

	// CreateOV overwrite an existing file. The default is not to overwrite existing files.
	CreateOV createOV = true

	// CreateAttach the image after creating it. If no filesystem is specified via createFS, the attach will fail per the default attach createMount required behavior.
	CreateAttach createAttach = true

	// CreateCrossdev do cross device boundaries on the source filesystem.
	CreateCrossdev createCrossdev = true

	// CreateNoCrossdev do not cross device boundaries on the source filesystem.
	CreateNoCrossdev createCrossdev = false

	// CreateScrub do cross device boundaries on the source filesystem.
	CreateScrub createScrub = true

	// CreateNoScrub do not cross device boundaries on the source filesystem.
	CreateNoScrub createScrub = false

	// CreateAnyowners do fail if the user invoking hdiutil can't ensure correct file ownership for the files in the image.
	CreateAnyowners createAnyowners = true

	// CreateNoAnyowners do not fail if the user invoking hdiutil can't ensure correct file ownership for the files in the image.
	CreateNoAnyowners createAnyowners = false

	// CreeteSkipunreadable skip files that can't be read by the copying user and don't authenticate.
	CreeteSkipunreadable createSkipunreadable = false

	// CreateAtomic do copy files to a temporary location and then rename them to their destination. Atomic copies are the default. Non-atomic copying may be slightly faster.
	CreateAtomic createAtomic = true

	// CreateNoAtomic do not copy files to a temporary location and then rename them to their destination. Atomic copies are the default. Non-atomic copying may be slightly faster.
	CreateNoAtomic createAtomic = false
)
View Source
const (
	// Plist provide result output in plist format.
	// Other programs invoking hdiutil are expected to use -plist rather than try to parse the human-readable output.
	//
	// The usual output is consistent but generally unstructured.
	Plist plist = true

	// Puppetstrings provide progress output that is easy for another program to parse.
	// PERCENTAGE outputs can include the value -1 which means hdiutil is performing an operation that will take an indeterminate amount of time to complete.
	//
	// Any program trying to interpret hdiutil's progress should use -puppetstrings.
	Puppetstrings puppetstrings = true

	// Stdinpass read a null-terminated passphrase from standard input.
	// If the standard input is a tty, the passphrase will be read with readpassphrase(3).
	// Otherwise, the password is read from stdin.
	//
	// -stdinpass replaces -passphrase which has been deprecated.
	// -passphrase is insecure because its argument appears in the output of ps(1) where it is visible to other users and processes on the system.
	Stdinpass stdinpass = true

	// Agentpass force the default behavior of prompting for a passphrase.
	//
	// Useful with -pubkey to create an image protected by both a passphrase and a public key.
	Agentpass agentpass = true

	// Insecurehttp ignore SSL host validation failures.
	// Useful for self-signed servers for which the appropriate certificates are unavailable or if access to a server is desired when the server name doesn't match what is in the certificate.
	Insecurehttp insecurehttp = true

	// Verbose be verbose: produce extra progress output and error diagnostics.
	//
	// This option can help the user decipher why a particular operation failed.
	// At a minimum, the probing of any specified images will be detailed.
	// BUG(zchee): not exit hdiutil command if set.
	Verbose verbose = true

	// Quiet close stdout and stderr, leaving only hdiutil's exit status to indicate success or failure.
	// No /dev entries or mount points will be printed.
	//
	// -debug and -verbose disable -quiet.
	// BUG(zchee): not get the command result such as device node path when attach.
	Quiet quiet = true

	// Debug be very verbose.
	//
	// This option is good if a large amount of progress information is needed.
	// As of Mac OS X 10.6, -debug enables -verbose.
	// BUG(zchee): not exit hdiutil command if set.
	Debug debug = true
)
View Source
const (
	// MakehybridHFS generate an HFS+ filesystem.
	//
	// This filesystem can be present on an image simultaneously with an ISO9660 or Joliet or UDF filesystem.
	// On operating systems that understand HFS+ as well as ISO9660 and UDF, like Mac OS 9 or OS X, HFS+ is usually the preferred filesystem for hybrid images.
	MakehybridHFS makehybridHFS = true

	// MakehybridISO generate an ISO9660 Level 2 filesystem with Rock Ridge extensions.
	//
	// This filesystem can be present on an image simultaneously with an HFS+ or Joliet or UDF filesystem.
	// ISO9660 is the standard cross-platform interchange format for CDs and some DVDs, and is understood by virtually all operating systems.
	//
	// If an ISO9660 or Joliet filesystem is present on a disk image or CD, but not HFS+, OS X will use the ISO9660 (or Joliet) filesystem.
	MakehybridISO makehybridISO = true

	// MakeHybridJoliet generate joliet extensions to ISO9660.
	//
	// This view of the filesystem can be present on an image simultaneously with HFS+, and requires the presence of an ISO9660 filesystem.
	// Joliet supports Unicode filenames, but is only supported on some operating systems.
	//
	// If both an ISO9660 and Joliet filesystem are present on a disk image or CD, but not HFS+, OS X will prefer the Joliet filesystem.
	MakeHybridJoliet makehybridJoliet = true

	// MakeHybridUDF generate a UDF filesystem.
	//
	// This filesystem can be present on an image simultaneously with HFS+, ISO9660, and Joliet.
	// UDF is the standard interchange format for DVDs, although operating system support varies based on OS version and UDF version.
	MakeHybridUDF makehybridUDF = true

	// MakehybridHFSBlessedDirectory path to directory which should be "blessed" for OS X booting on the generated filesystem.
	//
	// This assumes the directory has been otherwise prepared, for example with bless -bootinfo to create a valid BootX file. (HFS+ only).
	MakehybridHFSBlessedDirectory makehybridHFSBlessedDirectory = true

	// MakehybridHFSOpenfolder path to a directory that will be opened by the Finder automatically.  See also the -openfolder option in bless(8) (HFS+ only).
	MakehybridHFSOpenfolder makehybridHFSOpenfolder = true

	// MakehybridHFSStartupfileSize allocate an empty HFS+ Startup File of the specified size, in bytes (HFS+ only).
	MakehybridHFSStartupfileSize makehybridHFSStartupfileSize = true

	// MakehybridAbstractFile path to a file in the source directory (and thus the root of the generated filesystem) for use as the ISO9660/Joliet Abstract file (ISO9660/Joliet).
	MakehybridAbstractFile makehybridAbstractFile = true

	// MakehybridBibliographyFile path to a file in the source directory (and thus the root of the generated filesystem) for use as the ISO9660/Joliet Bibliography file (ISO9660/Joliet).
	MakehybridBibliographyFile makehybridBibliographyFile = true

	// MakehybridCopyrightFile path to a file in the source directory (and thus the root of the generated filesystem) for use as the ISO9660/Joliet Copyright file (ISO9660/Joliet).
	MakehybridCopyrightFile makehybridCopyrightFile = true

	// MakehybridApplication Application string (ISO9660/Joliet).
	MakehybridApplication makehybridApplication = true

	// MakehybridPreparer preparer string (ISO9660/Joliet).
	MakehybridPreparer makehybridPreparer = true

	// MakehybridPublisher publisher string (ISO9660/Joliet).
	MakehybridPublisher makehybridPublisher = true

	// MakehybridSystemID system Identification string (ISO9660/Joliet).
	MakehybridSystemID makehybridSystemID = true

	// MakehybridKeepMacSpecific Expose Macintosh-specific files (such as .DS_Store) in non-HFS+ filesystems (ISO9660/Joliet).
	MakehybridKeepMacSpecific makehybridKeepMacSpecific = true

	// MakehybridEltoritoBoot path to an El Torito boot image within the source directory. By default, floppy drive emulation is used, so the image must be one of 1200KB, 1440KB, or 2880KB. If the image has a different size, either -no-emul-boot or
	// -hard-disk-boot must be used to enable "No Emulation" or "Hard Disk Emulation" mode, respectively (ISO9660/Joliet).
	MakehybridEltoritoBoot makehybridEltoritoBoot = true

	// MakehybridHardDiskBoot use El Torito Hard Disk Emulation mode. The image must represent a virtual device with an MBR partition map and a single partition.
	MakehybridHardDiskBoot makehybridHardDiskBoot = true

	// MakehybridNoEmulBoot use El Torito No Emulation mode. The system firmware will load the number of sectors specified by -boot-load-size and execute it, without emulating any devices (ISO9660/Joliet).
	MakehybridNoEmulBoot makehybridNoEmulBoot = true

	// MakehybridNoBoot mark the El Torito image as non-bootable. The system firmware may still create a virtual device backed by this data. This option is not recommended (ISO9660/Joliet).
	MakehybridNoBoot makehybridNoBoot = true

	// MakehybridBootLoadSeg for a No Emulation boot image, load the data at the specified segment address.  This options is not recommended, so that the system firmware can use its default address (ISO9660/Joliet)
	MakehybridBootLoadSeg makehybridBootLoadSeg = true

	// MakehybridBootLoadSize for a No Emulation boot image, load the specified number of 512-byte emulated sectors into memory and execute it. By default, 4 sectors (2KB) will be loaded (ISO9660/Joliet).
	MakehybridBootLoadSize makehybridBootLoadSize = true

	// MakehybridEltoritoPlatform use the specified numeric platform ID in the El Torito Boot Catalog Validation Entry or Section Header. Defaults to 0 to identify x86 hardware (ISO/Joliet).
	MakehybridEltoritoPlatform makehybridEltoritoPlatform = true

	// MakehybridEltoritoSpecification for complex layouts involving multiple boot images, a plist-formatted string can be provided, using either OpenStep-style syntax or XML syntax, representing an array of dictionaries.
	//
	// Any of the El Torito options can be set in the sub-dictionaries and will apply to that boot image only.
	// If -eltorito-specification is provided in addition to the normal El Torito command-line options, the specification will be used to populate secondary non-default boot entries.
	MakehybridEltoritoSpecification makehybridEltoritoSpecification = true

	// MakehybridUDFVersion version of UDF filesystem to generate. This can be either "1.02" or "1.50".  If not specified, it defaults to "1.50" (UDF).
	MakehybridUDFVersion makehybridUDFVersion = true

	// MakehybridDefaultVolumeName default volume name for all filesystems, unless overridden.
	//
	// If not specified, defaults to the last path component of source.
	MakehybridDefaultVolumeName makehybridDefaultVolumeName = true

	// MakehybridHFSVolumeName volume name for just the HFS+ filesystem if it should be different (HFS+ only).
	MakehybridHFSVolumeName makehybridHFSVolumeName = true

	// MakehybridISOVolumeName volume name for just the ISO9660 filesystem if it should be different (ISO9660 only).
	MakehybridISOVolumeName makehybridISOVolumeName = true

	// MakehybridJolietVolumeName volume name for just the Joliet filesystem if it should be different (Joliet only).
	MakehybridJolietVolumeName makehybridJolietVolumeName = true

	// MakehybridUDFVolumeName volume name for just the UDF filesystem if it should be different (UDF only).
	MakehybridUDFVolumeName makehybridUDFVolumeName = true

	// MakehybridHideAll a glob expression of files and directories that should not be exposed in the generated filesystems.
	//
	// The string may need to be quoted to avoid shell expansion, and will be passed to glob(3) for evaluation.
	// Although this option can not be used multiple times, an arbitrarily complex glob expression can be used.
	MakehybridHideAll makehybridHideAll = true

	// MakehybridHideHFS a glob expression of files and directories that should not be exposed via the HFS+ filesystem, although the data may still be present for use by other filesystems (HFS+ only).
	MakehybridHideHFS makehybridHideHFS = true

	// MakehybridHideISO a glob expression of files and directories that should not be exposed via the ISO filesystem, although the data may still be present for use by other filesystems (ISO9660 only).
	//
	// Per above, the Joliet hierarchy will supersede the ISO hierarchy when the hybrid is mounted as an ISO 9660 filesystem on OS X.
	// Therefore, if Joliet is being generated (the default) -hide-joliet will also be needed to hide the file from mount_cd9660(8).
	MakehybridHideISO makehybridHideISO = true

	// MakehybridHideJoliet a glob expression of files and directories that should not be exposed via the Joliet filesystem, although the data may still be present for use by other filesystems (Joliet only).
	//
	// Because OS X's ISO 9660 filesystem uses the Joliet catalog if it is available, -hide-joliet effectively supersedes -hide-iso when the resulting filesystem is mounted as ISO on OS X.
	MakehybridHideJoliet makehybridHideJoliet = true

	// MakehybridHideUDF a glob expression of files and directories that should not be exposed via the UDF filesystem, although the data may still be present for use by other filesystems (UDF only).
	MakehybridHideUDF makehybridHideUDF = true

	// MakehybridOnlyUDF a glob expression of objects that should only be exposed in UDF.
	MakehybridOnlyUDF makehybridOnlyUDF = true

	// MakehybridOnlyISO a glob expression of objects that should only be exposed in ISO.
	MakehybridOnlyISO makehybridOnlyISO = true

	// MakehybridOnlyJoliet a glob expression of objects that should only be exposed in Joleit.
	MakehybridOnlyJoliet makehybridOnlyJoliet = true

	// MakehybridPrintSize preflight the data and calculate an upper bound on the size of the image.  The actual size of the generated image is guaranteed to be less than or equal to this estimate.
	MakehybridPrintSize makehybridPrintSize = true

	// MakehybridPlistin instead of using command-line parameters, use a standard plist from standard input to specific the parameters of the hybrid image generation.
	//
	// Each command-line option should be a key in the dictionary, without the leading "-", and the value should be a string for path and string arguments, a number for number arguments, and a boolean for toggle options.
	// The source argument should use a key of "source" and the image should use a key of "output".
	MakehybridPlistin makehybridPlistin = true
)
View Source
const (
	// VerifyCache do cache checksum-verification.
	VerifyCache verifyCache = true

	// VerifyNoCache do not cache checksum-verification cache.
	VerifyNoCache verifyCache = false
)
View Source
const (
	// ConvertPmap add partition map.
	ConvertPmap convertPmap = true
)
View Source
const (
	// DetachForce ignore open files on mounted volumes, etc.
	DetachForce detachForce = true
)

Variables

This section is empty.

Functions

func Attach

func Attach(image string, flags ...attachFlag) (string, error)

Attach attach the image file. The returns device node path and error.

func Convert

func Convert(image string, format formatFlag, outfile string, flags ...convertFlag) error

Convert convert image to type format and write the result to outfile.

func Create

func Create(image string, sizeSpec sizeFlag, flags ...createFlag) error

Create create a new image of the given size or from the provided data.

func Detach

func Detach(deviceNode string, flags ...detachFlag) error

Detach detach a disk image and terminate any associated process.

func DeviceNumber

func DeviceNumber(deviceNode string) int

DeviceNumber return the device number from the deviceNode.

func Makehybrid

func Makehybrid(image, source string, flags ...makehybridFlag) error

Makehybrid generate a potentially-hybrid filesystem in a read-only disk image using the DiscRecording framework's content creation system.

func RawDeviceNode

func RawDeviceNode(deviceNode string) string

RawDeviceNode return the raw device node from the deviceNode.

func Verify

func Verify(image string, flags ...verifyFlag) error

Verify compute the checksum of a "read-only" or "compressed" image and verify it against the value stored in the image.

Types

type AttachDrivekey

type AttachDrivekey [2]string

AttachDrivekey specify a key/value pair to be set on the device in the IOKit registry.

type AttachMountPoint

type AttachMountPoint string

AttachMountPoint assuming only one volume, mount it at path instead of in /Volumes.

See fstab(5) for ways a system administrator can make particular volumes automatically mount in particular filesystem locations by editing the file /etc/fstab.

type AttachMountRandom

type AttachMountRandom string

AttachMountRandom like AttachMountRoot, but mount point directory names are randomized with mkdtemp(3).

type AttachMountRoot

type AttachMountRoot string

AttachMountRoot mount volumes on subdirectories of path instead of under /Volumes. path must exist.

Full mount point paths must be less than MNAMELEN characters (increased from 90 to 1024 in Mac OS X 10.6).

type AttachSection

type AttachSection [2]int

AttachSection attach a subsection of a disk image. subspec is any of <offset>, <first-last>, or <start,count> in 0-based sectors. Ranges are inclusive.

type Cacert

type Cacert string

Cacert specify a certificate authority certificate. cert can be either a PEM file or a directory of certificates processed by c_rehash(1).

See also --capath and --cacert in curl(1).

type Certificate

type Certificate string

Certificate specify a secondary access certificate for an encrypted image. cert_file must be DER-encoded certificate data, which can be created by Keychain Access or openssl(1).

type ConvertAlign

type ConvertAlign int

ConvertAlign default is 4 (2K).

type ConvertSegmentSize

type ConvertSegmentSize string

ConvertSegmentSize specify segmentation into size_spec-sized segments as outfile is being written.

The default size_spec when ConvertSegmentSize is specified alone is 2*1024*1024 (1 GB worth of sectors) for UDTO images and 4*1024*1024 (2 GB segments) for all other image types.

size_spec(string) can also be specified ??b|??k|??m|??g|??t|??p|??e like create's CreateSize flag.

type ConvertTasks

type ConvertTasks int

ConvertTasks when converting an image into a compressed format, specify the number of threads to use for the compression operation.

The default is the number of processors active in the current system.

type CreateAlign

type CreateAlign int

CreateAlign specifies a size to which the final data partition will be aligned. The default is 4K.

type CreateCopyuid

type CreateCopyuid string

CreateCopyuid perform the copy as the given user. Requires root privilege. If user can't read or create files with the needed owners, CreateAnyowners or CreateSkipunreadable must be used to prevent the operation from failing.

type CreateFSArgs

type CreateFSArgs []string

CreateFSArgs additional arguments to pass to whichever newfs program is implied by createFS.

As an example with HFS+, newfs_hfs(8) has a number of options that can control the amount of space used by the filesystem's data structures.

type CreateFormat

type CreateFormat string

CreateFormat specify the final image format. The default when a source is specified is UDZO. CreateFormat can be any of the format parameters used by convert.

type CreateGID

type CreateGID int

CreateGID the root of the newly-created volume will be owned by the given numeric group id. 99 maps to 'unknown'.

type CreateLayout

type CreateLayout string

CreateLayout specify the partition layout of the image.

layout can be anything supported by MediaKit.framework. NONE creates an image with no partition map.When such an image is attached, a single /dev entry will be created (e.g. /dev/disk1).

'SPUD' causes a DDM and an Apple Partition Scheme partition map with a single entry to be written. 'GPTSPUD' creates a similar image but with a GUID Partition Scheme map instead. When attached, multiple /dev entries will be created, with either slice 1 (GPT) or slice 2 (APM) as the data partition. (e.g. /dev/disk1, /dev/disk1s1, /dev/disk1s2).

Unless overridden by createFS, the default layout is 'GPTSPUD' (PPC systems used 'SPUD' prior to Mac OS X 10.6). Other layouts include 'MBRSPUD' and 'ISOCD'. create -help lists all supported layouts.

type CreateLibrary

type CreateLibrary string

CreateLibrary specify an alternate layout library. The default is MediaKit's MKDrivers.bundle.

type CreateMegabytes

type CreateMegabytes int

CreateMegabytes specify the size of the image file in megabytes (1024*1024 bytes).

type CreateMode

type CreateMode string

CreateMode the root of the newly-created volume will have mode (in octal) mode.

The default mode is determined by the filesystem's newfs unless CreateSrcfolder is specified, in which case the default mode is derived from the specified filesystem object.

type CreatePartitionType

type CreatePartitionType string

CreatePartitionType change the type of partition in a single-partition disk image. The default is Apple_HFS unless createFS implies otherwise.

type CreateSectors

type CreateSectors int

CreateSectors specify the size of the image file in 512-byte sectors.

type CreateSegmentSize

type CreateSegmentSize int

CreateSegmentSize specify that the image should be written in segments no bigger than size_spec (which follows CreateSize conventions).

type CreateSize

type CreateSize string

CreateSize specify the size of the image in the style of mkfile(8) with the addition of tera-, peta-, and exa-bytes sizes.

The larger sizes are useful for large sparse images.

type CreateSrcdevice

type CreateSrcdevice string

CreateSrcdevice specifies that the blocks of device should be used to create a new image.

The image size will match the size of device. resize can be used to adjust the size of resizable filesystems and writable images. Both CreateSrcdevice and CreateSrcfolder can run into errors if there are bad blocks on a disk. One way around this problem is to write over the files in question in the hopes that the drive will remap the bad blocks. Data will be lost, but the image creation operation will subsequently succeed.

Filesystem options (like createFS, CreateVolname, CreateStretch, or CreateSize) are invalid and ignored when using CreateSrcdevice.

type CreateSrcdir

type CreateSrcdir CreateSrcfolder

CreateSrcdir is a synonym to CreateSrcfolder.

type CreateSrcfolder

type CreateSrcfolder string

CreateSrcfolder copies file-by-file the contents of source into image, creating a fresh (theoretically defragmented) filesystem on the destination.

The resulting image is thus recommended for use with asr(8) since it will have a minimal amount of unused space. Its size will be that of the source data plus some padding for filesystem overhead. The filesystem type of the image volume will match that of the source as closely as possible unless overridden with -fs.

Other size specifiers, such as CreateSize, will override the default size calculation based on the source content, allowing for more or less free space in the resulting filesystem. CreateSrcfolder can be specified more than once, in which case the image volume will be populated at the top level with a copy of each specified filesystem object.

type CreateStretch

type CreateStretch int

CreateStretch initializes HFS+ filesystem data such that it can later be stretched on older systems (which could only stretch within predefined limits) using hdiutil resize or by asr(8). max_stretch(int) is specified like CreateSize.

CreateStretch is invalid and ignored when using CreateSrcdevice.

type CreateUID

type CreateUID int

CreateUID the root of the newly-created volume will be owned by the given numeric user id. 99 maps to the magic 'unknown' user.

type CreateVolname

type CreateVolname string

CreateVolname the newly-created filesystem will be named volname.

The default depends the filesystem being used, The default volume name in both HFS+ and APFS is `untitled'.

CreateVolname is invalid and ignored when using CreateSrcdevice.

type Encryption

type Encryption EncryptionType

Encryption specify a particular type of encryption or, if not specified, the default encryption algorithm.

As of OS X 10.7, the default algorithm is the AES cipher running in CBC mode on 512-byte blocks with a 128-bit key.

type EncryptionType

type EncryptionType int

EncryptionType specify a particular type of encryption.

const (
	// AES128 use AES cipher running in CBC mode on 512-byte blocks with a 128-bit key (recommended).
	AES128 EncryptionType = 1 << iota
	// AES256 use AES cipher running in CBC mode on 512-byte blocks with a 256-bit key (more secure, but slower).
	AES256
)

func (EncryptionType) String

func (e EncryptionType) String() string

type Imagekey

type Imagekey map[string]string

Imagekey is normally a synonym to Srcimagekey, only a synonym Tgtimagekey if there is no input image.

type Pubkey

type Pubkey []string

Pubkey specify a list of public keys, identified by their hexadecimal hashes, to be used to protect the encrypted image being created.

type Recover

type Recover string

Recover specify a keychain containing the secret corresponding to the certificate specified with -certificate when the image was created.

type Shadow

type Shadow string

Shadow use a shadow file in conjunction with the data in the primary image file. This option prevents modification of the original image and allows read-only images to be attached read/write.

When blocks are being read from the image, blocks present in the shadow file override blocks in the base image. All data written to an attached device will be redirected to the shadow file. If not specified, shadowfile defaults to image.shadow. If the shadow file does not exist, it is created.

hdiutil verbs taking images as input accept -shadow, -cacert, and -insecurehttp.

type Srcimagekey

type Srcimagekey map[string]string

Srcimagekey specify a key/value pair for the disk image recognition system. (-imagekey is normally a synonym)

type Tgtimagekey

type Tgtimagekey map[string]string

Tgtimagekey specify a key/value pair for any image created. (-imagekey is only a synonym if there is no input image).

Notes

Bugs

  • not exit hdiutil command if set.

  • not get the command result such as device node path when attach.

  • not exit hdiutil command if set.

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL