Best ways to copy files between two block devices

There are several options on how to transfer data from one volume to another. In this article we will cover two that should cover most use cases.

Option 1: dd to create a 'carbon copy' of volume

triangle-exclamation

You can see the device path for each volume attached to instance in storage tab of selected instance

To create a carbon copy of input device and write it to other device/file simply run:

If we were intending to clone OS-viJ5Hd2x to Volume-2th9Aa6j (see the above picture), the command would be:

Option 2: rclone to copy folders and files between two mounted volumes

circle-info

See Attaching a block volume to know how to mount volume to system

circle-info

In this guide we will focus on copying to volumes that are mounted to system, therefore it will be considered local from rclone's point of view. You can also use

to configure remote storage device to use with rclone. See rclone docsarrow-up-right for more information.

First, install rclone, a powerful utility for copying files locally and from/to remote disks.

Then the command to copy the files would be:

Change SRC folder you want to copy, change DST to destination folder where files from SRC should go to and adapt the --exclude flags to what you want to exclude. In case you need maximum performance you can add some flags to the above command and adapt their values to your setup:

Read more about these options at rclone flagsarrow-up-right.

Last updated

Was this helpful?