Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Linux \ Use dump restore mode fast backup and recovery system FreeBSD     - 10 tips daily Docker (Server)

- PHP 5.3 New Features Detail (Linux)

- How linux network security configuration (Linux)

- MariaDB 10 Multi-source replication (Database)

- Five useful commands to manage file types and system time in linux (Linux)

- Use libcurl library download url image (Programming)

- Linux command binlog by filtering out the complete SQL statement (Database)

- Based Docker build stand-alone high-availability cluster Hadoop2.7.1 Spark1.7 (Server)

- Linux kernel modules related to the management Comments (Linux)

- To compile and install Clang 3.5.0 in Linux CentOS (Linux)

- MariaDB 10.0.X, the dynamic column support JSON format to obtain data (Database)

- Install the free open source financial software GnuCash 2.6.6 under Ubuntu (Linux)

- Boost notes --Thread - problems encountered in the initial use on Ubuntu (Programming)

- To install OwnCloud 7.0.4 under Ubuntu (Linux)

- Linux screen commonly commands (Linux)

- Configuring a Linux operating system security management services Explain (Linux)

- Vagrant Getting Start (Linux)

- Source MongoDB 3.2.1 installed on CentOS6.5 (Database)

- Text analysis tools - awk (Linux)

- Linux Demo dd IO test (Linux)

 
         
  Use dump restore mode fast backup and recovery system FreeBSD
     
  Add Date : 2018-11-21      
         
         
         
  Note: In this instance FreeBSD7.2 tested for FreeBSD8 or FreeBSD9 same applies, FreeBSD9 simplifies the default partition number, backup and recovery steps can be simplified.

Environment: The company has several aging FreeBSD7.2 server hard disk needs to be replaced, due to the company to write applications for low version php5.2 rely more, if you upgrade FreeBSD would be more trouble (maintenance release in the FreeBSD ports has no php5.2), even reinstall FreeBSD7.2, because the official has not maintained, ports installation will be more difficult. So consider using a dump and restore backup restore hard disk directly.

step:

First, for each server periodically dump, to prepare for when a disk fails Rapid Recovery System

1, shutdown, mount the backup disk (used to store data dump), unplug the original FreeBSD system disk hard line (to prevent misuse destroy data)

2, U disk boot FreeBSD (FreeBSD8.2 U disk I use), backup disk partition formatting, this step can use sysinstall tools, more convenient (you can only divide a zone, you can press the default partition does not matter).

3, connected to the original system disk, hard disk to re-boot, mount the backup disk (I was / bkdisk)

4, writing backup scripts and cron put in execution, my script dumpslice.sh:

#! / Bin / sh
 # Program:
 # Dump disk slice
 # History:
 # 2014/09/10 yanglifeng First release

 bak_root = "/ bkdisk / dumpfiles"
 dir_name = `date +% Y% m% d`

 #create backup dir
 mkdir $ {bak_root} / $ {dir_name}

 / Sbin / dump -0Lauf $ {bak_root} / $ {dir_name} /ad4s1a_root.dump / dev / ad4s1a
 / Sbin / dump -0Lauf $ {bak_root} / $ {dir_name} /ad4s1d_var.dump / dev / ad4s1d
 / Sbin / dump -0Lauf $ {bak_root} / $ {dir_name} /ad4s1f_usr.dump / dev / ad4s1f

 df -h> /${bak_root}/sliceinfo.txt


For FreeBSD7 and FreeBSD8, just backup /, / var, / usr, / tmp and / dev without backup

My 1T hard every dump is probably more than one hour

cron preferably no one with time to execute, because the dump when the system response is very slow, almost unusable.

Second, restore the hard disk failure

1, connected to the new hard disk, and unplug the original system disk and the backup disk hard line

2, U disk boot, use sysinstall tool new hard disk partition formatting, partitioning, and the original system disk consistency

3, connect the backup disk hard line, reboot U disk, enter Fixit mode

mkdir / mnt / bkdisk # used to mount the backup disk

mkdir / mnt / bkdisk / tmp

export TMP_DIR = / mnt / bidisk / tmp #restore need a large / tmp directory

mkdir / mnt / newdisk # used to mount the new hard disk slice


mount / dev / adxs1x / mnt / bkdisk #mount backup disk

mount / dev / ad4s1a / mnt / newdisk #mount new hard disk root partition

cd / mnt / newdisk

restore -rf /mnt/bkdisk/ad4s1a_root.dump #restore root partition

cd / mnt

umount / mnt / newdisk

In the same manner restore another partition

4, modify the / etc / fstab, confirm the hard disk number corresponding to the new hard disk

5, reboot the system with a new hard disk boot

Explanation:

1, the situation has been the original system disk is available, you can directly use the dump and restore the original system disk mode data copied to a new hard drive, please refer to the specific information on the Internet, personal recommendations either way make a backup, or if the data lost can not be restored.

2, dump can use networked storage to store backup data

3, as long as the hardware is supported by FreeBSD, can be generally installed hard good system to hang correctly on any machine, simply edit / etc / fstab hard disk serial number, and the name of the network card in /etc/rc.conf

Attachment:

Dump and restore to do partition to partition the Duikao

The partition dump to standard output, let restore from standard input reduction can be achieved in the new partition to partition partition Duikao purpose, is carried out under Duikao process:
1. Cut your new partition
2. newfs the partition format is good
3. Insert the new partition mount good
4. Switch to the new partition in
5. dump & restore for backup and restore

- Step 1-2 may be carried out / stand / sysinstall, and then select Configure and use inside the Fdisk and Format Label segmentation

For example: If you want all the data / home (/ dev / ad0s1h) on the backup to partition (/ dev / ad2s1h) on the new hard drive, run:


# Newfs / dev / ad2s1h (If you have already formatted can be omitted)
 # Mount / dev / ad2s1h / mnt (if you have a good mount can be omitted)
 # Cd / mnt
 # Dump -0uaf - / home | restore -rf -
 # Cd /
 # Umount / mnt

Special attention dump and restore does not specify a file name, and all with a minus sign (-), to dump, is to partition a block of data is sent to the standard output of a block, and the restore is read from the standard input in and restore.
     
         
         
         
  More:      
 
- Based on Python: OpenCV simple image manipulation (Programming)
- dd command: do hard disk IO performance test (Linux)
- Android timer use (Programming)
- RedHat install GCC problem --- Depends (Linux)
- Large site architecture study notes (Server)
- ORA-04031 Error Resolution (Database)
- Compression software on a simple comparison of zip and gz (Linux)
- Kubernetes Cluster Setup problems encountered and solutions (Server)
- Android Studio interface-related settings (Linux)
- Ubuntu font settings: Using Windows Font (Linux)
- To install Ganglia configuration of experience under CentOS 5.5 (Linux)
- LinSSID: a graphical Wi-Fi scanner under Linux (Linux)
- RedHat Linux 6 desktop installation (Linux)
- Network traffic monitoring ntopng (Linux)
- Linux set to select the appropriate level of security of the network according to deployment (Linux)
- Java Concurrency -volatile keywords (Programming)
- Docker ecosystem security is gradually maturing (Server)
- Oracle EBS R12 for Linux installation (Database)
- To install and deploy Apache under the CentOS (Server)
- sqlplus connect to Oracle (Database)
     
           
     
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.