wikiC/2.06
Main page
Alphabetic index
Recent Edits

irix/clone system disk

login 38.107.179.241

This page describes how to CLONE AN IRIX SYSTEM DISK.
I 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

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.


History of this page