ufsdump/ufsrestore error

From: Colin Haffenden (Chaffend@msxi-euro.com)
Date: Thu Aug 19 2004 - 05:57:59 EDT


Hi All,

I am using ufsdump and ufsrestore in a script to copy one disk to
another. I got the script from Sun's Bigadmin and have added it to the
bottom of this mail.

I ran the script yesterday to backup the system then after an upgrade
went wrong booted from the backup disk. I am now trying to restore the
backup disk back over the original and am getting these errors....

Warning: `.' missing from directory ./sadm/pkg/SUNWcsu/save/109277-03
Warning: `..' missing from directory ./sadm/pkg/SUNWcsu/save/109277-03
Warning: `.' missing from directory ./sadm/pkg/SUNWcsr/save
Warning: `..' missing from directory ./sadm/pkg/SUNWcsr/save
Warning: `.' missing from directory ./sadm/pkg/SUNWadmc
Warning: `..' missing from directory ./sadm/pkg/SUNWadmc
Warning: `.' missing from directory ./sadm/pkg/SUNWkvmx
Warning: `..' missing from directory ./sadm/pkg/SUNWkvmx
expected next file 50, got 47
expected next file 50, got 48
expected next file 50, got 49
expected next file 108, got 107
expected next file 6923, got 6921

These carry on and it's not just one slice that it's occurring on. It
eventually asks whether I want to abort.

If I cd into the directory ./sadm/pkg/SUNWcsu/save/109277-03 and do an
ls I get this error ..

# ls
.: No such file or directory

Does anybody have any ideas why this has done this and what I can do
about it ?

Thanks for any help in advance and I will summarize.

Colin.

Script :

#!/bin/sh
# Original Script written by Constantin Ionescu
# Modified by Carlo Cosolo
# Modified by Peter Baer Galvin
# Modified by John West
# Use and distribute freely

# Define variables for use in the script
# ! Important, these must be set correctly !

# The root disk to duplicate (leave off slice numbers and path)
SRC=c0t0d0

# The empty disk to duplicate it to (leave off slice numbers and path)

DEST=c0t1d0

# The directory to mount destination partitions on while duplicating
MOUNTDIR=/dup_0

# The file name of this script, to rename it on the destination to
avoid execution
SCRIPT=export/home/root/rootcopy

# The slices that should be copied
SLICES="s0 s3 s6 s7"

echo ====================================
echo Disk Copy script started `date`
echo

# Make sure the mount point for duplicate partitions exists
if [ ! -d $MOUNTDIR ]; then
mkdir $MOUNTDIR
chmod 700 $MOUNTDIR
fi

# Partition the duplicate disk, make filesystems, make it bootable
prtvtoc /dev/rdsk/${SRC}s2 > /tmp/vtoc
fmthard -s /tmp/vtoc /dev/rdsk/${DEST}s2
installboot /usr/platform/`uname -i`/lib/fs/ufs/bootblk
/dev/rdsk/${DEST}s0

# Modify the following loop to handle any special cases
for fs in $SLICES
do
        newfs /dev/dsk/${DEST}${fs} < /dev/null; mount
/dev/dsk/${DEST}${fs} ${MOUNTDIR};
        ufsdump 0f - /dev/dsk/${SRC}${fs}|(cd ${MOUNTDIR}; ufsrestore
rf -);
                if [ $fs = "s0" ]; then
                        sed 's/${SRC}/${DEST}/g' /etc/vfstab >
${MOUNTDIR}/etc/vfstab;
                        mv ${MOUNTDIR}/${SCRIPT}
${MOUNTDIR}/${SCRIPT}.DONTRUN;
                fi
        umount ${MOUNTDIR}
done

echo
echo Disk Copy script ended `date`
echo ====================================
echo
This Message has been Checked at MSXI for all known Viruses.
You open this at your own risk. Please make sure all replies are
also virus free.
Also we do not accept or send Attachments of the type .exe, .vbs,
scr, or .bat due to the virus risk they can contain. These types of
attachments will be stripped from the message.

MSXI
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers



This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 23:29:19 EDT