To be sure that a tape cartridge is format-ready, this section introduces a new option, -E , to the  ltfsee pool remove  command. When run, this command checks whether the tape cartridge contains any active data. If all the files in the tape cartridge have already been deleted in GPFS, the command determines that the tape cartridge is effectively empty and removes the tape cartridge from the pool. If the tape cartridge still has active data, the command will not remove it. No  reconciliation  command is necessary before this command. 

When -E is run, the command performs the following steps: 

1. Determine whether the specified tape cartridge is in the specified pool and is not mounted. 

2. Reserve the tape cartridge so that no migration will occur to the tape. 

3. Read the volume cache (GPFS file) for the tape cartridge. If any file entries exist in the volume cache, check whether the corresponding GPFS stub file exists, as-is or renamed. This is the same check routine as the current reclaim -q  (quick reconcile) command. 

4. If the tape cartridge is empty or has files but all of them have already been deleted in GPFS (not renamed), remove the tape cartridge from the pool. 

Example 7-45 shows the output of the active file check -E command with three tape cartridges. VTAPE3L5 is an empty tape cartridge. VTAPE4L5 and VTAPE5L5 have files migrated to them and all corresponding GPFS stub files deleted, but reconciliation has not yet been performed. 

[root@io0 src]# /opt/ibm/ltfsee/bin/ltfsee pool remove -p pool1 -l lib1 -t VTAPE3L5 -t VTAPE4L5 -t VTAPE5L5 -E GLESL584I(00820): Reserving tapes. GLESS135I(00851): Reserved tapes: VTAPE3L5 VTAPE4L5 VTAPE5L5 . GLESL043I(00881): Removing tape VTAPE3L5 from storage pool pool1. Removed tape VTAPE3L5 from pool pool1 successfully. GLESL043I(00881): Removing tape VTAPE4L5 from storage pool pool1. GLESL575I(00907): Tape VTAPE4L5 contains files but all of them have been deleted in GPFS. GLESL572I(00938): Removed tape VTAPE4L5 from pool pool1 successfully. Format the tape when adding back to a pool. GLESL043I(00881): Removing tape VTAPE5L5 from storage pool pool1. GLESL575I(00907): Tape VTAPE5L5 contains files but all of them have been deleted in GPFS. GLESL572I(00938): Removed tape VTAPE5L5 from pool pool1 successfully. Format the tape when adding back to a pool. GLESS137I(00980): Removing tape reservations. 

5. If the tape cartridge has a valid, active file, the check routine aborts on the first hit and goes on to the next specified tape cartridge. The command will not remove the tape cartridge from the pool. 

In Example 7-46, VTAPE7L5 has files migrated to the tape cartridge, but all corresponding GPFS stub files have been deleted. VTAPE8L5 has active renamed data whereas VTAPE9L5 has active data. Upon running the -E  command, only VTAPE7L5 is removed. VTAPE8L5 and VTAPE9L5 will not be removed. 

[root@io0 archive]# ltfsee pool remove -p pool1 -t VTAPE7L5 -t VTAPE8L5 -t VTAPE9L5 -E GLESL584I(00820): Reserving tapes. 

