Summary - Procedures to clone the hard disk of Sun computer

From: Hongjun Pan <hpan_at_utk.edu>
Date: Mon, 23 May 2005 15:39:06 -0400

Dear NMR colleagues:
    Three weeks ago I sent a query about the procedure to clone the hard
disk of Sun computer. I received many responses and also many requests
to post the summary to this site. It seems that this subject may have a
broad interest. Here is the summany of responses. Many thanks to all
people who sent me the suggestions.

Hongjun Pan

***********
First off I always have the operating system in a separate partition.
The partition with Vnmr and data is backed up to another computer using
rsync so it is always immediately available. I would much prefer to do
a clean install of the OS on a new disk. It is rare that we stop
everything to upgrade the OS and this is an opportunity not to be
missed. You also avoid copying any errors that existed in the previous
installation.

There are things which must be done for Vnmr to work correctly but I
still think this is the best way.

*****

It should be possible; install the extra disk onto the working
system, reboot -r (or touch /reconfigure before rebooting) so that
the OS will see the new drive, and then use format, and dump/restore
to copy the current drive data onto the new one. The final step
will be to run installboot to put the boot info onto the new drive.

Typing "man installboot", "man dump", "man format" should get you
the info on flags you should use.

************************
Use dd, but use it with caution! Type man dd for info.

************
You can make a 1:1 copy of disks using dd provided that the disks have the
exact same geometry. The advantages of this method are a) fast, b) you
don't need to partition the new disk, and c) installboot information is
automatically cloned. A typical command might look like:
    dd if=/dev/rdsk/c0t0d0s2 of=/dev/rdsk/c0t1d0s2
Note that slice 2 refers to the entire disk.

There is another procedure that uses ufsdump/ufsrestore. This is the one I
usually use because it is easy to tailor to cloning disks or filesystems.
It is particularly useful if your disk drives are not identical. One
variant that I frequently use is to create an image of each filesystem
on my
disk and save it to a transfer disk. In my case, I usually have everything
in the root partition and so I only need to dump that one filesystem. My
transfer disk is an external hard drive that has been formatted as a data
disk that is large enough to hold multiple dumps of my root partition.
That
allows me to save images of filesystems built for different architectures
(e.g. Ultra 30, Ultra 10). I then restore the appropriate image to any new
disk that is large enough to hold the filesystem. The example below is a
procedure that I've used under Solaris 7:
Create the image:
1) shutdown the Sun computer
2) physically attach the transfer disk to the computer
3) boot on the Solaris installation CD
   quit the install program and open a shell tool
4) mount the transfer disk on /mnt, e.g.
     mount /dev/dsk/c0t2d0s2 /mnt
5) cd /mnt
6) issue the dump command (assumes filesystem to be cloned is on c0t0d0s0):
     ufsdump 0f myfilename /dev/rdsk/c0t0d0s0 7) shutdown the Sun and
disconnect the transfer disk.
Image installation:
1) shutdown the Sun computer
2) put a new hard drive into the Sun computer
3) attach the transfer disk to the computer
4) boot on the Solaris installation CD
   quit the install program and open a shell tool
5) partition the new disk using the format command
6) create a filesystem for root (and optionally other filesystems) on the
new disk
   e.g. newfs /dev/rdsk/c0t0d0s0
7) mount the new filesystem on /a
   e.g.
      mount /dev/dsk/c0t0d0s0 /a
8) mount the transfer disk on /mnt
   e.g.
      mount /dev/dsk/c0t2d0s2 /mnt
9) cd /a
10) ufsrestore xf /mnt/myfilename
    when prompted, set owner mode, only 1 volume
11) cd /
12) umount /a
13) fsck /dev/rdsk/c0t0d0s0
14) cd /usr/platform/`uname -i`/lib/fs/ufs
15) installboot bootblk /dev/rdsk/c0t0d0s0
16) shutdown the computer
17) remove the transfer disk and then boot.
***********
Received on Mon May 23 2005 - 15:33:51 MST

This archive was generated by hypermail 2.4.0 : Sat Jun 10 2023 - 17:44:25 MST