/ Forside / Teknologi / Operativsystemer / Linux / Nyhedsindlæg
Login
Glemt dit kodeord?
Brugernavn

Kodeord


Reklame
Top 10 brugere
Linux
#NavnPoint
o.v.n. 11177
peque 7911
dk 4814
e.c 2359
Uranus 1334
emesen 1334
stone47 1307
linuxrules 1214
Octon 1100
10  BjarneD 875
Problem med båndstation ved backup
Fra : Per Jørgensen


Dato : 14-06-10 08:56

Hey Gruppe.

Jeg har efter langs tids problemer opdateret vores ERP server fra en
FedoraCore til Debian64bit.
På denne server kører vores ERP ssystem MERA som er et færdigt system,
der er placeret i /mera - denne mappe vil jeg gerne pakke samme hver nat
således at det bliver pakket sammen på et bånd - MEN der sker gerne
følgende:

Back-up in progress......
Backing up /mera, /mera
% /mnt/nasback, vol: 0 DUMP: Date of this level 0 dump: Wed Apr 28
00:45:01 2010
DUMP: Dumping /dev/sdb1 (/mera) to /dev/nst0
DUMP: Label: none
DUMP: Writing 10 Kilobyte records
DUMP: mapping (Pass I) [regular files]
DUMP: mapping (Pass II) [directories]
DUMP: estimated 127457617 blocks on 5.31 tape(s).
DUMP: Volume 1 started with block 1 at: Wed Apr 28 00:45:55 2010
DUMP: dumping (Pass III) [directories]
DUMP: dumping (Pass IV) [regular files]
DUMP: 0.54% done at 2290 kB/s, finished in 15:22
DUMP: 2.14% done at 4543 kB/s, finished in 7:37
DUMP: 4.21% done at 5965 kB/s, finished in 5:41
DUMP: 6.12% done at 6501 kB/s, finished in 5:06
DUMP: 8.19% done at 6962 kB/s, finished in 4:40
DUMP: 10.07% done at 7130 kB/s, finished in 4:27
DUMP: 11.99% done at 7276 kB/s, finished in 4:16
DUMP: 13.72% done at 7288 kB/s, finished in 4:11
DUMP: 15.19% done at 7171 kB/s, finished in 4:11
DUMP: 17.11% done at 7270 kB/s, finished in 4:02
DUMP: 18.49% done at 7142 kB/s, finished in 4:02
DUMP: Closing /dev/nst0
DUMP: Volume 1 completed at: Wed Apr 28 01:42:55 2010
DUMP: Volume 1 24000000 blocks (23437.50MB)
DUMP: Volume 1 took 0:57:00
DUMP: Volume 1 transfer rate: 7017 kB/s
DUMP: Change Volumes: Mount volume #2
DUMP: fopen on /dev/tty fails: No such device or address
DUMP: The ENTIRE dump is aborted.
....done
Backup procedure completed
End of dump-procedure

Som man kan se - pakker den kun 25% af selve biblioteket ned på det ene
bånd - hvor den i fedora pakkede hele biblioteket ned på sqamme bånd -
og der er IKKE tilføjet meget data extra siden vi kørte fedora og det
hele kunne ligge der!
Så er der nogle ting jeg mangler eller kan gøre for at kunne få det til
at fungere igen!

MVH
Per

 
 
Mogens Kjaer (14-06-2010)
Kommentar
Fra : Mogens Kjaer


Dato : 14-06-10 09:15

On 06/14/2010 09:55 AM, Per Jørgensen wrote:
....
> DUMP: estimated 127457617 blocks on 5.31 tape(s).
....

Præcist hvilken dump kommando bruger du til dette?

I "Gamle Dage" skulle man fortælle dump præcist hvor
mange MB der kunne være på et bånd, og så vil den
bede om næste bånd hver gang den grænse er nået.

I dag skriver dump til den møder EOT mærket på båndet,
hvis man bruger "-a" optionen som er default i Fedora.

Check "man dump" på din Debian maskine for at se
hvad der gælder dér.

Mogens

--
Mogens Kjaer, Carlsberg A/S, Computer Department
Gamle Carlsberg Vej 10, DK-2500 Valby, Denmark
Phone: +45 33 27 53 25, Mobile: +45 22 12 53 25
Email: mk@crc.dk Homepage: http://www.crc.dk

Per Jørgensen (14-06-2010)
Kommentar
Fra : Per Jørgensen


Dato : 14-06-10 09:40

