To repair a failed mirror:

$ diskutil repairMirror device slicenumber fromDisk toDisk

Parameter

Description

device

Device file.

 

 

slicenumber

Specifies the slice number to replace.

 

 

fromDisk

Specifies the mirror source.

 

 

toDisk

Specifies the repaired mirror destination.

 

 

Note: Xsan RAID volumes have their own set of commands, which are described in an appendix of the Xsan administrators guide. See the appendix for informatian about the megaraid tool, used for managing a PCI RAID card.

Imaging and Cloning Volumes Using ASR

You can use Apple Software Restore (ASR) to copy a disk image onto a volume or to prepare existing disk images with checksum information for faster copies. ASR can perform file copies, in which individual files are restored to a volume unless an identical file is already there, and block copies, which restore entire disk images. The asr tool doesn’t create the disk images. You can use hdiutil to create disk images from volumes or folders.

You must run ASR as root. You cannot use ASR on read or write disk images.

To image a boot volume:

1Install and configure Mac OS X on the volume.

2Restart from a different volume.

3Make sure the volume you’re imaging has permissions enabled. Use the following to verify permissions:

$ diskutil verifyPermissions [mount pointdisk identifierdevice node]

4Use hditutil to make a read-write disk image of the volume. See “To create an image from a folder:” on page 177.

5Mount the disk image.

6Remove cache files, host-specific preferences, and virtual memory files. See the asr man page for examples of what files to remove.

7Unmount the volume and convert the read-write image to a read-only compressed image.

$ hdiutil convert -format UDZO pathtoimage -o compressedimage

8Prepare the image for duplication by adding checksum information:

$ sudo asr -imagescan compressedimage

Chapter 7 Working with Disks and Volumes

95

Page 95
Image 95
Apple Mac OS X Server manual Imaging and Cloning Volumes Using ASR, To repair a failed mirror, To image a boot volume