Previous | Table of Contents | Next |
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 oak%
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:
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
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.
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.
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 |