On 14-06-2010 10:15, Mogens Kjaer wrote:
> On 06/14/2010 09:55 AM, Per Jørgensen wrote:
> ...
>> DUMP: estimated 127457617 blocks on 5.31 tape(s).
> ...
>
> Præcist hvilken dump kommando bruger du til dette?
>
> I "Gamle Dage" skulle man fortælle dump præcist hvor
> mange MB der kunne være på et bånd, og så vil den
> bede om næste bånd hver gang den grænse er nået.
>
> I dag skriver dump til den møder EOT mærket på båndet,
> hvis man bruger "-a" optionen som er default i Fedora.
>
> Check "man dump" på din Debian maskine for at se
> hvad der gælder dér.
>
> Mogens
>
Den kommando jeg reelt bruger er:
/sbin/dump -0 -u -f /dev/nst0 B24000000 /mera

Som ikke er ændret siden FedoraCore installationen!


Scriptet ser således ud:
#
#--------------------------------------------------------------
#
# Dump-script for (UFS-)dumping a level 0 dump of the system
#
# (c) 1988 ME Management Enterprise
#
# Date: August 1998
# Adapted for Linux v 2.2 at 03081999 /mgh
#
#--------------------------------------------------------------
#
# The following variables should be configured
#
# - The MERAUSER
# - The ABSOLUTE path to the MERA-homedir (MERAROOT)
# - The filesystems to dump, identified by their slice-number
# - The destination for logfiles AFTER the dump (LOGPATH)
# - The TAPE-device, and appropriate options
# - The file to touch if backup is OK, and it therefore should be
# safe to reorganize the database (REORGFILE)
#
# - Optionally a list of days, where backup-errors should be
# silently ignored
#
#
# The script checks for the presence of the file /dumptime
# If it exists the following operations is performed:
#
# - if /dumptime contains the word "fake", a fake backup is performed
# (NO data is written to the tape)
#
# - else the filesystems listed in the string FILESYSTEMS is dumped
# using a level 0 ufsdump
#
# If the backup proceeds without errors, the /dumperror file is moved
# to /clean-dump to trig the MERA-clean-logs and the
# REORGFILE file is created
#
# Else
#
# - if the current day is in the NOBACKUP-days,
# the /dumperror-file is removed, but the REORGFILE is NOT created
#
# - else the /dumperror file is NOT removed, and NO REORGFILE is created

# MERA-variables
MERAUSER=mera
MERAROOT=/mera

# Merao3 Variables
MERA03=172.16.50.4

# Slices for dump
# Changed from sda1 sda2 to /mera -- 20071113 by pbj
FILESYSTEMS="/mera"

# WARNING: LOGPATH is REMOVED using "rm -rf", so get it right!
LOGPATH="$MERAROOT/system/dumplogs/dump.`/bin/date +%u`"

# TAPE-config------------------
#
# Tape-device MUST be NON-rewinding

# Device
TAPE=/dev/nst0

# nb of blocks (DAT-compression ON)
BFACTOR=-B24000000
# BFACTOR=b65536

# Verify option
VERIFY=""
#VERIFY=v

#
# END of TAPE-config

# Nights, where a missing tape should not be considered as errors
NOBACKUP_DAYS="sun mon"

# File to create if the backup went OK
# ...it is deleted if it exists, and backup is NOT OK
REORGFILE="$MERAROOT"/system/.reorg-ok

# Ufsdump-binary
UFSDUMP=/sbin/dump

# mt-binary
MT=/bin/mt

# Logfiles
LOGFILE=/var/dumplog/daglig.log
LABELFILE=/var/dumplog/backup.lab
DLOGFILE=/var/dumplog/dlog
DERRFILE=/var/dumplog/dlogerr
DFLOG=/var/dumplog/dflog

#-------------END OF CONFIG--------------

PATH=/bin:/usr/bin:/sbin:/usr/sbin

# Reset VOL-number counter
VOL_COUNT=-1

# Reset NOBACKUP-flag
NOBACKUP=no

# Log-functions----------------------------
dumplog()
{
if [ -w "$DLOGFILE" ]
then
tee -a $DLOGFILE
else
cat
fi
}

logfile()
{
if [ -w "$LOGFILE" ]
then
cat >> $LOGFILE
fi
}

labelfile()
{
if [ -w "$LABELFILE" ]
then
cat | unix2dos >> $LABELFILE
fi
}

dflog()
{
if [ -w "$DFLOG" ]
then
cat >> $DFLOG
fi
}

# END of Log-functions----------------------------

clear_reorgflag()
{
# Remove reorgfile
if [ -f "$REORGFILE" ]
then
rm -f $REORGFILE
fi
}

