From 476c3387cc4a44e9aa2a90b014d4146ebeb4bc17 Mon Sep 17 00:00:00 2001 From: phamt Date: Sun, 24 Feb 2013 02:02:30 +0000 Subject: [PATCH] Fixed cloning where fdasd is need for vanilla disks. git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.8@15246 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/zvm.pm | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/zvm.pm b/xCAT-server/lib/xcat/plugins/zvm.pm index e046fc042..23ad9c248 100644 --- a/xCAT-server/lib/xcat/plugins/zvm.pm +++ b/xCAT-server/lib/xcat/plugins/zvm.pm @@ -1555,7 +1555,7 @@ sub changeVM { # Copy source disk to target disk (4096 block size) xCAT::zvmUtils->printLn( $callback, "$tgtNode: Copying source disk ($srcDevNode) to target disk ($tgtDevNode)" ); - $out = `ssh $::SUDOER\@$hcp "$::SUDO /bin/dd if=/dev/$srcDevNode of=/dev/$tgtDevNode bs=4096"`; + $out = `ssh $::SUDOER\@$hcp "$::SUDO /bin/dd if=/dev/$srcDevNode of=/dev/$tgtDevNode bs=4096 oflag=sync"`; # Disable disks $out = xCAT::zvmUtils->disableEnableDisk( $::SUDOER, $hcp, "-d", $tgtLinkAddr ); @@ -4134,19 +4134,19 @@ sub clone { # Sleep 2 seconds to let the system settle sleep(2); - + # Automatically create a partition using the entire disk xCAT::zvmUtils->printLn( $callback, "$tgtNode: Creating a partition using the entire disk ($tgtDevNode)" ); $out = `ssh $::SUDOER\@$hcp "$::SUDO /sbin/fdasd -a /dev/$tgtDevNode"`; # Copy source disk to target disk xCAT::zvmUtils->printLn( $callback, "$tgtNode: Copying source disk ($srcAddr) to target disk ($tgtAddr)" ); - $out = `ssh $::SUDOER\@$hcp "$::SUDO /bin/dd if=/dev/$srcDevNode of=/dev/$tgtDevNode bs=4096"`; + $out = `ssh $::SUDOER\@$hcp "$::SUDO /bin/dd if=/dev/$srcDevNode of=/dev/$tgtDevNode bs=4096 oflag=sync"`; } else { # Copy source disk to target disk # Block size = 512 xCAT::zvmUtils->printLn( $callback, "$tgtNode: Copying source disk ($srcAddr) to target disk ($tgtAddr)" ); - $out = `ssh $::SUDOER\@$hcp "$::SUDO /bin/dd if=/dev/$srcDevNode of=/dev/$tgtDevNode bs=512"`; + $out = `ssh $::SUDOER\@$hcp "$::SUDO /bin/dd if=/dev/$srcDevNode of=/dev/$tgtDevNode bs=512 oflag=sync"`; # Force Linux to re-read partition table xCAT::zvmUtils->printLn( $callback, "$tgtNode: Forcing Linux to re-read partition table" ); @@ -4340,10 +4340,10 @@ EOM"`; $out = `ssh $::SUDOER\@$hcp "$::SUDO rm -f $cloneMntPt/etc/ssh/ssh_host_*"`; # Flush disk - $out = `ssh $::SUDOER\@$hcp "$::SUDO sync"`; + $out = `ssh $::SUDOER\@$hcp "$::SUDO /bin/sync"`; # Unmount disk - $out = `ssh $::SUDOER\@$hcp "$::SUDO umount $cloneMntPt"`; + $out = `ssh $::SUDOER\@$hcp "$::SUDO /bin/umount $cloneMntPt"`; # Remove mount point $out = `ssh $::SUDOER\@$hcp "$::SUDO rm -rf $cloneMntPt"`;