emergency_disk -- create emergency recovery boot media


emergency_disk [-d work_directory] [-i image_directory] [-m media] [-s cd_speed] [device]


The emergency_disk command creates emergency recovery boot media customized for your system. The emergency recovery boot media is used together with:

to restore your system in the event of a system failure.

Typically, after the initial installation of the operating system and all applications, the emergency recovery boot media and emergency recovery tape(s) should be created using the emergency_disk and emergency_rec(1M) commands. Then, regular system backups must be performed to copy user and application data to backup media. You can use commands such as cpio, tar, gzip, etc., to create backup media, or use one of the many third-party backup and restore applications available. Store all media in a safe and easily accessible location in case an emergency such as the following occurs:

In such cases you can use the emergency recovery boot media to bring your system back up, restore it from the emergency tapes, and then apply additional backup media to completely restore the system to the state reflected in the most recent backup media.


identifies a working directory for temporary files. The working directory must contain at least 30 MB of free space. The default is /usr. Note that emergency_disk will execute faster if /tmp is used, but be sure that enough free space exists in /tmp before specifying it.

places ISO or diskette images in image_directory and does not write them to media. For diskette media, the files are named drf.image.1 and drf.image.2. These images can later be written to two diskettes using the dd(1) command, as in this example:
   # cd image_directory
   [insert first blank diskette]
   # format /dev/rfd0135ds18
   # dd if=drf.image.1 of=/dev/rfd0135ds18 bs=32b
   [insert second blank diskette]
   # format /dev/rfd0135ds18
   # dd if=drf.image.2 of=/dev/rfd0135ds18 bs=32b

If a cdrom media type is specified, a CD image named drf.image.iso is written, that can later be used to write a CD, as in this example:

   # cd image_directory
   [insert CD-R/RW media]
   # cdrecord -v -dao dev=1,0,0 -data drf.image.iso

The dev=scsibus,target,lun argument can be determined by executing cdrecord -scanbus. cdrecord -inq dev=x,y,z can be used to verify that a particular drive is seen as a CD-RW (versus a CD-ROM) device. See the cdrecord(1) man page for information on additional arguments like speed, driveropts, how to blank a previously written CD-RW disk, the defaults file /etc/default/cdrecord, and other details.

By default these images are written to /tmp before being written to diskette.

Indicates the media type. Must be one of diskette or cdrom. This option is not needed if the device is specified. If the media type is cdrom and the -i option is not specified, emergency_disk will master and burn the CD-R or CD-RW disk if mkisofs and cdrecord are installed (from the cdrtools package). If a previously written CD-RW disk is used, emergency_disk will automatically blank the CD-RW disk before burning.

Indicates the CD-R/RW media speed for cdrecord. If this option is not specified cdrecord will use CDR_SPEED in /etc/default/cdrecord or its internal default value.


Identifies the diskette or cdrom drive (e.g. diskette1 or cdrom1) that will be used to create the emergency recovery boot media. The default for floppy media is diskette1. The default for cdrom media is cdrom1. For cdrom media the cdrecord dev argument is internally set by emergency_disk based on this device rather than CDR_DEVICE in /etc/default/cdrecord.

Note that the cdrtools package must be installed in order to create an emergency recovery boot CD on a writable CD drive. The CD-R or CD-RW drive must also be supported by the cdrtools package. For more information on cdrtools, see the cdrecord(1) and mkisofs(8) manual pages.


To use the emergency boot media, insert the emergency recovery CD or the first emergency recovery floppy diskette into the drive, and reboot your system. If you use diskettes, you'll be prompted to remove the first diskette and insert the second diskette. Once the recovery program is started, you'll be presented with a menu of options:
   Emergency Recovery Menu

Mount File Systems Unmount File Systems Access UnixWare Shell Write Master Boot Record Restore Disk(s) Reboot

Mount/Unmount File Systems
Depending on how severely your system is damaged, you may be able to mount and unmount file systems from your hard disk. If you can mount the root filesystem, you'll be able to use all the standard UnixWare utilities to examine the accessible disks.

Access UnixWare Shell
If you can mount file systems, you can attempt to repair any system damage you find by launching a shell. Even if the root disk is unavailable, some commands are provided on the emergency boot media: cat(1), chroot(1M), cpio(1), date(1), dd(1M), echo(1), edvtoc(1M), fdisk(1M), find(1), fsck(1M), grep(1), ksh(1), labelit(1M), ln(1), ls(1), mkdir(1), mkfs(1M), mount(1M), prtvtoc(1M), rm(1), stty(1), and vi(1).

Write Master Boot Record
This option writes the UnixWare Master Boot Record to the boot sector of the primary hard disk. This option is useful if the disk is known to have a valid operating system on it, yet the error "No OS found", "No operating system", or a similar message is displayed when you attempt to boot from the disk. Note that any other OS boot loader in the boot sector (such as grub, lilo, or System Commander) will be overwritten by this option.

Restore Disks
Use this option to restore the primary and secondary hard disks from tape media created with the emergency_rec(1M) command. If you select this option:
The emergency recovery media can be used only on the system on which emergency_disk was run to create them.

NOTE: If you are using encapsulated or mirrored disks, the emergency recovery procedure for such disks is documented in the section ``Emergency recovery with an encapsulated or mirrored root disk'' in the UnixWare 7 System Handbook.


To create an emergency recovery boot CDROM using a 40X CD-RW drive and the faster, /tmp work directory:
   emergency_disk -d /tmp -s 40 cdrom1

To create emergency recovery boot floppies:

   emergency_disk -d /tmp


Attempting to use the emergency media to copy UnixWare between systems is prohibited. The emergency media is customized for the system on which it is created and may have unpredictable ramifications if used on another system.


A temporary log file is created in /tmp/drf_PID.log, where PID is the process ID for the emergency_disk command. If an error is encountered a message is displayed to standard error and additional information is provided in this log file.

Exit codes

The emergency_disk command exits with one of the following values:


Failure. See the /tmp/drf_PID.log log file.


A temporary log file is created in /tmp/drf_PID.log, where PID is the process ID for the emergency_disk command. If an error is encountered a message is displayed to standard error and additional information is provided in this log file.


emergency_rec(1M), ``Emergency recovery with an encapsulated or mirrored root disk'' in the UnixWare 7 System Handbook


If you change the hard disk configuration on your system (for example, you add or replace a hard disk), you must create new emergency recovery media to ensure that they match your current system configuration.
© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 25 April 2004