In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly explains "how to back up the parts encrypted by LUKS on Linux". The content in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "how to back up the parts encrypted by LUKS on Linux".
One solution: Bdsync
At this point, an excellent open source tool came to save us, called Bdsync (thanks to Rolf Fokkens). As the name implies, Bdsync can synchronize "block devices" over the network. For fast synchronization, Bdsync generates and compares the MD5 checksum of the blocks of the local / remote block device, synchronizing only the differences. What rsync can do at the file system level and Bdsync can be done at the block device level. Naturally, it also works well for LUKS-encrypted devices. Quite dexterous!
With Bdsync, the first backup copies the entire LUKS block device to the remote host, which takes a lot of time to complete. However, after the initial backup, if we create some new files on the LUKS device, the backup will be completed quickly because we only need to copy the modified blocks. The classic incremental backup is working!
Install Bdsync to Linux
Bdsync is not included in the standard repository of the Linux distribution, so you need to build it from the source code. Use the following version-specific instructions to install Bdsync and its man pages to your system.
Debian,Ubuntu or Linux Mint
The code is as follows:
$sudo apt-get install git gcc libssl-dev
$git clone https://github.com/TargetHolding/bdsync.git
$cd bdsync
$make
$sudo cp bdsync / usr/local/sbin
$sudo mkdir-p / usr/local/man/man1
$sudo sh-c 'gzip-c bdsync.1 > / usr/local/man/man1/bdsync.1.gz'
Fedora or CentOS/RHEL
The code is as follows:
$sudo yum install git gcc openssl-devel
$git clone https://github.com/TargetHolding/bdsync.git
$cd bdsync
$make
$sudo cp bdsync / usr/local/sbin
$sudo mkdir-p / usr/local/man/man1
$sudo sh-c 'gzip-c bdsync.1 > / usr/local/man/man1/bdsync.1.gz'
Implement off-site incremental backup of LUKS encrypted Devic
I assume that you have prepared a LUKS encrypted block device as the backup source (e.g., / dev/LOCDEV). At the same time, I assume that you also have a remote host that serves as a backup point for the source device (e.g., / dev/REMDEV).
You need to have root account access on both systems and set up password-free SSH access from local access remote. Finally, you need to install Bdsync on both hosts.
To initialize a remote backup process on the local host, we need to execute the following command as root:
The code is as follows:
# bdsync "ssh root@remote_host bdsync-- server" / dev/LOCDEV / dev/REMDEV | gzip > / some_local_path/DEV.bdsync.gz
Some instructions are needed here. The Bdsync client opens a SSH connection to the remote host as root and executes the Bdsync client with the-- server option. To be clear, / dev/LOCDEV is the source LUKS block device on our local host, and / dev/REMDEV is the target block device on the remote host. They can be / dev/sda (as an entire disk) or / dev/sda2 (as a single partition). The output from the local Bdsync client is then piped to gzip to create a DEV.bdsync.gz (so-called binary patch file) on the local host.
The first time you run the above command, it will take a long time, depending on your Internet / LAN speed and / dev/LOCDEV size. Remember, you must have two block devices of the same size (/ dev/LOCDEV and / dev/REMDEV).
The next step is to copy the patch file from the local host to the remote host. One way is to use scp:
The code is as follows:
# scp / some_local_path/DEV.bdsync.gz root@remote_host:/remote_path
The final step is to execute the following command on the remote host, which applies the patch file to / dev/REMDEV:
The code is as follows:
# gzip-d < / remote_path/DEV.bdsync.gz | bdsync-- patch=/dev/DSTDEV
I recommend using some small partitions (without any important data) to do these tests before deploying Bdsync with real data. After you fully understand how the entire setup works, you can start backing up real data.
Thank you for your reading, the above is the content of "how to back up the parts encrypted by LUKS on Linux". After the study of this article, I believe you have a deeper understanding of how to back up the parts encrypted by LUKS on Linux, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.