LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (http://www.linuxquestions.org/questions/linux-general-1/)
-   -   How to check Tape size ( Percentage free and utilize space) (http://www.linuxquestions.org/questions/linux-general-1/how-to-check-tape-size-percentage-free-and-utilize-space-4175456650/)

sanjayraghuwanshi 04-03-2013 03:02 AM

How to check Tape size ( Percentage free and utilize space)
 
Hi,

Any can please help me to provide detail how can I check tape size.

Total space.

Percentage free and Utilize space.

Thanks..

cliffordw 04-03-2013 03:38 AM

Hi there,

What tape drive are you referring to?

For the tape size, I think you can deduce this by running "mt status" and looking at the density code. Some of the values you can expect to see are documented at http://adsm.org/lists/html/Amanda-Us.../msg00145.html.

Regarding the percentage free and used space, I this will depend a little on what backup software you are using, and in particular how many (tape) "files" you are writing to the tape (think non-rewind devices - typically /dev/nst0 I think). You would be able to determine how much space is utilized by running something like "dd if=/dev/st0 of=/dev/null" and looking at the output to see how many (512-byte) blocks were read from the tape. This will take some time, though, as it physically reads everything on the tape. For multi-file tapes you will need to repeat this for each file.

Once you have the tape size & space utilized, you can calculate the percentage free & used.

Godo luck!

sanjayraghuwanshi 04-03-2013 05:05 AM

Quote:

Originally Posted by cliffordw (Post 4924131)
Hi there,

What tape drive are you referring to?

For the tape size, I think you can deduce this by running "mt status" and looking at the density code. Some of the values you can expect to see are documented at http://adsm.org/lists/html/Amanda-Us.../msg00145.html.

Regarding the percentage free and used space, I this will depend a little on what backup software you are using, and in particular how many (tape) "files" you are writing to the tape (think non-rewind devices - typically /dev/nst0 I think). You would be able to determine how much space is utilized by running something like "dd if=/dev/st0 of=/dev/null" and looking at the output to see how many (512-byte) blocks were read from the tape. This will take some time, though, as it physically reads everything on the tape. For multi-file tapes you will need to repeat this for each file.

Once you have the tape size & space utilized, you can calculate the percentage free & used.

Godo luck!

Thanks..

soemsrv1:~ # mt -f /dev/st0 status
drive type = Generic SCSI-2 tape
drive status = 1107296256
sense key error = 0
residue count = 0
file number = 0
block number = 0
Tape block size 0 bytes. Density code 0x42 (LTO-2).
Soft error count since last status=0
General status bits on (41010000):
BOT ONLINE IM_REP_EN

In this out put Density code is 0X42 but i have not found value for this code please suggest.

I have run dd , plesae see out put of command below,

soemsrv1:~ # dd if=/dev/st0 of=/dev/null
dd: reading `/dev/st0': Cannot allocate memory
0+0 records in
0+0 records out
0 bytes (0 B) copied, 7.95949 seconds, 0.0 kB/s

Kindly suggest.

sundialsvcs 04-03-2013 08:18 AM

I think you'd need to have a little camera mounted so that it could watch the spinning reels to see how much tape they contain. ;)

cliffordw 04-03-2013 11:22 AM

Quote:

Originally Posted by sanjayraghuwanshi (Post 4924174)
Thanks..

soemsrv1:~ # mt -f /dev/st0 status
drive type = Generic SCSI-2 tape
drive status = 1107296256
sense key error = 0
residue count = 0
file number = 0
block number = 0
Tape block size 0 bytes. Density code 0x42 (LTO-2).
Soft error count since last status=0
General status bits on (41010000):
BOT ONLINE IM_REP_EN

In this out put Density code is 0X42 but i have not found value for this code please suggest.

I have run dd , plesae see out put of command below,

soemsrv1:~ # dd if=/dev/st0 of=/dev/null
dd: reading `/dev/st0': Cannot allocate memory
0+0 records in
0+0 records out
0 bytes (0 B) copied, 7.95949 seconds, 0.0 kB/s

Kindly suggest.

Regarding the capacity of the LTO-2 tape, according to http://en.wikipedia.org/wiki/Linear_Tape-Open it is 200 GB.

Regarding the dd error, I think this has to do with the block size. How did you write your backup to the tape (command)? It might help to specify a block size, as in: "dd if=/dev/st0 of=/dev/null bs=32768".

sanjayraghuwanshi 04-03-2013 11:49 PM

Quote:

Originally Posted by cliffordw (Post 4924387)
Regarding the capacity of the LTO-2 tape, according to http://en.wikipedia.org/wiki/Linear_Tape-Open it is 200 GB.

Regarding the dd error, I think this has to do with the block size. How did you write your backup to the tape (command)? It might help to specify a block size, as in: "dd if=/dev/st0 of=/dev/null bs=32768".

Thanks cliffordw,

This info is really helpful for me.

I write backup to the tape via command:- tar -rvf /dev/st0 /path/to/backup

rnturn 04-04-2013 10:49 AM

Quote:

Originally Posted by sanjayraghuwanshi (Post 4924108)
Any can please help me to provide detail how can I check tape size.

Total space.

Percentage free and Utilize space.

This is really quite difficult to quantify. Especially if your tape drive does hardware-based compression. The manufacturer often states that a tape cartridge will have a capacity of "X" or "2X" with compression. But that compression ratio is hugely dependent on the data that's being sent to tape and the factor of "2" that is often quoted is very conservative. I've often gotten far greater compression ratios, particularly if the disk data is fairly redundant. for example, I found Oracle database files to compress really, really well and was able to get more on tape than I would have thought possible when I added up the file sizes. Directories full of binaries or images? Not so well. Use the biggest buffer size you can get away with. Note: The st driver used to have a limit on the buffer size you could specify. I seem to recall using 65536 (128*512) and getting a decent throughput and capacity.

One tip: don't run the tar output through a compression utility if you are enabling hardware compression. It seems to slow down the tape drive's ability to put data on tape fast enough. Apparently, the hardware-based compression slows the data transfer immensely as it tries to further compress previously compressed data. The tape drive falls out of streaming mode and has to reseek the EOT before it can write again. Performance plummets big time.

HTH...

--
Rick


All times are GMT -5. The time now is 08:45 PM.