Home  >  Article  >  System Tutorial  >  Linux system backup, save time and protect data

Linux system backup, save time and protect data

WBOY
WBOYforward
2024-02-10 13:00:47881browse

In the process of daily use of computers, we will inevitably encounter various unexpected situations, such as virus attacks, hard disk damage, etc. When encountering these situations, what we are most worried about is the loss of our data, because this data may be an indispensable part of our work and life. Therefore, it is particularly important to back up data when using a computer. In Linux systems, it is also necessary to back up the entire system. Making a system image can help us quickly restore the entire system, which is a very convenient and efficient way to protect our data.

The Apache Web service has been set up on RHEL 7.3. Now I want to upload the RHEL 8.1 system image to the Apache Web root directory. However, because the size of the RHEL 8.1 system image is 7.31 GB, which is already more than 4 GB, it cannot be uploaded through rz. The solution is to mount the RHEL 8.1 system image to the RHEL 7.3 system, create a new system image, and then move the new system image to the system image directory in the Apache Web root directory. You can also go to the Apache Web root directory first. Then create a new system image in the system image directory, so that you can save the step of moving the new system image.

Linux system backup, save time and protect data

environment

Red Hat Enterprise Linux Server release 7.3
VMware Workstation Pro 14

Add image

Linux system backup, save time and protect data
[root@Jaking ~]# ifconfig
ens32: flags=4163  mtu 1500
        inet 192.168.10.10  netmask 255.255.255.0  broadcast 192.168.10.255
        inet6 fe80::20c:29ff:fe84:eae5  prefixlen 64  scopeid 0x20
        ether 00:0c:29:84:ea:e5  txqueuelen 1000  (Ethernet)
        RX packets 636  bytes 53068 (51.8 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 508  bytes 85327 (83.3 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10
        loop  txqueuelen 1  (Local Loopback)
        RX packets 4  bytes 340 (340.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 4  bytes 340 (340.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

virbr0: flags=4099  mtu 1500
        inet 192.168.122.1  netmask 255.255.255.0  broadcast 192.168.122.255
        ether 52:54:00:25:a2:80  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

[root@Jaking ~]# df -h      
Filesystem             Size  Used Avail Use% Mounted on
/dev/mapper/rhel-root   48G  4.9G   41G  11% /
devtmpfs               478M     0  478M   0% /dev
tmpfs                  489M     0  489M   0% /dev/shm
tmpfs                  489M  6.7M  482M   2% /run
tmpfs                  489M     0  489M   0% /sys/fs/cgroup
/dev/sr0               3.6G  3.6G     0 100% /media/cdrom
/dev/sdd                40G   27G   14G  67% /download
/dev/sda2             1014M  145M  870M  15% /boot
/dev/mapper/rhel-data   10G   33M   10G   1% /data
tmpfs                   98M     0   98M   0% /run/user/0
[root@Jaking ~]# ls /dev/sr*
/dev/sr0  /dev/sr1
#/dev/sr1为新添加的镜像

Create a new system image

Switch to the system image directory in the Apache Web root directory

[root@Jaking ~]# cd /download/系统镜像/
[root@Jaking 系统镜像]# ls
CentOS-7.6-x86_64-DVD-1810.iso  rhel-server-7.3-x86_64-dvd.iso    Windows 7 x64.iso
LaoMaoTao.iso                   ubuntu-18.04.1-desktop-amd64.iso  Windows Sever 2008.iso
rhel-server-6.5-x86_64-dvd.iso  Windows 2003 SP2.iso
[root@Jaking 系统镜像]# dd if=/dev/sr1 of=RHEL-8.1.iso
15335424+0 records in
15335424+0 records out
7851737088 bytes (7.9 GB) copied, 174.329 s, 45.0 MB/s

View the new system image through the web interface

http://192.168.10.10/systemimage/

Linux system backup, save time and protect data

Download image

Linux system backup, save time and protect data

Use watch ifstat to view network card traffic in real time

Linux system backup, save time and protect data

Whether it is at work or in daily life, data backup is very important to us. In a Linux system, making a system image is a necessary task. By making system images, we can save a lot of time in reinstalling the system and configuring the environment, and at the same time, we can ensure that our precious data will not be lost due to any accidents. In this article, we introduce in detail how to make a Linux system image by using the dd command and the partclone tool. I believe that through the introduction of this article, you have learned how to create a system image and restore the system in a Linux system, which provides a more reliable solution for your data protection.

The above is the detailed content of Linux system backup, save time and protect data. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:lxlinux.net. If there is any infringement, please contact admin@php.cn delete