Last updated on:
Sunday, July 06, 2008
Software
Information
Community
News
Fun
Credits
|
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
- On the linux1 system, create a mount point for BB2A
mkdir /mnt/bb2a
- Shut down the linux2 and linux3 systems (if either are up).
- On linux1, bring BB29 and BB2A online
chccwdev -e 0.0.BB29
chccwdev -e 0.0.BB2A
- 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.
- Format the target volume
dasdfmt -b 4096 -P -f /dev/dasdc
Verify the device address being formatted and reply "yes"
- 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.
- Double check the DASD device names against addresses before copying
cat /proc/dasd/devices
- Copy BB29 to BB2A
dd if=/dev/dasdb of=/dev/dasdc
- 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.
- Update the file system label
e2label /dev/dasdc1 BB2A
- Edit the following files
- 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
- Unmount BB2A
umount /mnt/bb2a
- Put BB29 and BB2A offline
chccwdev -d 0.0.BB29
chccwdev -d 0.0.BB2A
- Boot the linux3 system
- 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
- Make sure that both linux1 and linux2 are shut down
- 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
*/
//
- 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
*/
//
- IPL linux1 from BB28
- On the linux1 system, create a mount point for BB29
mkdir /mnt/bb29
- Vary BB29 online to linux1
chccwdev -e 0.0.bb29
- 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.
- 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.
- Update the file system label
e2label /dev/dasdm1 BB29
- Edit the following files
- 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
- Unmount BB29
umount /mnt/bb29
- Put BB29 offline
chccwdev -d 0.0.BB29
- Boot the linux2 system
|