Commit c6172e8a authored by Vladimir Bahyl's avatar Vladimir Bahyl
Browse files

Removing files not relevant to RAO

parent 40f33665
#!/bin/bash
# General settings
HOSTNAME=`hostname -s`
VID=LW0001
BLOCKSIZE=262144
BLOCKS=20000000000
REPEAT=3
OUTDEVICE=/dev/tape
TIMECMD=/usr/bin/time
OUTFILE=`basename $0`.results.`date +%F-%H-%M-%S`
TMPFILE1=/tmp/`basename $0`-$$-1
TMPFILE2=/tmp/`basename $0`-$$-2
# Tape access mode settings
# sdparm --page=37 --hex /dev/tape
sdparm --page=37 --set=5:0:1=0 $OUTDEVICE # Logical EOT (default)
EOT=logical
sdparm --page=37 --set=5:0:1=1 $OUTDEVICE # Physical EOT
EOT=physical
#sdparm --page=37 --set=8:7:1=0 $OUTDEVICE # NVC enabled (default)
#NVC=enabled
#sdparm --page=37 --set=8:7:1=1 $OUTDEVICE # NVC disabled
#NVC=disabled
# Make directory
TESTDIR=$HOSTNAME
mkdir -p $TESTDIR
cd $TESTDIR
export LANG=C
rm -f $TMPFILE1 $TMPFILE2
echo Count Hostname VID EOT NVC BlockSize Blocks OutputBlocks RealTime > $TMPFILE2
# Prepare the tape and show the status
mt setblk 0
mt compression 0
mt status
for i in `seq 1 $REPEAT`
do
mt rewind
COMMAND="dd if=/dev/zero of=$OUTDEVICE bs=$BLOCKSIZE count=$BLOCKS"
echo $i - $COMMAND
( $TIMECMD --format="realtime: %e" $COMMAND 2>&1 ) > $TMPFILE1
REALTIME=`grep ^realtime $TMPFILE1 | cut -f2 -d' '`
OUTBLOCKS=`grep out$ $TMPFILE1 | cut -f1 -d+`
echo $i $HOSTNAME $VID $EOT $NVC $BLOCKSIZE $BLOCKS $OUTBLOCKS $REALTIME
echo $i $HOSTNAME $VID $EOT $NVC $BLOCKSIZE $BLOCKS $OUTBLOCKS $REALTIME >> $TMPFILE2
done
cp $TMPFILE2 $OUTFILE
cat $TMPFILE2
rm -f $TMPFILE1 $TMPFILE2
#!/bin/bash
# This script is intended to fill a tape with 5 GiB simple dummy files
# Then do fsf n/rewinds to get position speeds for files
VID='L70010'
echo 'fill_simple_file_skip'
echo "Fill tape $VID with simple dummy files, skip to each of the files, version of 11 August 2013."
echo
DEVICE='/dev/tape'
unset LANG
let FILESIZE=(5*1024*1024*1024) # filesize in bytes
let BLOCKSIZE=(256*1024) # blocksize in bytes
let NRBLOCKS=($FILESIZE/$BLOCKSIZE) # number of block needed to create the file
echo 'FILL_SIMPLE_FILE_SKIP'
echo 'Input device: /dev/zero'
echo "Output device: $DEVICE"
echo 'Basic file size: ' $FILESIZE' bytes'
echo 'Blocksize used: ' $BLOCKSIZE' bytes'
echo "Number of blocks of $BLOCKSIZE bytes to write file of $FILESIZE is $NRBLOCKS"
echo
sdparm --page=37 --set=8:7:1=0 $DEVICE # FSA enabled (default)
set FSA='ON'
sdparm --page=37 --set=5:0:1=1 $DEVICE # Physical EOT
set EOT='physical'
sdparm --page=37 --hex /dev/nst0
echo "VID: $VID EOT: $EOT FSA: $FSA"
date
mt -f $DEVICE rewind
mt -f $DEVICE setblk 0
mt -f $DEVICE compression 0
mt -f $DEVICE status
echo "$0: Starting fill"
echo 'Fill tape? Y/N ...'
#read UREP
UREP='N'
echo "Reply: $UREP"
if [ $UREP = 'y' -o $UREP = 'Y' ]
then
echo 'User wants to fill this tape, start filling...'
FILECOUNT=1
DDSTATUS=0
while [ $DDSTATUS == 0 ]
do
echo "dd if=/dev/zero ibs=$BLOCKSIZE of=$DEVICE obs=$BLOCKSIZE count=$NRBLOCKS"
dd if=/dev/zero ibs=$BLOCKSIZE of=$DEVICE obs=$BLOCKSIZE count=$NRBLOCKS
DDSTATUS=$?
echo "$0: wrote file $FILECOUNT, with 'dd' status $DDSTATUS"
let FILECOUNT+=1
done
date
echo 'Ended fill after writing '$FILECOUNT' files'
else
echo 'User does not want to fill this tape, start skipping...'
fi
#exit -1
mt -f $DEVICE status
mt -f $DEVICE rewind
mt -f $DEVICE setblk 0
mt -f $DEVICE compression 0
sdparm --page=0x30,0x43 --hex /dev/tape
# Disable Archive Unload
echo "Disabling Archive Unload ..."
sdparm --page=0x30,0x43 --set=4:1:1=0 /dev/tape
# Disable BOP caching
echo "Disabling BOP caching ..."
sdparm --page=0x30,0x43 --set=4:0:1=1 /dev/tape
sdparm --page=0x30,0x43 --hex /dev/tape
echo "*"
echo "* Rewound tape, now start skip to each file"
echo "*"
for i in `seq 0 3000`
do
date
mt -f $DEVICE status | grep BOT
TIMETOSEEK=`/usr/bin/time --format=%e mt fsf $i 2>&1 | awk '{print $1}'`
BLOCKID=`/usr/sbin/tapeinfo -f /dev/tape | grep Position | cut -f2 -d':' | awk '{print $1}'`
TIMETOREWIND=`/usr/bin/time --format=%e mt rewind 2>&1 | awk '{print $1}'`
echo "### File: $i Block: $BLOCKID Seek time: $TIMETOSEEK Rewind time: $TIMETOREWIND"
done
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
file 1 block 20481
file 463 block 9482703
file 1009 block 20665329
file 1652 block 33834612
file 1394 block 28550514
file 997 block 20419557
file 456 block 9339336
file 59 block 1208379
Count Hostname VID EOT NVC BlockSize Blocks OutputBlocks RealTime
1 tpsrv114 LW0001 physical 262144 20000000000 34409785 30203.15
2 tpsrv114 LW0001 physical 262144 20000000000 34409785 30034.71
3 tpsrv114 LW0001 physical 262144 20000000000 34409785 30029.08
Count Hostname VID EOT NVC BlockSize Blocks OutputBlocks RealTime
1 tpsrv233 LW0002 logical 262144 20000000000 34409822 30094.78
2 tpsrv233 LW0002 logical 262144 20000000000 34409823 30086.52
3 tpsrv233 LW0002 logical 262144 20000000000 34409822 30092.04
This diff is collapsed.
#!/bin/bash
# General settings
HOSTNAME=`hostname -s`
VID=L80001
BLOCKSIZE=262144
BLOCKS=20000000000
REPEAT=3
OUTDEVICE=/dev/tape
TIMECMD=/usr/bin/time
OUTFILE=`basename $0`.results.`date +%F-%H-%M-%S`
TMPFILE1=/tmp/`basename $0`-$$-1
TMPFILE2=/tmp/`basename $0`-$$-2
# Tape access mode settings
# sdparm --page=37 --hex /dev/tape
sdparm --page=37 --set=5:0:1=0 $OUTDEVICE # Logical EOT (default)
EOT=logical
#sdparm --page=37 --set=5:0:1=1 $OUTDEVICE # Physical EOT
#EOT=physical
#sdparm --page=37 --set=8:7:1=0 $OUTDEVICE # NVC enabled (default)
#NVC=enabled
#sdparm --page=37 --set=8:7:1=1 $OUTDEVICE # NVC disabled
#NVC=disabled
# Make directory
TESTDIR=$HOSTNAME
mkdir -p $TESTDIR
cd $TESTDIR
export LANG=C
rm -f $TMPFILE1 $TMPFILE2
echo Count Hostname VID EOT NVC BlockSize Blocks OutputBlocks RealTime > $TMPFILE2
# Prepare the tape and show the status
mt setblk 0
mt compression 0
mt status
for i in `seq 1 $REPEAT`
do
mt rewind
COMMAND="dd if=/dev/zero of=$OUTDEVICE bs=$BLOCKSIZE count=$BLOCKS"
echo $i - $COMMAND
( $TIMECMD --format="realtime: %e" $COMMAND 2>&1 ) > $TMPFILE1
REALTIME=`grep ^realtime $TMPFILE1 | cut -f2 -d' '`
OUTBLOCKS=`grep out$ $TMPFILE1 | cut -f1 -d+`
echo $i $HOSTNAME $VID $EOT $NVC $BLOCKSIZE $BLOCKS $OUTBLOCKS $REALTIME
echo $i $HOSTNAME $VID $EOT $NVC $BLOCKSIZE $BLOCKS $OUTBLOCKS $REALTIME >> $TMPFILE2
done
cp $TMPFILE2 $OUTFILE
cat $TMPFILE2
rm -f $TMPFILE1 $TMPFILE2
#!/bin/bash
# This script is intended to fill a tape with 5 GiB simple dummy files
# Then do fsf n/rewinds to get position speeds for files
VID='L80011'
echo 'fill_simple_file_skip'
echo "Fill tape $VID with simple dummy files, skip to each of the files, version of 11 August 2013."
echo
DEVICE='/dev/tape'
unset LANG
let FILESIZE=(5*1024*1024*1024) # filesize in bytes
let BLOCKSIZE=(256*1024) # blocksize in bytes
let NRBLOCKS=($FILESIZE/$BLOCKSIZE) # number of block needed to create the file
echo 'FILL_SIMPLE_FILE_SKIP'
echo 'Input device: /dev/zero'
echo "Output device: $DEVICE"
echo 'Basic file size: ' $FILESIZE' bytes'
echo 'Blocksize used: ' $BLOCKSIZE' bytes'
echo "Number of blocks of $BLOCKSIZE bytes to write file of $FILESIZE is $NRBLOCKS"
echo
sdparm --page=37 --set=8:7:1=0 $DEVICE # FSA enabled (default)
set FSA='ON'
sdparm --page=37 --set=5:0:1=1 $DEVICE # Physical EOT
set EOT='physical'
sdparm --page=37 --hex /dev/nst0
echo "VID: $VID EOT: $EOT FSA: $FSA"
date
mt -f $DEVICE rewind
mt -f $DEVICE setblk 0
mt -f $DEVICE compression 0
mt -f $DEVICE status
echo "$0: Starting fill"
echo 'Fill tape? Y/N ...'
#read UREP
UREP='N'
echo "Reply: $UREP"
if [ $UREP = 'y' -o $UREP = 'Y' ]
then
echo 'User wants to fill this tape, start filling...'
FILECOUNT=1
DDSTATUS=0
while [ $DDSTATUS == 0 ]
do
echo "dd if=/dev/zero ibs=$BLOCKSIZE of=$DEVICE obs=$BLOCKSIZE count=$NRBLOCKS"
dd if=/dev/zero ibs=$BLOCKSIZE of=$DEVICE obs=$BLOCKSIZE count=$NRBLOCKS
DDSTATUS=$?
echo "$0: wrote file $FILECOUNT, with 'dd' status $DDSTATUS"
let FILECOUNT+=1
done
date
echo 'Ended fill after writing '$FILECOUNT' files'
else
echo 'User does not want to fill this tape, start skipping...'
fi
#exit -1
mt -f $DEVICE status
mt -f $DEVICE rewind
mt -f $DEVICE setblk 0
mt -f $DEVICE compression 0
sdparm --page=0x30,0x43 --hex /dev/tape
# Disable Archive Unload
echo "Disabling Archive Unload ..."
sdparm --page=0x30,0x43 --set=4:1:1=0 /dev/tape
# Disable BOP caching
echo "Disabling BOP caching ..."
sdparm --page=0x30,0x43 --set=4:0:1=1 /dev/tape
sdparm --page=0x30,0x43 --hex /dev/tape
echo "*"
echo "* Rewound tape, now start skip to each file"
echo "*"
for i in `seq 0 3000`
do
date
mt -f $DEVICE status | grep BOT
TIMETOSEEK=`/usr/bin/time --format=%e mt fsf $i 2>&1 | awk '{print $1}'`
BLOCKID=`/usr/sbin/tapeinfo -f /dev/tape | grep Position | cut -f2 -d':' | awk '{print $1}'`
TIMETOREWIND=`/usr/bin/time --format=%e mt rewind 2>&1 | awk '{print $1}'`
echo "### File: $i Block: $BLOCKID Seek time: $TIMETOSEEK Rewind time: $TIMETOREWIND"
done
This diff is collapsed.
This diff is collapsed.
Count Hostname VID EOT NVC BlockSize Blocks OutputBlocks RealTime
1 tpsrv114 L80000 physical 262144 20000000000 45853544 34048.55
2 tpsrv114 L80000 physical 262144 20000000000 45853567 33720.33
3 tpsrv114 L80000 physical 262144 20000000000 45853529 33899.79
Count Hostname VID EOT NVC BlockSize Blocks OutputBlocks RealTime
1 tpsrv233 L80001 logical 262144 20000000000 45853529 33834.50
2 tpsrv233 L80001 logical 262144 20000000000 45853548 33836.88
3 tpsrv233 L80001 logical 262144 20000000000 45853551 33783.90
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment