On Fri, May 01, 2020 at 01:05:20AM -0700, Phil Karn wrote: > On 4/30/20 11:13, Jean-Denis Girard wrote: > > > > Hi Phil, > > > > I did something similar one month ago. It took less than 4 hours for > > 1.71 TiB of data: > > > > [xxx@taina ~]$ sudo btrfs replace status /home/SysNux > > Started on 21.Mar 11:13:20, finished on 21.Mar 15:06:33, 0 write errs, 0 > > uncorr. read errs > > I just realized you did a *replace* rather than a *remove*. When I did a > replace on another drive, it also went much faster. It must copy the > data from the old drive to the new one in larger and/or more contiguous > chunks. It's only the remove operation that's painfully slow. "Replace" is a modified form of scrub which assumes that you want to reconstruct an entire drive instead of verifying an existing one. It reads and writes all the blocks roughly in physical disk order, and doesn't need to update any metadata since it's not changing any of the data as it passes through. "Delete" is resize to 0 followed by remove the empty device. Resize requires relocating all data onto other disks--or other locations on the same disk--one extent at a time, and updating all of the reference pointers in the filesystem. The difference in speed can be several orders of magnitude. > Phil > >
