Clone System Disk

From Higher Intellect Wiki
Jump to: navigation, search

This page describes how to CLONE AN IRIX SYSTEM DISK. You should read through this procedure to understand the steps involved, but there is a script that automates this; scroll to the bottom and follow the relevant link in the See also section.

To use IRIX-disk cloning as a backup strategy. It is a bit expensive perhaps because I have to keep 2 SCSI disks (cloned copies of my combined user/root disk) in the closet as backups.

In the list below I assume you are running your IRIX system on (i.e. booted from) disk #1 and you want to clone it to spare disk #3.

The first time (with an uninitialised disk) cloning takes about 10 steps. A second time (when the disk is already prepared), one may start at step 7 to make a backup-clone.


1) BECOME SUPERUSER:

   su

2) FIRST THOROUGHLY TEST THE DRIVE THAT HAS TO BECOME THE CLONE:

   fx -x
    fx: "device-name" = (dksc)                       <enter>
    fx: ctlr# = (0)                                  <enter>
    fx: drive# = (1)                                 3
    fx: lun# = (0)                                   <enter>
     fx>                                             exercise
     fx/exercise>                                    butterfly
  	modifier = (rd-only)                           wr-cmp
  	starting block# = (0)                          <enter>
  	nblocks = (143374744)                          <enter>
  	nscans = (1)                                   <enter>
  	about to destroy data on disk dksc(0,3,0)! ok? yes
     ..
    ..
    label info has changed for disk dksc(0,3,0).
    write out changes?                               yes
   exit

3) ADD SGI LABEL:

   fx -x
   fx: "device-name" = (dksc) 
    fx: ctlr# = (0) 
    fx: drive# = (1) 3
    fx: lun# = (0)
     auto
     about to destroy data on disk dksc(0,3,0)! ok? yes
     (Several tests... may take a long long time, you can
      abort them.)
   exit

It is perhaps easier to do this via the Disk Manager desktop-interface: just initialise the disk. This only takes a few seconds and also puts a SGI label on the disk.

4) MAKE ROOTDRIVE PARTITIONING: List the disk partitioning of the system (root) disk:

   prtvtoc


List the disk partitioning of the option disk that is to be the clone:

   prtvtoc /dev/rdsk/dks0d3vh


Compare the disk partitioning of the two disks. They must have the same layout for the root and (if used) the usr partition. If they are not the same, repartition the option disk to match the system disk. In the easiest case:

   fx "dksc(0,3)"
    repartition
    rootdrive
    type of data partition = (xfs)
    ..
    exit

Then compare the prtvtoc outputs again.

5) ADD STAND-ALONE SHELL (AND OTHER PROGRAMS) TO VOLUME HEADER: If necessary, first copy the appropriate sash (on your systemdisk, SCSI ID=1) to the /stand directory:

   dvhtool /dev/rdsk/dks0d1vh                          (CAREFUL!)
   vd                                                  (volume directory)
   l                                                   (list)
   g sash /stand/sash_Octane
   g ide /stand/ide_Octane
   g IP30prom /stand/IP30prom_Octane
   quit


Then add the required programs to a volume header:

   dvhtool /dev/rdsk/dks0d3vh                      (SCSI ID=3)
   vd                                              (volume directory)
   l                                               (list)
   a /stand/sash_Octane sash                       (add to volume header)
   a /stand/ide_Octane ide
   a /stand/IP30prom_Octane IP30prom
   l
   quit
   write
   quit


(Note: On a Tezro, the files are "symmon" and "sash" no "ide" or "prom", but everything else is the same, but you will see that when you enter "l" for list.. Other systems will have different files.. try to make it look like what you saw on the original disk.)

6) MAKE FILESYSTEM: To make an XFS root filesystem with a 4 KB block size and a 1000 block internal log (the default values), give this command:

   mkfs /dev/dsk/dks0d3s0

7) SWITCH TO SINGLE USER MODE AND MOUNT:

   single
   mkdir /clone
   mount /dev/dsk/dks0d3s0 /clone
   cd /clone 

8) XFSDUMP:

   xfsdump -l 0 - / | xfsrestore - . 

Notice the 0, it is a NULL character, not an O!

9) UNMOUNT AND SHUTDOWN:

   cd ..
   umount /clone 
   rmdir /clone 
   shutdown

10) TEST Swap drives (in an Octane) and try if your clone is really bootable.

Another Method

Here's how to do it.

Partition you destination disk in such a way, that you are happy with it.

do mkfs on the partion(s).

mount it (them) on /.Z

For IRIX versions below 6.2 do:

umount /dev/fd /proc
mkfs /dev/rdsk/dks0d2s0
 with 2 partitions do also: mkfs /dev/rdsk/dks0d2s6
mount /dev/dsk/dks0d2s0 /.Z
 with 2 partitions do also: (mkdir /.Z/usr;mount /dev/dsk/dks0d2s6 /.Z/usr)
(cd /;tar cf - .[a-zA-Y0-9]* *|(cd /.Z;tar xf -)
cd /stand
dvhtool -v c sash sash /dev/rdsk/dks0d2vh
mntproc

Shutdown the system, and you destination disk is ready.

For IRIX 6.2 and higher (or an xFS filesystem) do:

umount /dev/fd /proc
xfs_growfs /
xfs_growfs /usr
  to determine the current blocksize (shown as fx. bsize=512 on second line)
mkfs -b size=<found size> /dev/rdsk/dks0d2s0
 with 2 partitions do also: mkfs -b size= /dev/rdsk/dks0d2s6
mount /dev/dsk/dks0d2s0 /.Z
 with 2 partitions do also: (mkdir /.Z/usr;mount /dev/dsk/dks0d2s6 /.Z/usr)
(cd /;tar cf - .[a-zA-Y0-9]* *|(cd /.Z;tar xf -)
cd /stand
dvhtool -v g sash sash 
dvhtool -v c sash sash /dev/rdsk/dks0d2vh
mntproc

A Hack by Jeroen Kleinnibbelink

© '96/'97 Dr.J Productions

See also



Share your opinion