How to check the status of Btrfs replace?

How to check the status of Btrfs replace?

The btrfs replace command is executed in the background – you can check its status via the status subcommand, e.g.: Alternatively, one can also add a device to raid-1 filesytem and then delete an existing leg: The add should return fast, since it justs adds the device (issue a btrfs fi show to confirm).

Why does one disk need to be replaced in Btrfs?

I have a BTRFS RAID-1 filesystem with 2 legs. One disk needs to be replaced because of re-occuring read errors. I assume that btrfs does the right thing, i.e. create a 3 way mirror. The alternative would be to use a balance filter, I guess. But since the filesystem already is a RAID-1 one, that shouldn’t be necessary?

What does Btrfs device delete missing mean in raid XX?

btrfs device delete missing tells btrfs to remove the first device that is described by the filesystem metadata but not present when the FS was mounted. In case of RAID XX layout, you cannot go below the minimum number of the device required. So before removing a device (even the missing one) you may need to add a new one.

When does Btrfs need to be mounted in degraded mode?

But, if a device is missing or the super block has been corrupted, the filesystem will need to be mounted in degraded mode: btrfs device delete missing tells btrfs to remove the first device that is described by the filesystem metadata but not present when the FS was mounted.

What happens when I delete a device from Btrfs?

The add should return fast, since it justs adds the device (issue a btrfs fi show to confirm). The following delete should trigger a balancing between the remaining devices such that each extend is available on each remaining device.

How to grow the Btrfs filesystem in Linux?

Use the btrfs device delete command to remove an online device. It will redistribute any extents in use to other devices in the file system in order to be safely removed. That’s all we needed to do to grow BtrFS filesystem. This was confirmed from the output shown below: You can also resize directly by specifying the intended size, the syntax is:

When to use both legs of Btrfs replace?

Reading between the lines of the btrfs-replace man page, this command should be able to use both existing legs – e.g. for situations where both legs have read errors – but both error sets are disjoint. The btrfs replace command is executed in the background – you can check its status via the status subcommand, e.g.: