SUMMARY: Partition mirroring.

From: Suomi Mika ttl (msuomi@tiger.ttl.fi)
Date: Mon Dec 13 1993 - 06:14:21 CST


Partition mirroing.

        Hello,

        I got 3 different solutions:

        1a. Copying, there is good program for that, lfu.
            It can be found ftp.dcs.ed.ac.uk.
            It's very useful program for many different purposes.

        1b. dump. I don't test that, but here is it:

            (cd /src_fs && dump 0sf 9999999 -) | (cd /dst_fs && restore -xf -)

        1c. rdist -R. read manpage.

        2. Following guide. But, SunOS not need kernel configuration
            anymore. So skip step 5. We follow that guidelines.

        3. Sun Online DiskSuite. This is best solution, but it need
            hardware and cost money. If machine is important server
            this is only choice which really works.

        Remember write bootblock too, if you copy / partition or you
        copy doesn't boot.

        Than's everybody who answered !

_____________________________________________________________________________
                              _____________
Mika Suomi msuomi@ttl.fi /_ _/_ __/ / Turku Telephone Company
Tel: +358 21 621182 / / / / / /__ Linnankatu 4
Fax: +358 21 502615 /_/ /_/ /____/ 20100
_____________________________________________________________________________

    How to make an shadow bootable root disk on an sd drive 1991 Aug 13
    =======================================================
 
    For this procedure, a Sun 3/80 called accord will be used as an example.
    Accord has two disks :
    1) /dev/sd6 internal, primary boot disk
    2) /dev/sd0 external, shadow boot disk
 
    Perform the following operations on accord.
 
    1) Create the various partitions on the shadow disk drive.
       # format
         select 0 (ie sd0 accord's external disk)
         select the partition menu
         set a partition to 40 cylinders (ie 10MB)
         set b partition to 80 cylinders (ie 20MB)
         set c partition to 1237 cylinders (ie 315MB)
         set g partition to 400 cylinders (ie 100MB)
         set h partition to 717 cylinders (ie 187MB)
 
         write the partition map and label to the disk
         quit
         quit
 
    2) Create a new file system for the various partitions.
       # newfs /dev/rsd0a
       # newfs /dev/rsd0g
       # newfs /dev/rsd0h
 
    3) Dump all the root partition onto shadow root partition.
       # mount /dev/sd0a /mnt
       # cd /mnt
       # dump 0f - /dev/sd6a | restore rf -
       # rm restoresymtable
       # cd /
       # umount /mnt
       # fsck /dev/rsd0a
       # mount /dev/sd0a /mnt
       # cd /usr/mdec
       # installboot /mnt/boot bootsd /dev/rsd0a - all sd's must match
       # cd /
       # vi /mnt/etc/fstab
         - change the sd6 entries to sd0 entries
       # umount /mnt
       # fsck /dev/rsd0a
 
    4) Dump the usr partition onto the shadow usr partition. If there is no
       shadow usr partition then skip this step.
       # mount /dev/sd0g /mnt
       # cd /mnt
       # dump 0f - /dev/sd6g | restore rf -
       # rm restoresymtable
       # cd /
       # umount /mnt
       # fsck /dev/rsd0g

! 5) Create a customized kernal for the shadow root partition.
! # cd /usr/sys/sun3x/conf
! # cp ACCORD ACCORD.sd0 # use sd0 since that is the disk
! # vi ACCORD.sd0
! - change the line
! config vmunix swap generic
! -to the following line
! config vmunix root on sd0 swap on sd0
! # config ACCORD.sd0
! # cd ../ACCORD.sd0
! # make
!
! # mount /dev/sd0a /mnt
! # rm /mnt/vmunix*
! # cp vmunix /mnt/vmunix.sd0
! # ln /mnt/vmunix.sd0 /mnt/vmunix

    6) Create the shadow /etc/fstab file.
       # cp /etc/fstab /etc/fstab.shad
       # vi /etc/fstab
         - add some comments that this is the primary mounting table and
           any changes should be done as well to /etc/fstab.shad
       # vi /etc/fstab.shad
         - add some comments that this is the shadow mounting table and
           it should be same as the primary except for / & /usr
         - change the mount points for / & /usr
       # cp /etc/fstab.shad /mnt/etc/fstab
 
       # umount /mnt
       # fsck /dev/rsd0a
 
    7) Shutdown the machine and attempt to boot from the shadow disk.
       # halt
> b sd(1,0,0)
 
    8) If the shadow partition does not boot then the installboot command
       does not work. This is supposed to be fix in SunOS 4.1.1 with a
       patch however if not then continue on with the remaining steps.
 
    9) Boot up the machine in single user mode
> b sd() -sw
 
   10) Make a copy of the alternate kernal to be a temporary kernal of the
       regular boot partition.
       # cp /usr/sys/sun3x/conf/ACCORD.sd0/vmunix /vmunix.sd0
       # ls -li /vmunix* make sure /vmunix and the current kernal
                               have the same inode # (ie hard link)
       # rm /vmunix
       # ln /vmunix.sd0 /vmunix
       # ls -li /vmunix* make sure /vmunix and the alternate kernal
                               have the same inode # (ie hard link)

   11) Boot up the machine in single user mode from the regular boot
       partition but with the alternate boot partition's kernal.
       # sync
       # halt
> b sd() -sw
 
   12) The alternate partition should now be booted.
       # /etc/mount - verify the / entry is the alternate root
 
   13) Run the install boot command for the alternate boot partition again
       (this time it will work).
       # cd /usr/mdec
       # installboot /mnt/boot bootsd /dev/rsd0a - all sd's must match
 
   14) Restore the regular boot partition to its proper kernal.
       # cd /
       # /etc/mount /dev/sd6a /mnt
       # cd /mnt
       # ls -li vmunix*
       # rm vmunix
       # ln vmunix.08 vmunix where vmunix.08 is the current proper kernal
       # ls -li vmunix*
       # cd /
       # /etc/umount /mnt
       # sync
 
   15) Boot up the machine in single user mode from the alternate boot
       partition but this time it should work.
       # sync
       # halt
> b sd(1,0,0) -sw
 
   Huraii.. the alternate boot partition works perfectly now!
 
   16) Boot up the machine in single user mode from the regular boot
       partition and this time from its proper kernal.
       # sync
       # halt
> b sd() -sw
 
   Thank goodness the normal boot partition works perfectly too!
 
   17) Boot up the machine in multi-user mode from the regular boot
       partition.
       # sync
       # halt
> b sd()
 
   Looks good, so go home and relax, you deserve it.

 
That's it.



This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:08:32 CDT