Within TSM (or nowadays known as IBM Spectrum Protect), filespaces may exist that are no longer backed up. These are file systems that were once backed up, but are no longer backed anymore.
This may occur if someone deletes a file system from a client, and thus it is no longer backed up. Or a file system was added to the exclude list, so it's no longer included in any backup runs.
These old filespaces may use up quite some storage, and because they're never being backed up anymore, their data remains on the TSM server for restore purposes.
It's good practice to review these filespaces and to determine if they can be deleted from TSM to free up storage space. And thus it's a good idea to put this in a script, and have that script run from time to time automatically, for example by scheduling it in the crontab on a weekly or monthly basis.
Here's a sample script. You can run it on your AIX TSM server. It assumes you have a "readonly" user account configured within TSM, with a password of "readonly". It will send out an email if any obsolete filespace are present. You have to update the email variable at the beginning of the script to whatever email address you want to send an email.
#!/bin/ksh
email="my@emailaddress.com"
y=$(perl -MPOSIX -le 'print strftime "%D",localtime(time-(60*60*24))')
mytempfile=/tmp/myadmintempfile.$$
rm -f ${mytempfile}
dsmadmc -comma -id=readonly -password=readonly q filespace \* \* f=d | \
grep -v $(date +"%m/%d/%y") | grep -v "${y}" | grep ",," > ${mytempfile}
if [ -s ${mytempfile} ] ; then
cat ${mytempfile} | mailx -s "Filespaces not backed up during last 24 \
hours." ${email} >/dev/null 2>&1
fi
rm -f ${mytempfile}
exit 0
The script will send an email with a list of any filespaces not backed in the last 24 hours, if any are found.
The next thing you'll have to do is to investigate why the file system is not backed up. If you've determined that the filespace is no longer required in TSM, then you can move forward by deleting the filespace from TSM.
For example, for a UNIX file system:
delete filespace hostname /file/systemFor file systems of Windows clients, deleting a filespace may be a bit more challenging. TSM might not allow you to remove a filespace and exit with an error message like "No matching file space found".
You might attempt to delete the filespace like this:
delete filespace nodename \\nodename\d$ nametype=uniOr, you can remove Windows filespaces in TSM by filespace number. In that case, first list the known filespaces in TSM of a specific nodename, for example:
q filespace nodename *This will list all the filespaces known in TSM for host "nodename". Replace nodename with whatever client you're searching for. In the output you'll see the hostanme, the filespace name, and a filespace number, for example, 1.
To delete filespace with filespace number "1" for host "nodename", you can run:
delete filespace nodename 1 nametype=fsid
Topics: Backup & restore, Spectrum Protect↑
Spectrum Protect / TSM: Display deduplicaton bytes pending removal
There are numerous show commands available for IBM Spectrum Protect / TSM, that will display information about the environment. Many of them aren't as well documented, probably because IBM intends to use these commands for their own support.
Quite a lot of these commands have been documented by Spectrum Protec / TSM users, and an example can be found on the following web site: http://www.mm-it.at/de/TSM_Show_Commands.html.
A very interesting show command, that can be used to display the amount of deduplicate bytes pending removal, is the following command:
tsm: TSM>show deduppending file_diskThe command above shows the number of byes for storage pool "FILE_DISK" still to be removed by the dedupe processes.
ANR1015I Storage pool FILE_DISK has 7,733,543,532,121 duplicate bytes pending removal.
The command may take quite some time to run, up to 10 minutes, so please be patient when issuing this command.
An easy command to check on the Spectrum Protect / TSM server what the backup status of all the Spectrum Protect / TSM clients is using the "q event" command. For example:
q event * * begind=-1 begint=09:00 endd=today endt=09:00The command above will display the status of all the backups jobs in the last 24 hours between 9 AM yesterday and 9 AM today.
Topics: Backup & restore, Spectrum Protect↑
Show configuration of a TSM / IBM Spectrum Protect server
To save the complete configuration of a TSM server to a file, run:
dsmadmc -id=admin -password=admin show config > /tmp/configThis assumes that you have an admin account with the password admin. And it will write the output file to /tmp/config.
If you wish to have comma separated output, add -comma.
To just display the status of the TSM / IBM Spectrum Protect server, run (this is included in the output of show config):
q statusAnother very interesting command to run is:
q system
Topics: Backup & restore, Spectrum Protect↑
Start a backup from the TSM / IBM Spectrum Protect server
There is a way to start a backup from the TSM / IBM Spectrum Protect server itself, and that is by defining a client action. For example, to start an incremental backup on a node, run:
define clientactionYou can use wild cards like * in the node name, for example:action=incremental
def clienta node* act=iYou can monitor the schedule event, using the following command:
q ev * @1You may cancel this schedule, by running:
delete schedule [policy domain] @1
The following command can be used to tail the TSM / IBM Spectrum Protect console log:
dsmadmc -consoleThis will allow you to continously follow what is happening on the TSM / IBM Spectrum Protect server.
To register a new TSM / IBM Spectrum Protect administrator, run:
register admin adminname password contact="Contact details of the new admin" emailaddress=email-address@ofthenewadmin.comNext, grant system privilege authority to the new admin:
grant authority adminname class=sysTo remove a TSM admin, run:
remove admin adminname
Topics: AIX, Backup & restore, System Admin, Virtual I/O Server, Virtualization↑
How to make a system backup of a VIOS
To create a system backup of a Virtual I/O Server (VIOS), run the following commands (as user root):
# /usr/ios/cli/ioscli viosbr -backup -file vios_config_bkupThe first command (viosbr) will create a backup of the configuration information to /home/padmin/cfgbackups. It will also schedule the command to run every day, and keep up to 10 files in /home/padmin/cfgbackups.
-frequency daily -numfiles 10
# /usr/ios/cli/ioscli backupios -nomedialib -file /mksysb/$(hostname).mksysb -mksysb
The second command is the mksysb equivalent for a Virtual I/O Server: backupios. This command will create the mksysb image in the /mksysb folder, and exclude any ISO repositiory in rootvg, and anything else excluded in /etc/exclude.rootvg.
It is useful to run the following commands before you create your (at least) weekly mksysb image:
# lsvg -o | xargs -i mkvgdata {}
# tar -cvf /sysadm/vgdata.tar /tmp/vgdata
Add these commands to your mksysb script, just before running the mksysb command. What this does is to run the mkvgdata command for each online volume group. This will generate output for a volume group in /tmp/vgdata. The resulting output is then tar'd and stored in the /sysadm folder or file system. This allows information regarding your volume groups, logical volumes, and file systems to be included in your mksysb image.
To recreate the volume groups, logical volumes and file systems:
- Run:
# tar -xvf /sysadm/vgdata.tar
- Now edit /tmp/vgdata/{volume group name}/{volume group name}.data file and look for the line with "VG_SOURCE_DISK_LIST=". Change the line to have the hdisks, vpaths or hdiskpowers as needed.
- Run:
# restvg -r -d /tmp/vgdata/{volume group name}/{volume group name}.data
Sometimes, you just need that one single file from a mksysb image backup. It's really not that difficult to accomplish this.
First of all, go to the directory that contains the mksysb image file:
# cd /sysadm/iosbackupIn this example, were using the mksysb image of a Virtual I/O server, created using iosbackup. This is basically the same as a mksysb image from a regular AIX system. The image file for this mksysb backup is called vio1.mksysb
First, try to locate the file you're looking for; For example, if you're looking for file nimbck.ksh:
Here you can see the original file was located in /home/padmin.# restore -T -q -l -f vio1.mksysb | grep nimbck.ksh New volume on vio1.mksysb: Cluster size is 51200 bytes (100 blocks). The volume number is 1. The backup date is: Thu Jun 9 23:00:28 MST 2011 Files are backed up by name. The user is padmin. -rwxr-xr-x- 10 staff May 23 08:37 1801 ./home/padmin/nimbck.ksh
Now recover that one single file:
Note that it is important to add the dot before the filename that needs to be recovered. Otherwise it won't work. Your file is now restored to ./home/padmin/nimbck.ksh, which is a relative folder from the current directory you're in right now:# restore -x -q -f vio1.mksysb ./home/padmin/nimbck.ksh x ./home/padmin/nimbck.ksh
# cd ./home/padmin # ls -als nimbck.ksh 4 -rwxr-xr-x 1 10 staff 1801 May 23 08:37 nimbck.ksh


