Tux on VM

Last updated on:
Sunday, July 06, 2008

Software

Information

Community

News

Fun

Credits




Valid XHTML 1.0 Transitional
Linux for Big Iron

Red Hat Linux LPAR Mode Cloning Process

Contributed by Mike W. Nettles, January 2007.

This HOWTO will show two different methods of cloning a Red Hat Linux system running in an LPAR. The first will use native Linux tools, and the second will use MVS tools.

The first scenario will use one Linux system (linux1) to copy a second Linux system (linux2) to yet a third Linux system (linux3). The Linux LPARs and their respective DASD volumes are:
  • linux1 - BB28
  • linux2 - BB29
  • linux3 - BB2A
  1. On the linux1 system, create a mount point for BB2A
    mkdir /mnt/bb2a
    
  2. Shut down the linux2 and linux3 systems (if either are up).
  3. On linux1, bring BB29 and BB2A online
    chccwdev -e 0.0.BB29
    chccwdev -e 0.0.BB2A
    
  4. Figure out what device names were assigned to the volumes:
    grep -i -E "bb2a|bb29" /proc/dasd/devices
    
    For this example, we will assume that BB29 was /dev/dasdb, with a single partition of /dev/dasdb1, and BB2A was /dev/dasdc.
  5. Format the target volume
    dasdfmt -b 4096 -P -f /dev/dasdc
    
    Verify the device address being formatted and reply "yes"
  6. Create a partition on the target volume
    fdasd -a /dev/dasdc
    
    Strictly speaking, this step is not necessary, since the following steps will copy the partition table over along with all the other data. Still, it's not a bad practice to do it anyway.
  7. Double check the DASD device names against addresses before copying
    cat /proc/dasd/devices
    
  8. Copy BB29 to BB2A
    dd if=/dev/dasdb of=/dev/dasdc
    
  9. Mount the target volume file system
    mount /dev/dasdc1 /mnt/bb2a
    
    If it mounts without any errors, the copy was very likely successful. Now we will modify the target volume so that it will be usable as linux3.
  10. Update the file system label
    e2label /dev/dasdc1 BB2A
    
  11. Edit the following files
    • /mnt/bb2a/etc/sysconfig/network
      • Change the HOSTNAME to linux3
    • /mnt/bb2a/etc/sysconfig/network-scripts/ifcfg-eth0
      • Change the IP address
    • /mnt/bb2a/etc/hosts
      • Change the hostname to linux3
      • Change the IP address
    • /mnt/bb2a/etc/modprobe.conf
      • Change the "options dasd_mod dasd=" line to say dasd=bb2a
    • /mnt/bb2a/etc/fstab
      • Change the root file system entry to use label BB2A
      LABEL=BB2A     /     ext3     defaults     1  1
      
  12. Rebuild the IPL text for the target volume
    chroot /mnt/bb2a
    mount -t proc proc /proc
    mkinitrd -v /boot/initrd-bb2a-yymmdd-hhss.img $(uname -r)
         initrd-bb2a.img is the new initrd file name
    vi /etc/zipl.conf
         Change ramdisk to use /boot/initrd-bb2a-yymmdd-hhss.img
         Change parameters to parameters="root=LABEL=BB2A"
    zipl -x
         Rewrite the IPL text and turn off reply option at IPL
    umount /proc
    exit
         To get out of chroot
    cd
         To undo earlier cd /mnt/bb2a
    
  13. Unmount BB2A
    umount /mnt/bb2a
    
  14. Put BB29 and BB2A offline
    chccwdev -d 0.0.BB29
    chccwdev -d 0.0.BB2A
    
  15. Boot the linux3 system
  16. If all is OK, reboot the linux2 system