dump_fs()
{
# Perform the actual dump
# Parameter 1: FS

if [ -z "$1" ]
then
echo "Wrong number parameters for dump_fs()"
return 1
fi

if [ -z "$TAPE" ]
then
echo "ERROR: Please specify TAPE" | dumplog
return 1
fi

$UFSDUMP -0 -u -f $TAPE $BFACTOR $1 | dumplog > /tmp/dumpinfo
RET=$?
if [ $RET -gt 0 ]
then
if [ $RET -eq 1 ]
then
echo "Startup error in dump (dumping $1)"
fi

if [ $RET -eq 3 ]
then
echo
echo "WARNING: dump (dumping $1) aborted"
fi
return $RET
fi
}

run_dump()
{
# Parameter 1: FS (mandatory)

# FS should be specified using the full slice-name

if [ -z "$1" ]
then
echo "ERROR: No parameters for run_dump()" | dumplog
else
FILESYS=$1
fi

if [ -z $2 ]
then

## 27-02-2003 har lavet ny LABEL pga fstab indholder ikke disse
oplysninger i redhat 8
   
LABEL=`df |grep $1 |cut -c57-70`
## LABEL=`grep $1 /etc/fstab | awk '{ printf "%s", $2 }'`
if [ -z "$LABEL" ]
then
LABEL="(unknown)"
fi
fi

# Sanitychecks done. Run.
VOL_COUNT=$(($VOL_COUNT + 1))

printf "Backing up %9s, %-18s, vol:%2s" \
"$FILESYS" "$LABEL" "$VOL_COUNT" | dumplog

dump_fs $FILESYS | dumplog
if [ $? -gt 0 ]
then
VOL_COUNT=$(($VOL_COUNT - 1))
printf "%s,%s,NotOK\n" $VOL_COUNT $LABEL | labelfile
printf "%3s: %25s failed\n" $VOL_COUNT $LABEL | logfile
echo ...failed | dumplog

# Life is hard...tell the world
if [ X"$FAILURES" != X"yes" ]
then
FAILURES=yes
fi
else
# Backup OK
printf "%s,%s,%s\n" $VOL_COUNT $LABEL ${FILESYS##} | labelfile
printf "%2s: %-15s %9s\n" $VOL_COUNT $LABEL ${FILESYS##} | logfile
echo ...done | dumplog
      
fi

printf "D%s,%s,%s\n" "$VOL_COUNT" "$LABEL" \
"`df -k $FILESYS | awk '{printf "%s/%s",$3,$2}'`" | dflog
}

move_logfiles()
{
# Move and clean up files

if [ -d "${LOGPATH%/*}" ]
then
# If parentdir makes sense
if [ -d "$LOGPATH" ]
then
   rm -rf $LOGPATH
fi
else
# Parentdir doesn't make sense!
# We are in trouble
if [ -d "$MERAROOT" ]
then
# Be paranoid
echo "WARNING: $LOGPATH does not exist. Logging to /tmp/dumplogs"
else
# The stupid sysadm didn't get the path right
# We dont take chances
echo "WARNING: MERA-root NOT accessible. Logging to /tmp/dumplogs"
fi
LOGPATH=/tmp/dumplogs
rm -rf /tmp/dumplogs
fi

mkdir $LOGPATH

# Transfer DF-info
if [ -r "$DFLOG" ]
then
echo "." | labelfile
cat $DFLOG | labelfile
fi

for i in $LABELFILE $LOGFILE $DLOGFILE $DERRFILE
do
if [ -f "$i" ]
then
if [ -d "$LOGPATH" ]
then
cp $i $LOGPATH/
chown $MERAUSER $LOGPATH/${i##*/}
chmod 0644 $LOGPATH/${i##*/}
fi
fi
done

cp $LABELFILE $MERAROOT/system
chown $MERAUSER $MERAROOT/system/${LABELFILE##*/}
chmod 0644 $MERAROOT/system/${LABELFILE##*/}
}


#---------------------------
# MAIN()
#---------------------------

if [ -f /dumperror ]
then
rm /dumperror
echo '* WARNING * : Back-up went wrong, check logfiles' | logfile
echo ' Check /var/dumplog/dlog !!! ' > $DERRFILE

# Paranoid!
clear_reorgflag
#exit
fi

if [ -f /dumptime ]
then
# Time for dump

# Check for FAKE-switch
FAKE="`grep -i fake < /dumptime`"
if [ -n "$FAKE" ]
then
echo "(fake run)"
UFSDUMP=/bin/true
MT=/bin/true
# Paranoid!
clear_reorgflag
fi

mv /dumptime /dumperror
rm -f /clean-dump
else
# Not time for dump
echo "No /dumptime present---no backup made"
exit
fi

if [ -f /var/dumplog/dlogerr ]
then
rm /var/dumplog/dlogerr
fi

echo 'Back-up in progress......'

# Banner for LOGFILE
> $LOGFILE && chmod 0644 $LOGFILE
echo '*********** Merakopi ***********' | logfile
date | logfile
echo '********************************' | logfile

# Begin new LABELFILE
> $LABELFILE && chmod 0644 $LABELFILE
date +"%m-%d-%Y %H:%M:%S" | labelfile

# Begin new DLOGFILE
> $DLOGFILE && chmod 0644 $DLOGFILE

# Begin new DFLOG
> $DFLOG && chmod 0644 $DFLOG

# Make sure that the log-files are moved anyway
#
trap 'move_logfiles' EXIT

clear_reorgflag

# Rewind tape
$MT -f $TAPE rewind
if [ $? -gt 0 ]
then
FAILURES=yes
printf "0,Startup,NotOK\n" | labelfile
printf "0,No Tape,NotOK\n" | labelfile
printf "Couldn't find tape\n" | logfile
printf "Couldn't find tape\n" > $DERRFILE

if [ -n "$NOBACKUP_DAYS" ]
then
DATE=`date +%a`
if [ -n "`echo $NOBACKUP_DAYS |grep -i $DATE`" ]
then
# Today is in the NOBACKUP_DAYS
NOBACKUP=yes

# No backup---No reorg.
clear_reorgflag

# But the "backup" is OK
mv /dumperror /clean-dump
fi
fi

# Thats it!
exit
fi

# BACKUP------------------

for i in $FILESYSTEMS
do
run_dump $i
done

# END OF BACKUP-----------

# Report in $LOGFILE
echo '********************************' | logfile
date | logfile
echo '********************************' | logfile

# Report to the rest

echo "Backup procedure completed" | dumplog

if [ X"$FAILURES" == X"yes" ]
then
echo "There were errors" | dumplog
echo "Check /var/dumplog/dlog" > $DERRFILE && chmod 0644 $DERRFILE

# We want to make sure that there is NO reorganization
clear_reorgflag
else
# If we fake a backup, we do NOT want reorg
if [ -z "$FAKE" ]
then
# Backup OK---clear to reorganize
touch $REORGFILE
chown mera $REORGFILE
chmod 0644 $REORGFILE
fi
fi

# Rewind tape and eject it
$MT -f $TAPE rewoffl
if [ $? -gt 0 ]
then
echo "rewoffl failed" | dumplog
echo "rewoffl failed" >> $DERRFILE
fi

# We feel good!
mv /dumperror /clean-dump

echo "End of dump-procedure"

# ***********************************************
# *
# * E-amil af backup log til kenneth og mariann
# *
# * 28/2-2003
# *
# ***********************************************

echo "subject: Mera01 daglig backup $DATE"> /tmp/tmp
cat /var/dumplog/daglig.log >> /tmp/tmp
cat /var/dumplog/backup.lab >> /tmp/tmp
cat /var/dumplog/sync.log >> /tmp/tmp

/usr/sbin/sendmail -f mera@insatech.com
webmaster@insatech.com,merete@insatech.com < /tmp/tmp
TEXT=""
cat /tmp/tmp > $TEXT
rm -f /tmp/tmp
rm -f dumpinfo


Mogens Kjaer (14-06-2010)
Kommentar
Fra : Mogens Kjaer


Dato : 14-06-10 10:52

On 06/14/2010 10:39 AM, Per Jørgensen wrote:
> On 14-06-2010 10:15, Mogens Kjaer wrote:
>> On 06/14/2010 09:55 AM, Per Jørgensen wrote:
....
>> Check "man dump" på din Debian maskine for at se
>> hvad der gælder dér.
>>
>> Mogens
>>
> Den kommando jeg reelt bruger er:
> /sbin/dump -0 -u -f /dev/nst0 B24000000 /mera

Hvad siger "man dump" om detektion af båndstørrelse?

Mogens

--
Mogens Kjaer, Carlsberg A/S, Computer Department
Gamle Carlsberg Vej 10, DK-2500 Valby, Denmark
Phone: +45 33 27 53 25, Mobile: +45 22 12 53 25
Email: mk@crc.dk Homepage: http://www.crc.dk

Søg
Reklame
Statistik
Spørgsmål : 177558
Tips : 31968
Nyheder : 719565
Indlæg : 6408921
Brugere : 218888

Månedens bedste
Årets bedste
Sidste års bedste