Two commands are used to copy file systems to disk:
volcopy
dd
The next section describes how to use the dd command to copy file systems to disk.
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.
Do not use the dd command with variable-length tape drives.
You can specify a device name in place of the standard input or the standard output or both. In this example, contents of the diskette are copied to a file in the /tmp directory:
$ 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. Options are specified 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 this 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:
$ dd if=/floppy/floppy0 of=/tmp/output.file |
Make sure the source and destination disks have the same disk geometry.
Become superuser.
Create the /reconfigure file on the system with the master disk so that it will recognize the clone disk once it is rebooted.
Shut down the system.
# init 0 |
Attach the clone disk to the system.
Boot the system.
ok boot |
Use the dd command to copy the master disk to the clone disk.
# dd if=/dev/dsk/device-name of=/dev/dsk/device-name bs=blocksize |
if=/dev/dsk/device-name |
Represents the master disk device as the input device. |
of=/dev/dsk/device-name |
Represents the clone disk device as the output device. |
bs=blocksize |
Block size. |
Check the new file system.
# fsck /dev/rdsk/device-name |
Mount the clone disk's root (/) file system.
# mount /dev/dsk/device-name /mnt |
Edit the clone disk's /etc/vfstab to reference the correct device names.
Unmount the clone disk's root (/) file system.
# umount /mnt |
Shut down the system.
# init 0 |
Boot from the clone disk to single-user mode.
# boot diskn -s |
Unconfigure the clone disk.
# sys-unconfig |
The system is shut down after it is unconfigured.
Boot from the clone disk again and provide its system information, such as host name, time zone, etc.
# boot diskn |
Log in as superuser to verify the system information once the system is booted.
hostname console login: |
# init 0 ok boot # dd if=/dev/dsk/c0t0d0s2 of=/dev/dsk/c0t2d0s2bs=100k # fsck /dev/rdsk/c0t2d0s2 # mount /dev/dsk/c0t2d0s2 /mnt # cd /mnt/etc # vi vfstab (Modify entries for the new disk) # cd / # umount /mnt # init 0 # boot disk2 -s # sys-unconfig # boot disk2 |