Slow Backing Up to External 2TB exFAT Formatted HDD via USB using rsync in Ubuntu 22.04
Backing up data is an essential task for any computer user, and using an external hard drive (HDD) is a popular solution. However, when using an exFAT formatted HDD with Ubuntu 22.04, users may experience slow backup speeds, sometimes stuck at 20KB/s for several seconds. This article will explore the reasons for this issue and provide a solution using the rsync command.
Why is backing up to an exFAT formatted HDD slow?
exFAT is a file system designed for flash drives and memory cards, and it may not be optimized for use with external HDDs. Additionally, USB 3.0, which is commonly used to connect external HDDs, has a maximum theoretical transfer speed of 5Gbps, but in practice, the speed is often much lower. Other factors, such as the quality of the USB cable and the file system's fragmentation, can also contribute to slow backup speeds.
Using rsync to backup data to an exFAT formatted HDD
rsync is a powerful command-line tool for copying and synchronizing files and directories. It is available in Ubuntu 22.04 and can help improve backup speeds to an exFAT formatted HDD.
Installing rsync
rsync is already installed in Ubuntu 22.04 by default. If it is not installed, you can install it using the following command:
sudo apt-get install rsync
Using rsync to backup data
To backup data using rsync, you can use the following command:
rsync -avh /path/to/source/directory /path/to/destination/directory
Where:
-a: Archive mode, which preserves file permissions, ownership, and timestamps.-v: Verbose mode, which displays detailed information about the transfer process.-h: Human-readable mode, which displays file sizes in a human-readable format./path/to/source/directory: The path to the directory you want to backup./path/to/destination/directory: The path to the directory where you want to backup the data.
Improving backup speeds with rsync
To improve backup speeds with rsync, you can use the following options:
-W: Whole-file mode, which copies the entire file instead of using delta encoding. This can improve backup speeds for large files, but it will also increase the amount of data transferred.--compress: Compress data during transfer, which can improve backup speeds over a network or a slow connection.--exclude: Exclude specific files or directories from the backup process, which can reduce the amount of data transferred and improve backup speeds.
Slow backup speeds to an exFAT formatted HDD via USB in Ubuntu 22.04 can be caused by several factors, including the file system's optimization, USB cable quality, and file system fragmentation. Using rsync can help improve backup speeds by providing more control over the transfer process. By using options such as whole-file mode, compression, and exclusion, you can further optimize backup speeds to meet your needs.