Procedure for copying Solaris from a sample system to another

Note: This procedure is NOT applicable for servers or other systems using metadevices

1. Gather configuration information on the system you intend to copy from
- df -k | grep "^/"
- above command displays all locally mounted filesystems
- note used storage in local filesystems you intend to copy
- cd /dev/dsk
- ls to get a list of disk targets defined to the current OS
- prtvtoc /dev/dsk/c0t?d0s2 to get configuration of current boot disk (must be root to use prtvtoc command)
2. Boot the install disk for the version of Solaris you intend to copy on the machine you intend to copy to.
3. When the install screen appears, simply ignore it. Start a command tool window by right clicking on the workspace and selecting "command tool" from the "Utilities…" option. Enter all commands for the to system from this window.
4. Use the format command to configure your intended boot disk.
5. newfs the new filesystems (eg newfs /dev/rdsk/c0t3d0s0).
6. Configure networking
- Get the ip address in use for the system you are copying to.
- configure the network interface:
ifconfig le0 inet 151.131.ss.xx netmask 0xfffffe00
broadcast 151.131.ss+1.255
- network device may have name of le0 (older systems,
SPARC 5, 10, 20), be0 (unusual), hme0(newer Ultra
machines capable of 10/100 operation), or even fddi0.
- Bring the interface online:
ifconfig le0 up
- Add a default route for the local network:
route add default 151.131.ss.1 1
- use the hostname command to set a hostname for the
currently running OS:
hostname tosol
- edit the /etc/hosts file to add lines for the current
(to system) and the source system (from system):
151.131.ss.xx tosol.fqdns.tld.com tosol
151.131.ss.xx fromsol.fqdns.tld.com fromsol
7. Add "tosol" to the .rhosts file for root on the "from" system (if not there already).
8. On the to system, make a mountpoint. This has to be in the /tmp directory, as that is the only directory you can write to:
mkdir /tmp/mnt
9. Mount the root filesystem for the new system onto the mountpoint:
mount /dev/dsk/c0t?d0s0 /tmp/mnt
10. cd to the new root filesystem:
cd /tmp/mnt
11. Copy the contents of the source system root file system to the new system (make sure you are in the new filesystem):
rsh fromsol ufsdump -0f - / | ufsrestore -rf -
12. Tidy up the filesystem by removing "restoresymtable". This is a file used by the ufsrestore command:
rm restoresymtable
13. IF NEEDED, edit the /etc/vfstab file in the new root filesystem to adjust the mountpoints to their new locations. For example, if /tmp/mnt is the mountpoint for the root filesystem, the target vfstab is in /tmp/mnt/etc. Important safety hint: Make sure that the target address of the new root volume is in the list of devices you gathered in step 1 from /dev/dsk. If it isn't, you will not be able to boot the new system successfully. As a work around (this works, although I would try to avoid doing it), copy the contents of /devices and /dev to the new root partition. This will guarantee that the current disk volume is defined to the new system.
14. Change the name of the to system to its intended value. You need to change 3 files in the /etc (/tmp/mnt/etc, for example) filesystem on the root partition of your copied OS:
- Edit /etc/nodename (/tmp/mnt/etc/nodename) to specify the new system name.
- Edit /etc/hostname* (/tmp/mnt/etc/hostname*) to modify the hostname associated with the Ethernet device. This file is usually named hostname.le0, although it could be hostname.hme0 on an UltraSPARC machine.
- Edit /etc/hosts (/tmp/mnt/etc/hosts) to add the new hostname and IP address. You can either overwrite the from system's host entry or just add a new entry.
15. cd /
16. Unmount the root file system:
umount /tmp/mnt
17. Install a boot block for the new root file system. The boot file is in /usr/platform/`uname -i`/lib/fs/ufs.
The uname -i command displays the architecture for the current chip. It will most likely be sun4m, although sun4u will display for Ultra systems and sun4c for older systems (eg SPARC 2):
installboot /usr/platform/sun4m/lib/fs/ufs/bootblk
/dev/rdsk/c0t?d0s0
18. Mount the next partition onto the mount point:
mount /dev/dsk/c0t?d0s6 /tmp/mnt
19. Copy the next filesystem from the source system to the current directory:
cd /tmp/mnt
rsh fromsol ufsdump -0f - /usr | ufsrestore -rf -
20. Tidy up as before:
rm restoresymtable
cd /
umount /tmp/mnt
21. Repeat steps 16 through 18 for each additional filesystem you wish to copy
22. Reboot the system. I recommend that you do a reconfiguration reboot (boot -r) the first time you boot to tidy up any confused device settings.
23. If you added the to system to the from system's .rhost file, this is a good time to undo it if you don't want it to be permanent.

Back to Sun Computers

Back to index