System Administration Guide, Volume 1

How to Clone a Disk (dd)

  1. Make sure the source and destination disks have the same disk geometry.

  2. Become superuser.

  3. Create the /reconfigure file on the system so the system will recognize the clone disk to be added when it reboots.


    # touch /reconfigure
    
  4. Shut down the system.


    # init 0
    
  5. Attach the clone disk to the system.

  6. Boot the system.


    ok boot
    
  7. Use the dd command to copy the master disk to the clone disk.


    # dd if=/dev/rdsk/device-name of=/dev/rdsk/device-name bs=blocksize
    

    if=/dev/rdsk/device-name

    Represents the overlap slice of the master disk device, usually slice 2. 

    of=/dev/rdsk/device-name

    Represents the overlap slice of the clone disk device, usually slice 2. 

    bs=blocksize

    Block size, such as 128 Kbytes or 256 Kbytes. A large block size value decreases the time it takes to copy. 

  8. Check the new file system.


    # fsck /dev/rdsk/device-name
    
  9. Mount the clone disk's root (/) file system.


    # mount /dev/dsk/device-name /mnt
    
  10. Edit the clone disk's /etc/vfstab to reference the correct device names.

    For example, changing all instances of c0t3d0 with c0t1d0.

  11. Unmount the clone disk's root (/) file system.


    # umount /mnt
    
  12. Shut down the system.


    # init 0
    
  13. Boot from the clone disk to single-user mode.


    # boot diskn -s
    

    Note -

    The installboot command is not needed for the clone disk because the boot blocks are copied as part of the overlap slice.


  14. Unconfigure the clone disk.


    # sys-unconfig
    

    The system is shut down after it is unconfigured.

  15. Boot from the clone disk again and provide its system information, such as host name, time zone, and so forth.


    # boot diskn
    
  16. Log in as superuser to verify the system information after the system is booted.


    hostname console login:

Example--Cloning a Disk (dd)


# init 0
ok boot
# dd if=/dev/rdsk/c0t0d0s2 of=/dev/rdsk/c0t2d0s2 bs=128k
# 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