System information

Chapter 13. Virtual Partition Manager 419
13.8 Virtual medial management
This section covers virtual medial management.
13.8.1 Linux native backup with virtual tape
The OS/400 tape drive can be used by Linux for Linux-based save/restore of files and
directories in a hosted partition.
Linux oriented backup has the same attributes as i5/OS oriented backup on file and directory
level. The only difference is that the backup files are not saved to files in the NFS directory,
but directly on tape. Tape is directly connected to i5/OS environment but can be used in Linux
as virtual tape.
The following steps must be done to successfully save Linux files and directories on tape
connected to an i5/OS partition:
1. Initialize tape for Linux. On i5/OS, the standard code for coding letters and numbers used
is EBCDIC, whereas on Linux it is ASCII. This means that, in the scenario of Linux
oriented backup, you need to strictly sort out tape cartridges for i5/OS and for Linux.
The following command is an example of initializing the tape cartridge for Linux:
INZTAP DEV(TAP02) NEWVOL(LNXBCK) CHECK(*NO) CODE(*ASCII) CLEAR(*YES)
2. Find the name convention for i5 tape in Linux. Use the dmesg | grep st command in ssh
PuTTY to find the name of the tape you want to use for Linux backup. In our scenario we
have the two tape devices, st0 and st1, and the messages during boot regarding tapes are
shown in Figure 13-34.
Figure 13-34 dmesg - tape messages during boot
3. Assume that the order of tape devices is the same in i5/OS and Linux and we want use
TAP02 (not TAP01) in i5/OS terminology, meaning we need to find st1 tape in Linux. Find
where the st1 is located in Linux. Use ssh PuTTY and the command:
find / -name st1
We receive the following output as shown in Figure 13-35.
Figure 13-35 Find the tape location
Because st1 is a device, the /dev/st1 is the right path to tape.
4. Vary off tape on i5/OS. Use 5250 screen and command:
VRYCFG CFGOBJ(TAP02) CFGTYPE(*DEV) STATUS(*OFF) RANGE(*OBJ)
5. Use ssh PuTTY screen to check status of tape. Use the command:
mt -f /dev/st1 status
st: Version 20040318, fixed bufsize 32768, s/g segs 256
Attached scsi tape st0 at scsi0, channel 2, id 0, lun 0
st0: try direct i/o: yes (alignment 512 B), max page reachable by HBA 294912
Attached scsi tape st1 at scsi0, channel 2, id 1, lun 0
st1: try direct i/o: yes (alignment 512 B), max page reachable by HBA 294912
rchas10d:~ # find / -name st1
/sys/class/scsi_tape/st1
/dev/st1