1 export PATH="$PATH:./../utils:/r/sbin:/r/usr/bin"
5 TARBALL=${TARBALL:-doc.tgz}
6 DEBUGFS=${DEBUGFS:-debugfs}
7 MNTPATH=${MNTPATH:-"/mnt/lustre"}
8 TARCMD=${TARCMD:-"tar"}
9 UNTARCMD=${UNTARCMD:-"tar -zxvf"}
10 CPCMD=${CPCMD:-"cp -f"}
11 CACHEMDS=${CACHEMDS:-$TMP/mds1-`hostname`}
12 REALMDS=${REALMDS:-$TMP/mds3-`hostname`}
14 CACHEOST=${CACHEOST:-$TMP/ost1-`hostname`}
15 REALOST=${REALOST:-$TMP/ost3-`hostname`}
17 MDS_CMOBD_INDEX=${MDS_CMOBD_INDEX:-12}
18 OST_CMOBD_INDEX=${OST_CMOBD_INDEX:-14}
20 MDS_COBD_INDEX=${MDS_COBD_INDEX:-22}
21 OST_COBD_INDEX=${OST_COBD_INDEX:-19}
24 if ! [ -e "$TARBALL" ]; then
25 echo "$TARBALL does not exist"
32 echo "sleep 20 secs sync fs for show the usages of fs"
37 string=`${DEBUGFS} -R stats $cache_mds | tail -n 2`
40 string=`${DEBUGFS} -R stats $cache_ost | tail -n 2`
46 device $OST_CMOBD_INDEX
48 device $MDS_CMOBD_INDEX
55 device $OST_COBD_INDEX
57 device $MDS_COBD_INDEX
64 device $OST_COBD_INDEX
66 device $MDS_COBD_INDEX
71 echo "before test ...."
72 show_filesystem $CACHEMDS $CACHEOST
74 #first step cp the tar to cache dev and untar it
75 echo "cp $TARBALL to lustre dir and untar ..."
76 ${CPCMD} ${TARBALL} ${MNTPATH} || exit 1
77 ${UNTARCMD} ${MNTPATH}/`basename ${TARBALL}` -C ${MNTPATH} > /dev/null || exit 2
79 #show status of the filesystem
80 echo after cp show the filsystem....
81 show_filesystem $CACHEMDS $CACHEOST
84 #second step flush and cache off these file to the real dev
87 echo "flush these tar and files....."
88 show_filesystem $CACHEMDS $CACHEOST
91 #third step and write files to real dev
93 $CPCMD -f $TARBALL $MNTPATH/new || exit 1
94 $UNTARCMD $MNTPATH/new/`basename $TARBALL` -C $MNTPATH/new > /dev/null || exit 2
95 show_filesystem $CACHEMDS $CACHEOST