• Please help support our sponsors by considering their products and services.
    Our sponsors enable us to serve you with this high-speed Internet connection and fast webservers you are currently using at ADSM.ORG.
    They support this free flow of information and knowledge exchange service at no cost to you.

    Please welcome our latest sponsor Tectrade . We can show our appreciation by learning more about Tectrade Solutions
  • Community Tip: Please Give Thanks to Those Sharing Their Knowledge.

    If you receive helpful answer on this forum, please show thanks to the poster by clicking "LIKE" link for the answer that you found helpful.


    Click the link above to access ADSM.ORG Acceptable Use Policy and forum rules which should be observed when using this website. Violators may be banned from this website. This notice will disappear after you have made at least 3 posts.

script to run using dsmadmc command


hi all,

we just moved TSM 6.3 from AIX to Linux environment. Now we have to do some cleaning to our new environment. we don't want to run each command over and over to do things so we are wondering if there are scripts guru out there who can help to accomplish the ff:

1. we want to delete all the volumes that was created in AIX as it is offline status now in Linux and it is empty as we migrate all the disk data to tape before migration to Linux. we will redefine the volume location and sizes as well. so in tsm command line we will do it as: "delete volume volumename discard=yes". we want to put it into script because we have a ton a volumes and we want to avoid issuing the command x number of times just to delete everything. i have an idea on how to do it but i dont know how to put it together as i'm not into scripting:
it will be like;
dsmadmc -id=admin -password=password for i= 1 to 50 delete volume /diskforwin/stg(i) discard=yes wait=no end for

2. update the path of all the drives from /dev/rmtx to /dev/stx
3. define all new volumes

any help will be appreciated

thanks in advance


ADSM.ORG Moderator
For (1) above:

Running the script in Linux (I believe this is where the volumes needing to be deleted are):


for i in `cat vol_list.txt`
dsmadmc -id=<admin_ID> -pa=<Admin_PW> -dataonly=yes -noc "delete volume $i discard=yes"

Execute this as root or the instance owner in the Linux server.

For (2)

1. Generate a list which contains the drive name and the new path associated with it. Save it to a file, say, path.txt

should look something like:

drive01 /dev/stx1
drive02 /dev/stx2

2. As root or the instance owner:


{ while read line; do
dsmadmc -id=<admin_ID> -pa=<Admin_PW> -dataonly=yes -noc "update path <TSM_server_name> `cat $line|awk '{print $1}'` srctype=server desttype=drive device=`cat $line|awk '{print $2}'` library=<library_name> online=yes"
done } < path.txt

For (3):

What volumes? Tape? Disk?


I have not tested this script - experiment with a small sample before you do a full blown 'execute'.


Thanks Ed

It's a disk

For item 3, i think we can use the define volume command using the "numberofvolumes" parameter.

Yes we will try it with a small number first before full blown

Thanks again,

Advertise at ADSM.ORG

If you are reading this, so are your potential customer. Advertise at ADSM.ORG right now.

UpCloud high performance VPS at $5/month

Get started with $25 in credits on Cloud Servers. You must use link below to receive the credit. Use the promo to get upto 5 month of FREE Linux VPS.

The Spectrum Protect TLA (Three-Letter Acronym): ISP or something else?

  • Every product needs a TLA, Let's call it ISP (IBM Spectrum Protect).

    Votes: 18 18.6%
  • Keep using TSM for Spectrum Protect.

    Votes: 59 60.8%
  • Let's be formal and just say Spectrum Protect

    Votes: 12 12.4%
  • Other (please comement)

    Votes: 8 8.2%

Forum statistics

Latest member