Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

read issues!!

Status
Not open for further replies.
Oct 17, 2006
227
Need a bit of advice on what to do?
Bit of history behind this as although the backup log says its writing to the tape, I wanted to be able to read everything thats written to it. As in the past I needed a file which I couldn't restore as it seemed only read part of that tape!! hence

tape drive has been cleaned and a new tape has been used.


if I run

dd if=/dev/st0 of=/dev/null

dd: reading `/dev/st0': Cannot allocate memory
0+0 records in
0+0 records out

Is there a reason why this is happening??

Also if I do cpio –itcv –C32768 < /dev/st0

I get a cpio: read error: Input/output error
half way through the tape???


 
Hi,

Look at your system if it's not running out of memory or out of paging space (too much processes running or some memory leak problems!).
If possible, try the same command just after a reboot

Ali
 
already looked at that

top

10:09:27 up 69 days, 21:57, 35 users, load average: 1.27, 1.46, 1.34
241 processes: 238 sleeping, 2 running, 1 zombie, 0 stopped

its pretty quiet

df -k
/dev/cciss/c0d0p3 32890776 24442176 6777840 79% /
/dev/cciss/c0d0p1 98747 15311 78337 17% /boot
/dev/cciss/c0d1p1 630135744 325204452 272922184 55% /data
none 1541228 0 1541228 0% /dev/shm



seems plenty of space

how would check for memory leakage?

not sure what a reboot would do.
 
Googled "dd cannot allocate memory" and found a couple of hits about dd using blocksize*2 as its buffer size. Do you know the blocksize of the tape, and can you specify it on the command?

They also recommend ulimit -a to see if your account has any resource limits that you might be blowing when you run the command.

Steve

[small]"Every program can be reduced by one instruction, and every program has at least one bug. Therefore, any program can be reduced to one instruction which doesn't work." (Object::perlDesignPatterns)[/small]
 
using root to run command

its set to block size 0


mt -f /dev/st0 setblk 1024

but have set it to 512 1024 and it still does the same.
 
also ran ulimit -a

core file size (blocks, -c) unlimited
data seg size (kbytes, -d) unlimited
file size (blocks, -f) unlimited
max locked memory (kbytes, -l) 4
max memory size (kbytes, -m) unlimited
open files (-n) 1024
pipe size (512 bytes, -p) 8
stack size (kbytes, -s) 10240
cpu time (seconds, -t) unlimited
max user processes (-u) 7168
virtual memory (kbytes, -v) unlimited


surely as its dumping to a tmp driv with filesize set to unlimited it wouldn't matter?
 
Found a hit: for variable blocked tapes, dd gets ENOMEM if it tries to read a block bigger than the blocksize. Apparently this prevents the silent block truncation that used to happen in previous versions of the kernel(!). You might try leaving the mount with block 0, and dd with increasing (doubling?) values of blocksize until it works? Start at 32768, a solid, dependable power of 2...

A bit flaky, I know, but the main thing is to get the data off the tape, no?

Steve

[small]"Every program can be reduced by one instruction, and every program has at least one bug. Therefore, any program can be reduced to one instruction which doesn't work." (Object::perlDesignPatterns)[/small]
 
steve first of all nice one!!!!


dd if=/dev/st0 of=/dev/null bs=32768

dd: reading `/dev/st0': Input/output error
351800+0 records in
351800+0 records out
dd: closing input file `/dev/st0': Input/output error

two questions
1. if I increase the block size will it be quicker to read?
2. also how do you get around the Input/output error???


 
What is your original backup command? I think you have to set the tape block size to 0 on /dev/st0 to use cpio or tar.
 
find /data/live /data/boss /data/cerplog /data/hist /data/informix /data/jvedi /
data/posinp /home/cerp/scripts /home/cerp/jvscripts /data/restorebacktoslashdata
-type f -print | tee $CPIOLOG | cpio -oc -C32768 -O $DEVICE



 
The block size is set when you write the tape. They are physical blocks of data on the tape, separated by gaps. For variable sized blocks, I guess you have to set the maximum you will accept.

On some (operating) systems you may be able to increase performance by increasing the buffer size, which may allow a number of blocks to be slurped into the buffer on a single read. Don't know if this applies in this case though, you'll just have to try it and see...

Steve

[small]"Every program can be reduced by one instruction, and every program has at least one bug. Therefore, any program can be reduced to one instruction which doesn't work." (Object::perlDesignPatterns)[/small]
 
must be the tape drive Ive just done a read from an external attached to my test box


get there in the end!

Big Thanks To All.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top