Previous Table of Contents Next

Try Copying Data from the Disk

If you cannot run ufsdump on the disk, find another disk of the same type, connect it to the system, and use either the dd or volcopy commands to copy the data from the bad disk. See the dd(1M) and volcopy(1M) manual pages for complete information on how to use these commands.

The dd command makes a literal (block) copy of a complete UFS file system to another file system or to a tape. By default, the dd command copies its standard input to its standard output.

NOTE:  Do not use the dd command with variable-length tape drives.

You can specify a device name in place of the standard input, the standard output, or both. In the following example, contents of a diskette are copied to a file in the /tmp directory:

oak% dd < /floppy/floppy0 > /tmp/output.file
2400+0 records in
2400+0 records out

The dd command reports on the number of blocks it reads and writes. The number after the + is a count of the partial blocks that were copied.

The dd command syntax is different from most other commands. You specify options as keyword=value pairs, where keyword is the option you want to set and value is the argument for that option. For example, you can replace the standard input and output with the following syntax:

dd if=input-file of=output-file

For example, to use the keyword=value pairs instead of the redirect symbols in the previous example, you would type:

oak% dd if=/floppy/floppy0 of=/tmp/output.file

Follow these steps to clone a disk using the dd command:

1.  Make sure the source and destination disks have the same geometry.
2.  Become superuser.
3.  On the system with the master disk, type touch /reconfigure and press Return. The /reconfiguration file is required on the system with the master disk so that it recognizes the clone disk once it is rebooted.
4.  Type init 0 and press Return to shut down the system.
5.  Attach the clone disk to the system and turn on the system.
6.  At the ok prompt type boot and press Return.
7.  Type dd if= /dev/dsk/device-name of= /dev/dsk/device-name bs= blocksize and press Return. The input file, if, is the master disk device. The output file, of, is the clone disk device.
8.  Type fsck /dev/rdsk/device-name and press Return to check the new file system.
9.  Type mount /dev/rdsk/device-name /mnt and press Return to mount the clone disk's root file system.
10.  Edit the /etc/vfstab file on the clone disk to reference the correct device names.
11.  Type umount /mnt and press Return to unmount the clone disk's root file system.
12.  Type init 0 and press Return to shut down the system.
13.  Type boot diskn -s and press Return to boot the clone disk in single-user mode.
14.  Type sys-unconfig and press Return to unconfigure the clone disk. The system is shut down after the disk is unconfigured.
15.  Type boot diskn and press Return to boot the clone disk.
16.  Provide the relevant system information such as host name, time zone, and so on.
17.  Log in as root to verify the system information once the system has booted:
   oak% su < /floppy/floppy0 > /tmp/output.file
   oak# boot
   oak# dd if=/dev/dsk/c0t0d0s2 of=/dev/dsk/c0t2d0s2 bs=100k
   oak# fsck /dev/rdsk/c0t2d0s2
   oak# mount /dev/dsk/c0t2d0s2 /mnt
   oak# cd /mnt/etc
   oak# vi vfstab
   (Modify entries for the new disk)
   oak# cd /
   oak# umount /mnt
   oak# init 0
   oak# boot disk2 -s
   oak# sys-unconfig
   oak# boot disk2

Try Repairing Any Bad Blocks

If the disk has bad blocks, you may be able to repair them using the format command. See the format(1M) manual page for more information.

Try Reformatting the Disk

If the disk is bad, reformatting it may fix the problem. Use the format command to reformat a disk. See the format(1M) manual page for more information.

CAUTION! Remember that formatting the disk destroys all data.

Replacing the Bad Disk

If reformatting and repairing bad blocks do not work, replace the disk. See the disk installation manual for more information.

Previous Table of Contents Next