tape format

jcabrera

ADSM.ORG Member
Joined
Jan 23, 2007
Messages
68
Reaction score
0
Points
0
Location
Philippines/currently in Japan
Hi how would i be able to format a tape using TSM command line?

These are the steps i made:
LABEL
- LABEL LIBVOLUME tape_library_name tape_name overwrite=yes


CHECKIN
- CHECKIN LIBVOLUME tape_library_name SEARCH=yes STATUS=scratch CHECKLABEL=yes


DEFINE
- DEFINE VOLUME tape_storagepool_name tape_name
 
One command should do it:

label libvol <library_name> search=b labels=b checkin=scr

search=b is for bulk input at the I/O station
labels=b means bar code is the source for tape label

If you don't use bar codes (??) use labels=prompt so TSM prompts you for a tape label.
 
would it automatically delete the contents of the tape?

here are the commands and outputs:

Command:
label libvolume 3590lib03 tsm202 overwrite=yes

output:
ANR8816E LABEL LIBVOLUME: Volume TSM202 in library 3590LIB03 cannot be labelled because it is currently defined in a storage pool or in the volume history file.


Command:
checkin libvolume 3590lib03 search=yes status=scratch checklabel=yes

output:
ANRW0200I The command started as process 345. Use the Server Processes tab in the server's properties notebook to monitor the process.
 
I think I misunderstood your question. I was thinking that you wanted to check in NEW tapes. It seems that you are trying to re-use old tapes and assign a scratch status to it, right?

Just to clarify:

You don't need the data on the tapes anymore, right? If so, the tapes must not be defined in any storage pool in order to use the label command I wrote above.

If the tapes are still defined in TSM, you have to delete it through: delete volume <volume_name> discarddata=yes ("help delete volume" for more info). Issue a label command afterwards.
 
But really using delete volume discarddata=yes should only be used in unusual circumstances, it shouldn't be a regular way of emptying out tapes. You should be using reclamation and expiration to free up tapes. Even if a tape is old, it may still have active files on it due to TSM's progressive (incremental forever) backups. Using del vol discardd=yes can remove the only backup copy of some of your clients.
 
yes for the purpose of testing i am deleting the data stored in the tape.if my current tape name is TAPE1 and i wanted to change it to TAPE2 what would be the command should i use?

also i am not using a tape library, i am currently using a 4mm tapedrive and it is on manual mode. can manual be able to do the scenario that i wanted to do?


here is the command:
tsm: TSM_MACHINE>label libvol 4mmlib1 tape1 overwrite=yes
ANS8003I Process number 37 started.

but on the monitoring events it says that:
Process 37 for LABEL LIBVOLUME running in the BACKGROUND completed with completion state FAILURE at 09:49:40.
 
Last edited:
What appears in the activity log immediately before the error?

q act begint=09:30
 
tsm: TSM_MACHINE>q act begint=09:30

