Save and restore hosted Linux files to and from the host's shared tape drive

 

To save hosted Linux data to a shared tape drive and restore the data from the tape drive, you can use either the Linux tar command or the i5/OS® Save Object (SAV) and Restore Object (RST) commands.

If you use tar to save data, the only way you can restore that data is by using tar again. Similarly, if you use SAV to save data, the only way you can restore that data is by using RST. The two methods of backing up and restoring data are not compatible.

The following restrictions apply:

 

Save and restore hosted Linux files by using Linux tar

Backups using Linux tar are file-level backups. They save only the files and directories that the tar command specifies. Therefore, you cannot use tar to save Linux data that is not in the fileserver. For example, you cannot save a kernel residing in the PReP start partition by using the tar command.

 

Save files by using Linux tar

The Linux command to save hosted Linux files to the host's shared tape drive is the following:

tar -b 40 -c -f /dev/iseries/vt0 files

where

tar = command name (contraction of "tape archive")
-b 40 = block size in sectors
-c = command action (create)
-f /dev/iseries/vt0 = virtual tape device and number
files = names of files to be saved

Linux normally treats tape as a "character device" that it can quickly read from or write to in long streams of data, but cannot quickly access to find specific data. By contrast, Linux treats a disk or CD as a "block device" that it can read from or write to quickly at any point on the device, making it suitable for the mount command. The -b 40 argument specifies that Linux should write the archive stream in blocks of 40 sectors (20 kilobytes). If you do not specify a value for this argument, the default value is 20 sectors (10 kilobytes), which does not perform as well over virtual tape as a value of 40 does.

The -c argument specifies that the tar command creates a new archive or overwrites an old one (as opposed to restoring files from an archive or adding individual files to an existing archive).

The -f /dev/iseries/vt0 argument specifies that the command uses virtual tape 0 on the iSeries™ server. After the tar command runs, Linux closes the tape device and rewinds the tape. If you want to save more than one archive on the tape, keep the tape from rewinding after each use, and position the tape to the next file marker. To do this, specify the nvt0 (nonrewinding virtual tape) device instead of vt0.

The files argument specifies the names of the files and directories that you want to save.

 

Restore files by using Linux tar

The Linux command to restore hosted Linux files from the host's shared tape drive is the following:

tar -b 40 -x -f /dev/iseries/vt0 files

where the -x (extract) argument replaces the -c (create) argument in the tar command used to save files to tape.

 

Save and restore hosted Linux data by using i5/OS SAV and RST

Backups of hosted Linux data from i5/OS are drive-level. This means that Linux backs up the entire contents of a virtual disk or network storage space, rather than individual Linux files. Thus, the correct SAV command backs up any information on the drive, including a kernel in the PReP start partition.

 

Save Linux hosted data by using i5/OS SAV

On i5/OS your data is in a network server storage space. The i5/OS commands to save hosted Linux files to the host's shared tape drive include the following:

  1. Save Object (SAV), where you save the network server storage space to the save file. On the Save Object display, enter the following parameter values:

    • In the Device field, enter the associated i5/OS device description. For example, if your tape device is named TAP01, enter /qsys.lib/tap01.devd. To save to a save file in a library like QGPL, enter /qsys.lib/qgpl.lib/myfile.file.

    • In the Objects: Name field, enter the IFS location of the network server storage space. For example, if your network server storage space is named TEST1, enter /qfpnwsstg/test1.

  2. Display Saved Objects - Save File (DSPSAVF) to verify that the changed save file exists. In the Option field to left of the new save file name, enter 5=Display objects in subdirectory. You see a list of the stream files in the save file.

 

Restore Linux hosted data by using i5/OS RST

The i5/OS command to restore hosted Linux files from the host's shared tape drive is Restore Object (RST). On the Restore Object display, enter the following parameter values:

  • To restore from a real tape device, enter the associated i5/OS device description in the Device field. For example, if your tape device is named TAP01, enter /qsys.lib/tap01.devd. To restore from a save file in a library like QGPL, enter /qsys.lib/qgpl.lib/myfile.file.

  • In the Objects: Name field, enter the IFS location of the network server storage space, for example, /qfpnwsstg/test1.

 

Troubleshooting Linux virtual tape

If errors occur while you access Linux virtual tape, examine the file /proc/iSeries/viotape. It describes the mapping between i5/OS device names and Linux device names and records the last error for each tape device. Common errors and recovery scenarios include the following:

Device unavailable

Make sure the device is varied off under i5/OS.

Not ready

Retry the operation. If the operation still fails with the same description in /proc/iSeries/viotape, verify that the correct medium is in the tape drive.

Load failure or Cleaning cartridge found

Verify that the correct medium is in the tape drive.

Data check or Equipment check

Verify that you are using a supported block size to read or write the tape. All known IBM-supported tape devices can use a block size of 20 kilobytes (supplied by the -b 40 argument to tar).

Internal error

Contact your service representative.

 

Parent topic:

Back up and recover a logical partition