Introduction to Common commands for Linux System Backup

Source: Internet
Author: User
Tags rewind

Many commands are not common when backing up a Linux system. In this article, we will see several very useful Linux system backup commands. In fact, Linux system backup is also divided into different forms.

Common vdump methods:

1) For files that need to be backed up in read-only mode, it is recommended that you enter a single user:

# Inits or

>>> Boot-fl s

2). Back up MOUNT Points of the Operating System

3). # mount-

# Vdump-0uvf/dev/ntape/tape0_d1/

# Vdump-0uvf/dev/ntape/tape0_d1/usr

# Vdump-0 uf/dev/ntape/tape0_d1/var (if the var area is used as a separate file subset, it also needs to be backed up separately)

-F: Device File Name (such as DDS tape driver)

-U: update/etc/vdumpdates for Incremental Backup

-V: Detailed list of backup content

-0: Zero-level backup

/Dev/ntape0_d1: After the system completes execution, the tape stops at the current location. You can continue to back up the tape.

//;/Usr;/var: MOUNT point of each FILE SYSTEM

4). Other Instructions

A. This command backs up the current mounted file system.

B. Backup level description

Backup level: 0 ~ 9 levels. If the current system uses zero-level backup, the system will only back up the changed files when a five-level backup is used.

Common command for system recovery-vrestore

Restore the file system content of the entire operating system:

1). preparations:

A. Prepare an available new hard disk. The capacity is basically the same as that of the original disk.

B. Prepare an installation disc of the same version as the backup system.

2) use the operating system installation disc to boot to the installation interface, adjust the size of each partition of the new hard disk, and then enter a single user.

* >>> Boot dqa0 (dqa0 is the optical drive device number under SRM)

* Choose OK-> NEXT ---> NEXT->-NEXT-> CUSTOMIZE FILE SYSSTEM LAYOUT to adjust the partition size according to the normal installation steps. --> QUIT OR SHELL WINDOW.

* Note: when adjusting the new hard disk partition, You must select ADVFS on the boot block and define Zone B as SWAP.

3) Create File Systems for the operating system. If the new system disk is dsk0)

Mkfdmn/dev/disk/dsk0a root_temp create a file system domain)

Mkfset root_temp root creates a subset of files)

Mkfdmn/dev/disk/dsk0g usr_temp

Mkfset usr_temp usr

Mkfset usr_temp var (condition: In the original system, VAR is a separate file subset)

Note: In the process of creating an advanced file system, the domain name is arbitrary as long as it does not conflict with the original name. However, it is best to name a subset of a file in the same way as before. To avoid unnecessary modifications)

4) Recovery of various file systems in the operating system

# Mount root_temp # root/mnt

# Cd/mnt

# Vrestore-xvf/dev/ntape/tape0_d1 (restore all data on the file system)

# Cd/

# Umount/mnt

# Mount usr_temp # usr/mnt

# Cd/mnt

# Vrestore-xvf/dev/ntape/tape0_d1

# Cd/

# Umount/mnt

# Mount usr_temp # var/mnt condition: VAR is a separate file subset)

# Cd/mnt

# Vrestore-xvf/dev/ntape/tape0_d1

-F: Device File Name

-X: restores all data in the current backup data segment of the tape.

-V: Detailed list of backup content

5) if the device names of the restored hard disk and the backup disk are different in the system, for example, the backup disk is dsk0 and the recovery disk is dsk1.) You need to make the following changes:

# Mount root_temp # root/mnt

# Cd/mnt/etc/fdmns

# Cd root_domain

# Rm *

# Ln-s/dev/disk/dsk1a

# Cd ..

# Cd usr_domain

# Rm *

# Ln-s/dev/disk/dsk1g

# Cd/mnt/etc

# Vi sysconfigtab

Change swapdevice =/dev/disk/dsk0b to swapdevice =/dev/disk/dsk1b.

6) SHUTDOWN system. Use a new disk to boot under SRM.

Restore some directories or files in a file system:

# Vrestore-if/dev/ntape/tape0_d1

(/) Add vmunix genvmunix only restores vmunix and genvmunix files in the system root backup)

/) Extract (start recovery)

Separate recovery of individual or several directories as above

Several Notes for operating the tape drive

The tape drive is recorded in segments during the backup process, and the location of the tape must be considered during recovery. Based on the backup example above, three independent data backup information segments are created on the Data belt: // usr;/var ). The following command can be used to adjust the data band position.

# Mt rewind)

The/usr file system or individual file information needs to be restored separately:

# Mt rewind

# Mt fsf 1 (skip the first data backup segment /)

If the above requirements occur on/var, then:

# Mt rewind skips the first two data backup segments)

# Mt fsf 2

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.