Linux backup data learning record

1. Insert the rescue CD (the system has been recorded: systemrescuecd-x86-4.7.2.iso)
2. Reboot (reboot)
3. Press F11 and select the CD to start, select the chache mode to enter the system
4. Insert the backup hard disk (hot-swap device) )
5. Enter the command: partprobe to refresh the device
6. Use the command: fdisk -l to check whether the device (hard disk) is successfully inserted (you will see the device: /dev/sdc after success), generally the last one is the device that was just inserted, As shown in the figure:

7. Check whether the directory exists in the root directory. If it does not exist, create a directory: mkdir /bak
8. Mount the device (hard disk) to the directory (/bak), and the mount command is: mount /dev/ sdc /bak
9. You can enter the command to check whether there is data in the previous device (hard disk): ls /bak
10. To back up the data of the partition /dev/sda1 under the device /dev/sda, execute the following command:
1) In the root Create a directory in the directory: mkdir /raid
2) Mount the partition /dev/sda1 under the device /dev/sda to the directory (/raid) just created: mount /dev/sda1 /raid
3) In the directory (/bak, the The directory is to create a backup data directory under the newly inserted device (hard disk): mkdir /bak/bak_sda1, used to store backup data
4) Copy data: cp -ar /raid/* /bak/bak_sda1
5) Unbind after copying Fixed: umount /raid

6) Next, repeat steps 2-5 to copy partition data under other devices!


PS:
When the device is mounted, the following red box appears, you can ignore it to continue!

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326773863&siteId=291194637