HP-UX system backup and recovery

Source: Internet
Author: User
Directory

I. Common commands for system backup and recovery
1. fbackup/frecover
2. Tar
3. Sam
4. copyutil
5. make_recovery

Ii. methods and strategies for system backup and recovery
1. system backup policy
2. System Recovery Policy

1. Common commands for system backup and recovery

1. fbackup & frecover

1.1 System Backup command: fbackup

1) Common fbackup Method 1:

[1] accessing a single user:

# Shutdown-Y 0
#/Etc/Mount-

[2] Full System Backup

# Fbackup-F/dev/RMT/0 m-0iv/-I/tmp/sysbk. Index

-F: Device File Name (such as DDS tape driver)
-I: directory to be included
-E: excluded directory
-I: Backup Content Retrieval directory
-V: Detailed list of backup content
-0: Zero-level backup

# Fbackup-F/dev/RMT/0 m-I/-E/home

Back up all directories except/home

[3] Description

1) This command backs up the current "mounted" file system.
2) backup level description

Backup level: 0 ~ 9 levels. If the current system uses zero-level backup, the current system uses five levels at a time.
During backup, the system only backs up the changed files.

2) Common fbackup methods:

[1] # mkdir-P/tmp/fbackupfiles/Index
# Mkdir-P/tmp/fbackupfiles/log

# Touch/tmp/fbackupfiles/index/full. 'date' + % Y % m % d. % H: % m''

[3] accessing a single user

# Shutdown-Y 0
#/Etc/Mount-

Full backup of the system

# Fbackup-0vi/-F/dev/RMT/0 m/
-I/tmp/fbackupfiles/index/full. 'date' + % Y % m % d. % H: % m ''/
2>/tmp/fbackupfiles/log/full. 'date' + % Y % m % d. % H: % m''

In this way, you can know the time required for system backup.

3) Common fbackup methods:

[1] enter a single user

# Shutdown-Y 0
#/Etc/Mount-

Full backup of the system

# Fbackup-0uv/-F/dev/RMT/0 m/
-G/tmp/fbackupfiles/mygraph/
-I/tmp/fbackupfiles/index/full. 'date' + % Y % m % d. % H: % m ''/
2>/tmp/fbackupfiles/log/full. 'date' + % Y % m % d. % H: % m''

Instructions

A. File mygraph: contains the directory to be backed up. The format is as follows:

I/users/Data
I/home/APP
E/Oracle/SQL

B. parameter U:

When the backup system is successful, the system updates/var/adm/fbackupfiles/dates.

4) fbackup:

Back up remote systems

[1] When logging on to the local system

# Remsh backup_sysname "fbackup-F dds_sysname:/dev/RMT/0 m-0vi /"

[2] When logging on to a remote system

# Fbackup-F backup_sysname:/dev/RMT/0 m-0vi/

5) Common fbackup Methods 5:

Compression mode backup (not recommended, affecting system performance)

[1] Compression backup

# Fbackup-0vi/Dir-F-| compress | dd OF =/dev/RMT/0 m obs = 10 K

"-": Pointing to standard output

[2] viewing backup content

# Dd If =/dev/RMT/0 m IBS = 10 k | uncompress | frecover-I--f-

1.2 System Recovery command: frecover

1) Restore all content on the tape drive:

[1] accessing a single user:

# Shutdown-Y 0
#/Etc/Mount-

[2] Recovering data

# Frecover-RF/dev/RMT/0 m

Recover all data on tape

-F: Device File Name
-R: Restore all data on the tape
-I: index the files on the tape to the specified files.

# Frecover-I/tmp/index.txt-F/dev/RMT/0 m

2) restore a directory:

# Frecover-XI/directory

# Frecover-X-I/dir1-I/dir2

# Frecover-xoi/Dir

-O: overwrite existing files with the same name under/Dir

# Frecover-xvxi/Dir

-X: Restore data by directory on tape

# Cd/tmp/local; frecover-xvyi/Dir

-Y: Restore data by tape file name

For example:

# Cd/tmp/local
# Frecover-xvf-I/home/filename

[Recovery result]/tmp/local/filename is not/home/filename

3) recover data from the remote tape drive to the local device:

# Frecover-XI/Dir-F remote_name:/dev/RMT/0 m

4) recover data from the local drive to the remote system:

# Remsh remote_name "frecover-XI/Dir-F local_name:
/Dev/RMT/0m"

2. tar command

2.2.1 full system backup

# Tar CVF/dev/RMT/0 m/

2.2.2 back up a directory

# Tar CVF/dev/RMT/0 m/tmp

2.2.3 change the file backup path

# Tar CVF/dev/RMT/0 m-C/tmp.

[Note]: The Path/tmp is changed to the backup path on the tape ./

# Cd/tmp
# Tar CVF/dev/RMT/0 m ./*

2.2.4 data restoration

# Tar xvf/dev/RMT/0 m (all data on the tape)

# Tar xvf/dev/RMT/0 m/tmp (Restore directory/tmp)

