From f98871acc95d05ad6992fe4968fe4a75f39a516f Mon Sep 17 00:00:00 2001 From: sjing Date: Tue, 28 Sep 2010 06:42:35 +0000 Subject: [PATCH] FScheck when mkdsklsnode git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@7696 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/aixinstall.pm | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/xCAT-server/lib/xcat/plugins/aixinstall.pm b/xCAT-server/lib/xcat/plugins/aixinstall.pm index f7f9bece2..ef089d471 100644 --- a/xCAT-server/lib/xcat/plugins/aixinstall.pm +++ b/xCAT-server/lib/xcat/plugins/aixinstall.pm @@ -6823,6 +6823,28 @@ sub bkupNIMresources } } + # verify FS size before creating new backup + # get bkdir size + my $ducmd = qq~/usr/bin/du -sm $bkdir | /usr/bin/awk '{print \$1}'~; + my $bksize = xCAT::Utils->runcmd("$ducmd", -1); + if ($::RUNCMD_RC != 0) + { + my $rsp; + push @{$rsp->{data}}, "Could not run: \'$ducmd\'\n"; + if ($::VERBOSE) + { + push @{$rsp->{data}}, "$bksize"; + } + xCAT::MsgUtils->message("E", $rsp, $callback); + return 1; + } + + # check FS space, add it if needed + if (&chkFSspace($bkdir, $bksize, $callback) != 0) + { + return undef; + } + # create a new backup file my $bkcmd = "find $bkdir -print |backup -ivqf $bkfile";