The second scenario presumes that all the DASD involved can be brought online to your MVS system. MVS tools will be used to copy the linux1 system to linux2. The Linux LPARs and their respective DASD volumes are:
  • linux1 - BB28
  • linux2 - BB29
  1. Make sure that both linux1 and linux2 are shut down
  2. Perform a concurrent DFDSS full volume backup of BB28
    //DUMP1   EXEC PGM=ADRDSSU,REGION=4096K,TIME=1439
    //******************************************************************
    //**** ****
    //**** MAKE SURE LINUX1 IS DOWN BEFORE STARTING CONCURRENT COPY ****
    //**** ****
    //******************************************************************
    //SYSPRINT DD SYSOUT=*
    //DD1  DD  UNIT=3390,VOL=SER=0XBB28,DISP=SHR
    //TAPE DD DISP=(,CATLG,DELETE),LABEL=(1,SL,EXPDT=99000),
    //   UNIT=TAPE,
    //   VOL=(,,,20),  
    //   DSN=SPFBLD.V0XBB28.D060923.REL1301
    //SYSIN  DD  *
     DUMP FULL INDDNAME(DD1) - 
     OUTDDNAME(TAPE) - 
     CONCURRENT -
     WAIT(2,50) ALLEXCP
    */
    //
    
  3. Run a full volume restore to BB29
    //RESTORE EXEC PGM=ADRDSSU,REGION=4000K,TIME=1439
    /***********************************************************
    //**** ****
    //**** MAKE SURE LINUX2 IS DOWN BEFORE STARTING RESTORE ****
    //**** ****
    //**********************************************************
    //SYSPRINT DD  SYSOUT=*
    //DISK   DD    UNIT=3390,VOL=SER=0XBB29,DISP=OLD
    //TAPE   DD    DSN=SPFBLD.V0XBB29.D060923.REL1301,DISP=SHR
    //SYSIN  DD  *
     RESTORE FULL -
     INDD(TAPE) -
     OUTDD(DISK) -
     PURGE -
     CAN
    */
    //
    
  4. IPL linux1 from BB28
  5. On the linux1 system, create a mount point for BB29
    mkdir /mnt/bb29
    
  6. Vary BB29 online to linux1
    chccwdev -e 0.0.bb29
    
  7. Figure out what device names were assigned to the volumes:
    grep -i bb29 /proc/dasd/devices
    
    For this example, we will assume that BB29 was /dev/dasdm, with a single partition of /dev/dasdm1.
  8. Mount the target volume file system
    mount /dev/dasdm1 /mnt/bb29
    
    If it mounts without any errors, the copy was very likely successful. Now we will modify the target volume so that it will be usable as linux2.
  9. Update the file system label
    e2label /dev/dasdm1 BB29
    
  10. Edit the following files
    • /mnt/bb29/etc/sysconfig/network
      • Change the HOSTNAME to linux2
    • /mnt/bb29/etc/sysconfig/network-scripts/ifcfg-eth0
      • Change the IP address
    • /mnt/bb29/etc/hosts
      • Change the hostname to linux2
      • Change the IP address
    • /mnt/bb29/etc/modprobe.conf
      • Change the "options dasd_mod dasd=" line to say dasd=bb29
    • /mnt/bb29/etc/fstab
      • Change the root file system entry to use label BB29
      LABEL=BB29     /     ext3     defaults     1  1
      
  11. Rebuild the IPL text for the target volume
    chroot /mnt/bb29
    mount -t proc proc /proc
    mkinitrd -v /boot/initrd-bb29-yymmdd-hhss.img $(uname -r)
         initrd-bb29-yymmdd-hhss.img is the new initrd file name
    vi /etc/zipl.conf
         Change ramdisk to use /boot/initrd-bb29-yymmdd-hhss.img
         Change parameters to parameters="root=LABEL=BB29"
    zipl -x
         Rewrite the IPL text and turn off reply option at IPL
    umount /proc
    exit
         To get out of chroot
    cd
         To undo earlier cd /mnt/bb29
    
  12. Unmount BB29
    umount /mnt/bb29
    
  13. Put BB29 offline
    chccwdev -d 0.0.BB29
    
  14. Boot the linux2 system
 

Site hosting courtesy of Velocity Software