3 # Reads old MDS config logs for transferring to a MGS
5 ###############################################################################
13 Usage: `basename $0` <mdsdev> <newfsname>
15 <mdsdev> the MDS disk device (e.g. /dev/sda1)
16 <newfsname> the name of the new filesystem (e.g. testfs)
18 This script will extract old config logs from an MDS device to a
19 temporary location ($TMP). During the upgrade procedure, mount the
20 MGS disk as type ldiskfs (e.g. mount -t ldiskfs /dev/sda
21 /mnt/temp), then copy these logs into the CONFIGS directory on the
22 MGS (e.g. /mnt/temp/CONFIGS). Logs from many MDS's can be added
23 in this way. When done, unmount the MGS, and then re-mount it as
24 type lustre to start the service.
36 DEBUGFS="debugfs -c -R"
39 FILES=`$DEBUGFS "ls -l LOGS" $DEV | awk '{print $9}' | awk '/[a-z]/ {print $1}'`
41 for FILE in ${FILES}; do
42 $DEBUGFS "dump LOGS/$FILE $TMP/temp" $DEV 2> /dev/null
43 MDC=`strings $TMP/temp | grep MDC`
44 LOV=`strings $TMP/temp | grep lov`
45 if [ -n "$MDC" ]; then
48 if [ -n "$LOV" ]; then
51 echo "Can't determine type for log '$FILE', skipping"
55 echo -n "Copying log '$FILE' to '${FSNAME}-${TYPE}'. Okay [y/n]?"
57 if [ "$OK" = "y" ]; then
58 mv $TMP/temp $TMP/${FSNAME}-${TYPE}