Fastest Way to Duplicate BTRFS RAID1 Drives (99% Full, 4TB to 12TB)
In this article, we will discuss the fastest way to duplicate BTRFS RAID1 drives, specifically when dealing with a 99% full 4TB RAID1 array and a new 12TB RAID1 array. By following the steps outlined below, you will ensure a smooth and efficient duplication process.
What is BTRFS and RAID1?
BTRFS (B-tree file system) is a modern copy-on-write file system for Linux, aimed at implementing advanced features while focusing on fault tolerance, repair, and easy administration. RAID1 is a redundancy scheme that uses disk mirroring to provide data redundancy.
Preparing for Duplication
Before starting the duplication process, ensure that both the source and destination arrays are in a good state and properly mounted. You can check the status of the arrays using the following command:
sudo btrfs filesystem showDuplicating Data
The fastest way to duplicate data from the source (4TB) to the destination (12TB) array is by using the dd command in combination with the pv (Pipe Viewer) utility for real-time progress monitoring. First, identify the source and destination devices:
lsblkAssuming the source device is /dev/sda1 and the destination device is /dev/sdb1, use the following command to start the duplication process:
sudo dd if=/dev/sda1 bs=64K | pv | sudo dd of=/dev/sdb1 bs=64KThis command will copy the data from the source device to the destination device at a maximum speed supported by your hardware. The pv utility provides a real-time progress bar and estimated time of completion.
Expanding the Filesystem on the Destination Array
Once the duplication process is complete, you will need to expand the filesystem on the destination array to use the entire 12TB of available space. First, identify the device UUIDs:
sudo blkidTake note of the UUIDs for both devices. Next, unmount both arrays:
sudo umount /mnt/sourcesudo umount /mnt/destinationNow, resize the filesystem on the destination array using the btrfs filesystem resize command:
sudo btrfs filesystem resize max /dev/disk/by-uuid/Finally, remount both arrays:
sudo mount -t btrfs /dev/disk/by-uuid/ /mnt/source sudo mount -t btrfs /dev/disk/by-uuid/ /mnt/destination - Check the status of the arrays using
sudo btrfs filesystem show. - Duplicate data using the
ddandpvcommands. - Expand the filesystem on the destination array using the
btrfs filesystem resizecommand.