Home PC Games Linux Windows Database Network Programming Server Mobile  
  Home \ Linux \ How LUKS encrypted disk / partition to perform remote incremental backup     - The Java Properties class action (Programming)

- Free compiler install MySQL-5.6.14 (Database)

- struts2 completely the wrong way to capture 404 (Programming)

- Linux excellent text editor (Markdown, LaTeX, MathJax) (Linux)

- Convert MySQL date string to a NULL value exception handling (Database)

- Oracle 11g em start newspaper site's security certificate has a solution to the problem (Database)

- OpenGL Superb Learning Notes - Vertex Shader example (Programming)

- To configure Samba to share files with Windows under CentOS (Linux)

- Linux Change ssh port and disable remote root login at (Linux)

- 30 Practical Linux system administrators will learn the command (Linux)

- Linux command in the dialog whiptail (Linux)

- Internet proxy workaround can not be used under Linux YUM (Linux)

- Elaborate .NET Multithreading: Thread Pool (Programming)

- Use Git in Eclipse (Linux)

- Role Object of registerNatives () method (Programming)

- To upgrade combat MongoDB database replication sets and split versions (Database)

- C ++ 11 feature: auto keyword (Programming)

- Ubuntu installed racing game Speed Dreams 2.1 (Linux)

- Apache site default home page settings (Server)

- GoldenGate update is missing (Database)

  How LUKS encrypted disk / partition to perform remote incremental backup
  Add Date : 2018-11-21      
  For security reasons, some of us with the Linux Unified Key Setup (LUKS) for the home or virtual hard disk dedicated server (VPS) on encrypted; these hard drive capacity will soon increase to tens or GB hundreds of GB. So, we enjoy security LUKS devices at the same time, you might start thinking a viable remote backup solution. To secure offsite backup, we need solutions in the data block level encrypted LUKS device operation, rather than in an unencrypted file system level operations. So in the end, we find ourselves in such a situation: Whenever we want to back up, which is necessary to transmit the whole LUKS device data (for example, assume 200GB). This is clearly not feasible. So, how do we deal with this problem?

The solution Road: Bdsync

Excellent open source tools at this time, a named Bdysnc (thanks to Rolf Fokkens) would be able to come in handy. As the name suggests, Bdsync can be synchronized "block device" through the network. On the fast synchronization purposes, Bdsync can generate and compare MD5 checksum in the local / remote block device, only data synchronization differences. Rsync can complete the task in the file system level, rather Bdsync can complete the task at block device level. It can also be run with natural encrypted LUKS device interaction. Really nice!

Use Bdsync, the first backup will copy the entire block devices LUKS inside data to a remote host, it takes a long time to complete. However, after this initial backup is complete, if we build some new files on LUKS device, the second time the backup will be done quickly, because we only need to copy the changed data blocks. This time the classic incremental backup played a role!

To install Linux on the Bdsync

Bdsync not included in the Linux distribution version of the standard software repository. Thus, you need to build it from source. Use the following instructions for a particular release, and will Bdsync reference manual pages installed on your system.

On Debian, Ubuntu or Linux Mint

$ 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'
On Fedora or CentOS / RHEL

$ 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'
For LUKS encrypted device to perform incremental backups offsite

I assume you've LUKS encrypted block device configured to backup sources (such as / dev / LOCDEV), also assumes that you have a remote host, the content source device will be backed up (for example, / dev / REMDEV) on the host.

You need access to the root account on both systems, and set up SSH access without a password in order to access a remote host from the local host. Finally, you also need to Bdsync installed on two hosts.

Want to start on the local host for remote backup process, we execute the following command as root account:

# Bdsync "ssh root @ remote_host bdsync --server" / dev / LOCDEV / dev / REMDEV | gzip> /some_local_path/DEV.bdsync.gz

It should be some explanation. Bdsync client will root identity with a remote host account to establish a SSH connection and using --server option to perform Bdsync client software. Explain, / dev / LOCDEV is the source on the local host LUKS block device, and / dev / REMDEV target is a block device on a remote host. They should be / dev / sda (for the entire disk) or / dev / sda2 (for a partition). The output of local Bdsync client then outputs to gzip, gzip local host Construction DEV.bdsync.gz (so-called binary patch file).

After the first time you run the above command, it takes a very long time, depending on your Internet / Ethernet speed and / dev / LOCDEV size. Remember: your two block device (/ dev / LOCDEV and / dev / REMDEV) must be the same size.

The next step is to generate patch files copied from the local host to the remote host. One way is to use scp:

# Scp /some_local_path/DEV.bdsync.gz root @ remote_host: / remote_path

The last step is, execute the following command on a remote host, it will patch file to / dev / REMDEV:

# Gzip -d
I recommend that you use does not contain any important data partitions do some small tests, then use Bdsync to handle the actual data. Only you fully understand the whole process before they can begin the actual backup data.


In conclusion, we describe how to use Bdsync LUKS to perform an incremental backup device. And rsync, as each time a backup, just to a small part of the data, not the entire data LUKS device copied to remote backup site, which saves bandwidth and backup time. Rest assured, all data protected by SSH or SCP, another device itself is encrypted by LUKS. It is also possible to improve this program: You can run bdsync using special user (not root). We can also bdsync for any block device, such as LVM or RAID disk, the other is still very easy to set Bdsync, so that the local disk backup to a USB drive. As you can see, its application prospect is unlimited!
- sudo command scenario analysis (Linux)
- Storm how to assign tasks and load balancing (Programming)
- Linux how to prohibit the use of Ping command (Linux)
- Android official recommendation: DialogFragment create dialog (Programming)
- The difference between free command displays the buffers and cache (Linux)
- C language programming entry - macro definitions and enum (Programming)
- Linux run queue process scheduling (Programming)
- MySQL to manage multiple instances of method (Database)
- To solve the Mac in question invalid BASH under configuration environment variable (Linux)
- C ++ implementation of the list of basic operations and test cases (Programming)
- Using FTPClient to upload and download files in Java (Programming)
- Four Methods of Self - Learning Linux (Linux)
- RHEL7 unattended automatic installation DHCP + TFTP + SYSLINUX + TFTP + Kickstart (Linux)
- C ++ stderr / stdout redirected to a file (Programming)
- open V switch port mirror in OpenStack neutron (Server)
- Linux file compression and file system packaged with instructions (Linux)
- How to find the available network adapter on Ubuntu (Linux)
- Thinking in Java study notes - initialization and cleanup (Programming)
- How to adjust the system time CentOS (Linux)
- and localhost difference (Server)
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.