Topic
  • 2 replies
  • Latest Post - ‏2014-01-25T02:30:57Z by Junli.Zhang
Ozan_Uzun
Ozan_Uzun
5 Posts

Pinned topic How to clone/restore using IBM Installation Toolkit for PL

‏2014-01-22T19:19:12Z |

Hello,

I have a redhat 6.4 LPAR,  which has just one disk (with LVM).  When I tried to clone  the system,  I can see  a list (attached). When I click one of them, it always sends a warning : Can not find /etc/fstab.

For my test;

I successfully cloned the disk (/dev/sda), also created another lpar and restored the image file to the new LPAR but it did not boot/work.

Does Toolkit support LVM, and which disk I should choose?

Attachments

  • lucio.correia
    lucio.correia
    19 Posts

    Re: How to clone/restore using IBM Installation Toolkit for PL

    ‏2014-01-22T20:29:18Z  

    Hi

    LVM is not supported for now.

    Thanks.

  • Junli.Zhang
    Junli.Zhang
    1 Post

    Re: How to clone/restore using IBM Installation Toolkit for PL

    ‏2014-01-25T02:30:57Z  

    Hi,

    You can using the RedHat6.4 install CD/DVD to do such things. The first thing is to obtain a shell which can follow the steps below:
    0. Boot you lpar using the RedHat6.4 CD/DVD;
    1. Skip CD/DVD media check;
    2. Press OK in the welcome stage;
    3. Select language;
    4. For there is already one os exist on the disk, it will ask you Reinstall or Update, here precess ctrl+z to log into a shell
    When you obtain the shell, you can do the backup operation.

    Partition on sda:
    +---+--------+----+-----------------------+
    |mbr|PrepBoot|Boot|   LVM: VolGroup       |
    +---+--------+----+-----------------------+
      ^     ^       ^    +--------^--------+
     512b 4~8M   ~512M  lv_root          lv_swap

    sh-4.1# fdisk -l /dev/sda

    Disk /dev/sda: 16.1 GB, 16106127360 bytes
    64 heads, 32 sectors/track, 15360 cylinders
    Units = cylinders of 2048 * 512 = 1048576 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0xe8010200

       Device Boot      Start         End      Blocks   Id  System
    /dev/sda1   *           2           5        4096   41  PPC PReP Boot
    Partition 1 does not end on cylinder boundary.
    /dev/sda2               6         505      512000   83  Linux
    Partition 2 does not end on cylinder boundary.
    /dev/sda3             506       15360    15211520   8e  Linux LVM
    Partition 3 does not end on cylinder boundary.

    Disk /dev/sdb: 21.5 GB, 21474836480 bytes
    64 heads, 32 sectors/track, 20480 cylinders
    Units = cylinders of 2048 * 512 = 1048576 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0x787b0e00

       Device Boot      Start         End      Blocks   Id  System
    /dev/sdb1               1        8193     8389616   83  Linux

    sh-4.1# lvchange -ay VolGroup/lv_root
    sh-4.1# mkdir -p /media/rootvg
    sh-4.1# mount /dev/VolGroup/lv_root /media/rootvg
    sh-4.1# rootvgsm=$[ `df --block-size=1m /media/rootvg|grep /media/rootvg|awk '{print $2}'` + 512 ]
    sh-4.1# umount /media/rootvg
    sh-4.1# lvresize -r -L ${rootvgsm}M /dev/VolGroup/lv_root
    sh-4.1# mkfs.ext4 /dev/sdb1
    sh-4.1# mkdir -p /media/clone
    sh-4.1# mount /dev/sdb1 /media/clone
    sh-4.1# cd /media/clone
    sh-4.1# sfdisk -d /dev/sda > diskp.log
    sh-4.1# dd if=/dev/sda of=./mbr.img bs=512 count=1
    sh-4.1# dd if=/dev/sda1 of=./prepboot.img
    sh-4.1# dd if=/dev/sda2 of=./boot.img
    sh-4.1# mount /dev/VolGroup/lv_root /media/rootvg
    sh-4.1# rootvgsm=$[ `df --block-size=1m /media/rootvg|grep /media/rootvg|awk '{print $2}'` + 1024 ]
    sh-4.1# umount /media/rootvg/
    sh-4.1# dd if=/dev/zero of=./rootvg.img bs=1M count=$rootvgsm
    sh-4.1# mknod /dev/loop8 b 7 8
    sh-4.1# chmod 660 /dev/loop8
    sh-4.1# losetup /dev/loop8 ./rootvg.img
    sh-4.1# vgextend VolGroup /dev/loop8
    sh-4.1# sync
    sh-4.1# lvconvert -m +1 VolGroup/lv_root /dev/loop8
    sh-4.1# sync
    sh-4.1# lvconvert --splitmirrors 1 -n lv_root_n  VolGroup/lv_root
    sh-4.1# lvchange -an VolGroup/lv_root_n
    sh-4.1# vgsplit -v VolGroup VolGroup_n /dev/loop8
    sh-4.1# lvcreate -L 256M -n lv_swap VolGroup_n
    sh-4.1# lvchange -an VolGroup_n/lv_swap
    sh-4.1# lvchange -ay VolGroup_n/lv_root_n
    sh-4.1# mount /dev/VolGroup_n/lv_root_n /media/rootvg/
    sh-4.1# sed -i -e 's:VolGroup:VolGroup_n:g' -e 's:lv_root:lv_root_n:g' /media/rootvg/etc/fstab
    sh-4.1# umount /media/rootvg/
    sh-4.1# lvchange -an VolGroup_n/lv_root_n
    sh-4.1# vgexport VolGroup_n
    sh-4.1# losetup -d /dev/loop8
    sh-4.1# rm /dev/loop8
    sh-4.1# mkdir -p /media/boot
    sh-4.1# mount ./boot.img /media/boot/ -o loop
    sh-4.1# sed -i -e 's:VolGroup:VolGroup_n:g' -e 's:lv_root:lv_root_n:g' /media/boot/etc/yaboot.conf
    sh-4.1# umount /media/boot/
    sh-4.1# ls -lh
    total 4.1G
    -rw-r--r--. 1 root root 500M 2013-10-16 08:19 boot.img
    -rw-r--r--. 1 root root  259 2013-10-16 07:44 diskp.log
    drwx------. 2 root root  16K 2013-10-16 07:43 lost+found
    -rw-r--r--. 1 root root  512 2013-10-16 07:44 mbr.img
    -rw-r--r--. 1 root root 4.0M 2013-10-16 07:44 prepboot.img
    -rw-r--r--. 1 root root 3.7G 2013-10-16 08:16 rootvg.img