Date/Time Message
-------------------- ----------------------------------------------------------
04/23/2007 09:30:21 ANR0406I Session 557 started for node CLIENTNODE (WinNT)
(Tcp/Ip jeff.ebiz.lst.com.ph(2006)). (SESSION: 557)
04/23/2007 09:30:30 ANR8326I 013: Mount 4MM volume OPOY6 R/W in drive
MT4.0.0.4 (mt4.0.0.4) of library 4MMLIB1 within 60
minutes. (SESSION: 556)
04/23/2007 09:30:30 ANR8335I 013: Verifying label of 4MM volume OPOY6 in drive
MT4.0.0.4 (mt4.0.0.4). (SESSION: 556)
04/23/2007 09:30:38 ANR8354E 013: Incorrect volume (OPOY1) mounted in drive
MT4.0.0.4 (mt4.0.0.4). (SESSION: 556)
04/23/2007 09:30:38 ANR8326I 013: Mount 4MM volume OPOY6 R/W in drive
MT4.0.0.4 (mt4.0.0.4) of library 4MMLIB1 within 60
minutes. (SESSION: 556)
04/23/2007 09:30:49 ANR0407I Session 558 started for administrator ADMIN
(WinNT) (Tcp/Ip tsmserver.ebiz.lst.com.ph(1336)).
(SESSION: 558)
04/23/2007 09:30:49 ANR2017I Administrator ADMIN issued command: select
option_value as LANG from options where
UPPER(option_value) in ('CHS','ZH_CN','CHT','ZH_TW','DEU-
','DE_DE','AMENG','EN_US','ENG','ESP','ES_ES','FRA','FR_-
FR','ITA','IT_IT','JPN','JA_JP','KOR','KO_KR','PTB','PT_-
BR') (SESSION: 558)
04/23/2007 09:30:49 ANR0405I Session 558 ended for administrator ADMIN
(WinNT). (SESSION: 558)
04/23/2007 09:30:49 ANR0407I Session 559 started for administrator ADMIN
(WinNT) (Tcp/Ip tsmserver.ebiz.lst.com.ph(1337)).
(SESSION: 559)
04/23/2007 09:30:49 ANR2017I Administrator ADMIN issued command: select
count(*) as CSM from events where LENGTH(domain_name) IS
NOT NULL and scheduled_start between '2007-04-23
08:30:47' and '2007-04-23 09:30:46' and status='Missed'
(SESSION: 559)
04/23/2007 09:30:50 ANR2017I Administrator ADMIN issued command: select
pct_utilized from db (SESSION: 559)
04/23/2007 09:30:50 ANR2017I Administrator ADMIN issued command: select
max_pct_utilized from log (SESSION: 559)
04/23/2007 09:30:50 ANR2017I Administrator ADMIN issued command: select
(sum(est_capacity_mb * pct_utilized ) /
NULLIF(sum(est_capacity_mb),0) ) as DPU from volumes
where devclass_name='DISK' (SESSION: 559)
04/23/2007 09:30:50 ANR2017I Administrator ADMIN issued command: select
count(*) as NDO from drives where online='NO' (SESSION:
559)
04/23/2007 09:30:50 ANR2017I Administrator ADMIN issued command: select
count(*) as SV from libvolumes where status='Scratch'
(SESSION: 559)
04/23/2007 09:30:50 ANR0405I Session 559 ended for administrator ADMIN
(WinNT). (SESSION: 559)
04/23/2007 09:31:38 ANR8326I 013: Mount 4MM volume OPOY6 R/W in drive
MT4.0.0.4 (mt4.0.0.4) of library 4MMLIB1 within 59
minutes.
04/23/2007 09:32:34 ANR8335I 013: Verifying label of 4MM volume OPOY6 in drive
MT4.0.0.4 (mt4.0.0.4). (SESSION: 556)
04/23/2007 09:32:38 ANR8328I 013: 4MM volume OPOY6 mounted in drive MT4.0.0.4
(mt4.0.0.4). (SESSION: 556)
04/23/2007 09:32:38 ANR0511I Session 556 opened output volume OPOY6. (SESSION:

04/23/2007 09:32:43 ANE4952I (Session: 556, Node: CLIENTNODE) Total number of
objects inspected: 2 (SESSION: 556)
04/23/2007 09:32:43 ANE4954I (Session: 556, Node: CLIENTNODE) Total number of
objects backed up: 2 (SESSION: 556)
04/23/2007 09:32:43 ANE4958I (Session: 556, Node: CLIENTNODE) Total number of
objects updated: 0 (SESSION: 556)
04/23/2007 09:32:43 ANE4960I (Session: 556, Node: CLIENTNODE) Total number of
objects rebound: 0 (SESSION: 556)
04/23/2007 09:32:43 ANE4957I (Session: 556, Node: CLIENTNODE) Total number of
objects deleted: 0 (SESSION: 556)
04/23/2007 09:32:43 ANE4970I (Session: 556, Node: CLIENTNODE) Total number of
objects expired: 0 (SESSION: 556)
04/23/2007 09:32:43 ANE4959I (Session: 556, Node: CLIENTNODE) Total number of
objects failed: 0 (SESSION: 556)
04/23/2007 09:32:43 ANE4961I (Session: 556, Node: CLIENTNODE) Total number of
bytes transferred: 40.75 KB (SESSION: 556)
04/23/2007 09:32:43 ANE4963I (Session: 556, Node: CLIENTNODE) Data transfer
time: 0.00 sec (SESSION: 556)
04/23/2007 09:32:43 ANE4966I (Session: 556, Node: CLIENTNODE) Network data
transfer rate: 0.00 KB/sec (SESSION: 556)
04/23/2007 09:32:43 ANE4967I (Session: 556, Node: CLIENTNODE) Aggregate data
transfer rate: 0.27 KB/sec (SESSION: 556)
04/23/2007 09:32:43 ANE4968I (Session: 556, Node: CLIENTNODE) Objects
compressed by: 0% (SESSION: 556)
04/23/2007 09:32:43 ANE4964I (Session: 556, Node: CLIENTNODE) Elapsed
processing time: 00:02:30 (SESSION: 556)
04/23/2007 09:32:51 ANR0403I Session 557 ended for node CLIENTNODE (WinNT).
(SESSION: 557)
04/23/2007 09:32:53 ANR0407I Session 560 started for administrator ADMIN
(WinNT) (Tcp/Ip jeff.ebiz.lst.com.ph(2033)). (SESSION:
560)
04/23/2007 09:33:43 ANR2017I Administrator ADMIN issued command: QUERY VOLUME
(SESSION: 560)
04/23/2007 09:34:10 ANR2017I Administrator ADMIN issued command: QUERY
VOLHISTORY (SESSION: 560)
04/23/2007 09:35:17 ANR2017I Administrator ADMIN issued command: LABEL
libvolume 4mmlib1 tape1 overwrite=yes (SESSION: 560)
04/23/2007 09:35:17 ANR8816E LABEL LIBVOLUME: Volume TAPE1 in library 4MMLIB1
cannot be labelled because it is currently defined in a
storage pool or in the volume history file. (SESSION:
560)
04/23/2007 09:35:17 ANR2017I Administrator ADMIN issued command: ROLLBACK
(SESSION: 560)
 
There is your error:

04/23/2007 09:35:17 ANR8816E LABEL LIBVOLUME: Volume TAPE1 in library 4MMLIB1 cannot be labelled because it is currently defined in a
storage pool or in the volume history file. (SESSION:
560)

If TAPE1 does not appear in "q vol" (as by following moon-buddy's post you should have deleted it), it will still be in your volhistory:

select * from volhistory where volume_name='TAPE1'


You need to delete it from your volhist. See "help del volh". I'd recommend limiting the "type" parameter to stgnew, stgdel, and stgreuse so you don't delete exports/backupsets etc.
 
here is the volume history:
TSMSERVER Date/Time: 04/16/2007 16:53:36
TSMSERVER Volume Type: BACKUPFULL
TSMSERVER Backup Series: 2
TSMSERVER Backup Operation: 0
TSMSERVER Volume Seq: 1
TSMSERVER Device Class: 4MMCLASS1
TSMSERVER Volume Name: OPOY2
TSMSERVER Volume Location:
TSMSERVER Command:

im having an error of this command:
delete volumehistory t=backupfull todate=04/16/2007 totime=16:53:36

output:
ANR2469E DELETE VOLHISTORY: Invalid volume history type: BACKUPFULL.
ANS8001I Return code 3.


note:
opoy2 volume is already deleted by using del volume opoy2.
tsm: TSM_MACHINE>select * from volhistory where volume_name='opoy2'
ANR2034E SELECT: No match found using this criteria.
ANS8001I Return code 11.
 
Last edited:
well, it seems to be your only dbbackup, and tsm won't let you delete it.

You need to run a new db backup, then the command may run successfully.
Should you run out of tapes, you can create a file pool, backup db in there, and then do a "del volh ...".

hope it helps
max
 
Check in the help for del volhist.. ie "help del volh"

The correct command is

del volhist type=dbbackup ... etcAlso I noticed you wrote:
tsm: TSM_MACHINE>select * from volhistory where volume_name='opoy2'

Select queries are case sensistive, your volume name must be in ALL-CAPS, ie ... where volume_name='OPOY2'

ps. As May pointed out, if its your one and only and latest dbbackup you won't be able to delete it, unless the undocumented force=yes option is used. If you run this command, I hope this is on a test server...
 
Last edited:
i ran the command:
tsm: TSM_MACHINE>del volhistory type=dbbackup todate=04/16/2007 totime=16:53:36

Do you wish to proceed? (Yes (Y)/No (N)) y
ANR2467I DELETE VOLHISTORY: 0 sequential volume history entries were
successfully deleted.

how do i force delete?
what commands and parameters should i ran. thanks.
 
That would be the force=yes parameter like I said above - just add it to your del volhistory command.

I hope this is a test server...
 
yea this is a test server...hehee...it successfully deleted the volume history. and it sucessfully re-labelled the tape.hehee...thanks

do you happned to have an instant messenger where i could throw a quick question?
 
There is no such thing as TSM "formatting" tapes. There is no need to do it. When you overwrite the label on a tape, this overwrites the label at the beginning of the media and writes a logical end of tape mark after it to say there's no more data on the tape yet. There is no need for TSM to overwrite the entire tape.

If you need to "format" a tape to destroy sensitive data that's a different issue.
 
Back
Top