2.2.5 view tape data

# Tar tvf/dev/RMT/0 m

3. Sam

1) Back up data

# Sam

----> Select "backup and recovery"
----> Select "Interactive backup and recovery"
----> Select "backup device"
----> Select "backup files interactively" (from [action] menus)
-----> Select backup Scope
-----> Select local file systems only (no NFS)
-----> Select "OK"

2) Check the backup data

[1] Check file/var/SAM/log/br_log

--------------------------------------------------
Full backup started on host1: Wed Oct 16 15: 10: 09 eat 1998
(Scheduled Backup)
{Fbackup-0-u-v-g/etc/SAM/BR/graphdcaa04366-I/var/SAM/log/br_indext.full
-C/etc/SAM/BR/fbackup_config-D/var/adm/fbackupfiles/dates-F/dev/RMT/c1td0d0
Best} 2> & 1
Full backup completed on host1: Wed Oct 16 16:44:01 eat 1998
Exit code = 0
--------------------------------------------------

Notes: If exit code = 2, there is problem on backup procedure.

[2] viewing files on tape

# Frecover-rnsv-F/dev/RMT/0 m

4. copyutil

1) how to start "copyutil"

[1] from CD boot, go to isl

Boot_admin> boot SCSI. N. M (path of CDROM Drive ---- such as scsi.4.0)

[2] isl> ode copyutil

Type help for Command Information

[3] isl_cmd> copyutil

Please wait while scan device bussess...

Ty indx path product ID bus size Rev

D 0 16/5. 6.0 seagatest31230n disk drive SCSI 1.0 GB hpm4
D 1 16/5. 5.0 seagatest31230n disk drive SCSI 1.0 GB hpm4
T 2 16/5. 0.0 hpc1504 [x]/hpc1521b DDS tape scsi n/A 1009

1) back up all data on the system hard disk

Copyutil> Backup

Enter the disk index ([Q]/?) : 0
Enter the tape index ([Q]/?) : 2

Use Data Compression? (Y/[N])? Y

When backup finished, system will show: Done!

Copyutil> exit

3) recover data to the specified system hard disk

Copyutil> restore

Enter the tape index ([Q]/?) : 2
Enter the disk index ([Q]/?) : 0

Use Data Compression? (Y/[N])? Y

After system display: restored successful, that means restore is finished!

Copyutil> exit

4) Note:

When copyutil is used to back up the root disk to the corresponding tape, the tape can be used as a bootable tape.

5 make_recovery

1) install "Ignite-UX application"

[1] install from HP-UX application CD-ROM

1) # swinstall
2) "mark" [A. 1.53 HP-UX installation utility (Ignite-UX for 10.20)]
3) "analysis"
4) "Install"

[2] download and install from Website:

1) http://www.software.hp.com/
Select: "Network & System Administration"
Download: ignite-ux_10.20.tar (OS version 10.20)

2) install it on the hard disk:

# Cd/tmp
# Tar xvf/dev/RMT/0 m./ignite-ux_10.20.tar
# Swinstall-S/tmp/ignite-ux_10.20.tar

3) install on tape:

# Dd If =/tmp/ignite-ux_10.20.tar of =/dev/RMT/0 m BK = 2
# Swinstall-S/dev/RMT/0 m

[4] make_recovery:

#/Opt/ignite/bin make_recovery [-aprvc] [-D destination] [-B boot_destination]

-A: Specifies the root disk/volume group to be backed up.

-P: preview the backup process without creating bootable DDS tape.

A. Confirm the/var/opt/ignite/recovery/mkrec. append file.

B. Create the/var/opt/ignite/recovery/arch. Include File.

-R: After the-P option is used, you can use this option to create the bootable DDS tape.

A. This option recognizes the/var/opt/ignite/recovery/arch. Include File.

-V: displays the prompt information about the backup process.

-D: Specify the Device File Name of the DDS (default:/dev/RMT/0mn)

-B: Specifies the temporary files used during system backup (default:/var/tmp/uxinstlf. Recovery)
The file size is 32 MB. When make_recovery is performed on the system, note the/var file system.
When the/var file system is insufficient, use the following command to back up the system:

# Make_recovery-a-c-B/tmp/uxinstlf. Recovery

-C: create a file that reflects the current state of the system:/var/opt/ignite/recovery/makrec. Last

If the file exists, you can use the check_recovery command.

[5] Note:

The tapes backed up with make_recovery are bootable tapes that can be used to install OS.

2) backup system root disk

[1] Create bootable DDS tape (default device file:/dev/RMT/0mn) for the "minimal" OS)

# Make_recovery

[2] Create the bootable DDS tape of the "minimal" OS (Device File:/dev/RMT/c0t1d1bestn)

# Make_recovery-D/dev/RMT/c0t1d1bestn

[3] preview before creating bootable DDS tape

# Make_recovery-P
# Vi/var/opt/ignite/recovery/arch. Include
# Make_recovery-R

[4] copying the entire root disk

# Make_recovery-

