Replacing disks during a restore
You can replace disks during a restore by renaming chunks. You rename chunks by specifying new chunks paths and offsets during a cold restore with ON-Bar. This option is useful if you need to restore storage spaces to a different disk from the one on which the backup was made. You can rename any type of chunk, including critical chunks and mirror chunks.
Before you begin
The following guidelines apply to new chunks:
- The new chunk does not need to exist. You can install the new
chunk later and perform a warm restore of a storage space containing
it. If you specify a nonexistent chunk, ON-Bar records
the rename information in the chunk reserved pages, but does not restore
the data. The renamed (but not restored) chunks have a status of offline,
designated by an
N
flag in the output of the onstat -d command. - The new chunk must have the correct permissions.
- The new chunk must be included in the last level-0 backup.
- The new chunk path name and offset cannot overlap existing chunks.
About this task
Tip: If you use symbolic links to chunk names,
you might not need to rename chunks; you only need to edit the symbolic
name definitions.
Procedure
To rename chunks during a restore:
- Shut down the database server.
- Run the onbar -r command with the -rename option
and the chunk information options.If you are renaming the primary root or mirror root chunk, ON-Bar updates the values of the ROOTPATH and ROOTOFFSET, or MIRRORPATH, and MIRROROFFSET configuration parameters. The old version of the onconfig file is saved as $ONCONFIG.localtime.
- Perform a level-0 archive so that you can restore the renamed chunks.
Examples
The following table lists example
values for two chunks that are used in the examples in this section.
Element | Value for first chunk | Value for second chunk |
---|---|---|
Old path | /chunk1 | /chunk2 |
Old offset | 0 | 10000 |
New path | /chunk1N | /chunk2N |
New offset | 20000 | 0 |
- Example 1: Rename chunks by supplying chunk information in the command
- The following command renames the chunks chunk1 to chunk1N and chunk2 to chunk2N:
onbar -r -rename -p /chunk1 -o 0 -n /chunk1N -o 20000 -rename -p /chunk2 -o 10000 -n /chunk2N -o 0
- Example 2: Rename chunks by supplying chunk information in a file
Suppose that you have a file named listfile that has the following contents:
/chunk1 0 /chunk1N 20000 /chunk2 10000 /chunk2N 0
The following command renames the chunks chunk1 to chunk1N and chunk2 to chunk2N:
onbar -r -rename -f listfile