Chapter 5. Backup and recovery 161
5.4.6 File-level recovery via storage spaces
File-level recovery via storage spaces is a technique you can use to restore a single file from
a storage space. This technique may enable you to perform all your Linux backup and
recovery operations using OS/400 commands, without the need to use Linux utilities.
Take the following scenario: One of your users accidentally deletes a file and asks you to
recover it. You back up all your Linux drives (storage spaces) every night, so you have a
recent backup of the file that needs to be recovered. If you simply restore the backed up
storage space containing the file, it overwrites the currently linked storage space because
they both have the same name. Unfortunately, you would lose all the changes to files that
have been made since the last backup. Therefore this would not be a good idea. Alternatively,
you could restore the backed up storage space to a storage space with a different name so
that no files are overwritten. You could then dynamically link the restored storage space to the
running server and copy the file you need from the newly linked backup storage space to its
original location. Therefore, you have been able to recover a single file from a storage space
without needing to even shut down the Linux server.
To recover a single file from a storage space, follow these steps:
1. Restore the storage space containing the file you need from tape or disk, renaming the
storage space during the restore. Use a command from Table 5-6 on page 155 or
Table 5-7 on page 157. In the example shown in Figure 5-9 on page 162, a storage space
named redhat18 is restored from tape and renamed redhat18a. Therefore, it does not
overwrite storage space redhat18 from which it was backed up.
Replace the underlined
values in Figure 5-9 on page 162 with values that are
appropriate for your setup.
2. Link the restored storage space dynamically if the Linux server is started, or statically if it
is shut down.
3. Mount the new drive in Linux.
4. Copy the file you need to recover from the newly linked drive to its original location in the
Linux file system.

Get Implementing Linux on Integrated xSeries Solutions for iSeries now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.