[5] copy the entire root disk and generate a file that reflects the current state of the system:
(/Var/opt/ignite/recovery/makrec. Last)

# Make_recovery-C-

[6] instance analysis:

(1) System File System:

Filesystem Kbytes used avail % used mounted on

/Dev/vg01/osdepot 2621440 2530838 84872 97%/osdepot
/Dev/vg01/lvol1 480341 58696 373610 14%/var
/Dev/vg01/lvol7 378965 297521 43547 87%/usr
/Dev/vg01/lvol6 588643 245540 284238 46%/OPT
/Dev/vg00/lvol3 107669 38577 58325 40%/
/Dev/vg00/lvol1 67733 12409 48550 20%/stand
/Dev/vg00/lvol4 30597 19 27518 0%/tmp
/Dev/vg00/lvol5 19861 1416 16458 8%/home

(2) Analysis:

[A] make_recovery:

Vg00:/stand,/sbin,/dev,/etc,/tmp,/home

Vg01: Parts of/OPT and/var (see Core-OS List)
/Usr/bin,/usr/lib
/Usr/OBAM,/usr/sam,
/Usr/share,/usr/CCS,
/Usr/Conf,/usr/lbin,
/Usr/contrib,/usr/local,
/Usr/newconfig

[B] make_recovery-:

Vg00: Back up all data on the root volume group

Vg01: Back up all data on the non-root volume group

Only when/usr is in the non-root volume group,
All data on the non-root volume group will also
Backed up to tape

3) Restore all data on the tape

(1) non-interactive Recovery System

[1] inserting a system recovery tape into the tape drive

[2] boot System

[3] Stop the boot process and go to the boot_admin> prompt

[4] boot_admin> Bo 8/16. 0.0

8/16. 0.0: hardware path of the tape drive

[5] Select "non-interactive"

[6] waiting for system recovery to complete

(2) Interactive Recovery System

[1] inserting a system recovery tape into the tape drive

[2] boot System

[3] Stop the boot process and go to the boot_admin> prompt

[4] boot_admin> Bo 8/16. 0.0

8/16. 0.0: hardware path of the tape drive

[5] "non-interactive" is not selected"

[6] Select

A. [install HP-UX]

B. [advanced installation]

C. Configure or change the following options:

Disks, file systems,
Hostname, IP ddress,
Timezone, root password,
DNS server, and gateway
[7] select [install continue... ] Until the system is restored

Ii. system backup/recovery methods and strategies

2.1 system backup policy

HP-UX core-OS:

This part of content mainly includes some HP-UX used in the file system, such as/,/OPT,/var,/tmp,/usr,/home,/stand usually these file systems are located in vg00.

Backup method:

(1) fbackup:

# Fbackup-0vi/-F/dev/RMT/0 m/
-I/tmp/fbackupfiles/index/full. 'date' + % Y % m % d. % H: % m ''/
2>/tmp/fbackupfiles/log/full. 'date' + % Y % m % d. % H: % m'

For details, see (Common fbackup method 2)

(2) make_recovery:

# Make_recovery-c-a-B/tmp/oslif. rec

For details, see (make_recovery)

[2] system configuration file

Some critical files or information of the system need to be backed up separately, which is conducive to system recovery. These files or information include:

(1) system swap information

# Swapinfo-T

(2) System File System Information

# BDF

(3) system I/O Information

# Ioscan-fncdisk

(4)/etc/fstab

(5) System Logical volume configuration file

/Etc/lvmconf/vg00.conf, v1_1.conf, and v1_2.conf

You can run the following command to configure these logical volumes:
Vgcfgbackup/vgcfgrestore generation and recovery

(6) use HP tools to collect and back up system configuration information

These tools include: lvmcollect.10
Collect. Sh
Capture. Sh
Collect. conf

Backup method:

(1) tar

# Tar CVF/dev/RMT/0 m./vg00.conf./v1_1.conf

(2) fbackup

# Fbackup-F/dev/RMT/0 m-I/etc/lvmconf/v1_1.conf

Other System Logical volumes (for example, vg01 and vg02)

Backup method:

(1) fbackup:

# Fbackup-0uv/-F/dev/RMT/0 m/
-G/tmp/fbackupfiles/mygraph/
-I/tmp/fbackupfiles/index/full. 'date' + % Y % m % d. % H: % m ''/
2>/tmp/fbackupfiles/log/full. 'date' + % Y % m % d. % H: % m''

(2) tar

# Tar CVF/dev/RMT/0 m/Oracle/APP/home/Oracle

[4] Database Backup

Refer to the database backup method

2.2 system recovery policies

When fbackup/tar is used to back up the system

1) install core-OS

2) restore the backup content of vg00, vg01, and vg02

# Frecover-o-r-F/dev/RMT/0 m

When you back up the system with make_recovery

1) use a tape boot system to restore vg00

For details, see the restoration method of make_recovery.

2) Restore other logical volumes

# Frecover-o-r-F/dev/RMT/0 m

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.