Skip to main content
Tweeted twitter.com/#!/StackUnix/status/640623552853614592
uppercase abbreviation
Link
maxschlepzig
  • 59.7k
  • 53
  • 224
  • 298

How to replace a device in BTRFS raidRAID-1 filesystem?

add another source for the limit
Source Link
maxschlepzig
  • 59.7k
  • 53
  • 224
  • 298

I have a BTRFS RAID-1 filesystem with 2 legs. One disk needs to be replaced because of re-occuring read errors.

Thus, the plan is:

  1. add a 3rd leg -> result should be: 3 way mirror
  2. remove the faulty disk -> result should be: 2 way mirror

Thus, I did following steps:

btrfs dev add /dev/new_device /mnt/foo btrfs balance /mnt/foo 

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?

I am a bit concerned because a btrfs fi show prints this:

Before balance start:

 Total devices 3 FS bytes used 2.15TiB devid 1 size 2.73TiB used 2.16TiB path /dev/left devid 2 size 2.73TiB used 2.16TiB path /dev/right devid 3 size 2.73TiB used 0.00B path /dev/new_device 

During balancing:

 Total devices 3 FS bytes used 2.15TiB devid 1 size 2.73TiB used 1.93TiB path /dev/left devid 2 size 2.73TiB used 1.93TiB path /dev/right devid 3 size 2.73TiB used 458.03GiB path /dev/new_device 

I mean, this looks like btrfs balances one half of the existing RAID-1 group to a single disk ... right?

Thus, my question, do I need to specify a balance filter to get a 3-way mirror?

PS: Does btrfs even support n-way mirrors? A note in the btrfs wiki says that it does not - but perhaps it is outdated? Oh boy, cks has a pretty recent article on the 2-way limit.

I have a BTRFS RAID-1 filesystem with 2 legs. One disk needs to be replaced because of re-occuring read errors.

Thus, the plan is:

  1. add a 3rd leg -> result should be: 3 way mirror
  2. remove the faulty disk -> result should be: 2 way mirror

Thus, I did following steps:

btrfs dev add /dev/new_device /mnt/foo btrfs balance /mnt/foo 

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?

I am a bit concerned because a btrfs fi show prints this:

Before balance start:

 Total devices 3 FS bytes used 2.15TiB devid 1 size 2.73TiB used 2.16TiB path /dev/left devid 2 size 2.73TiB used 2.16TiB path /dev/right devid 3 size 2.73TiB used 0.00B path /dev/new_device 

During balancing:

 Total devices 3 FS bytes used 2.15TiB devid 1 size 2.73TiB used 1.93TiB path /dev/left devid 2 size 2.73TiB used 1.93TiB path /dev/right devid 3 size 2.73TiB used 458.03GiB path /dev/new_device 

I mean, this looks like btrfs balances one half of the existing RAID-1 group to a single disk ... right?

Thus, my question, do I need to specify a balance filter to get a 3-way mirror?

PS: Does btrfs even support n-way mirrors? A note in the btrfs wiki says that it does not - but perhaps it is outdated?

I have a BTRFS RAID-1 filesystem with 2 legs. One disk needs to be replaced because of re-occuring read errors.

Thus, the plan is:

  1. add a 3rd leg -> result should be: 3 way mirror
  2. remove the faulty disk -> result should be: 2 way mirror

Thus, I did following steps:

btrfs dev add /dev/new_device /mnt/foo btrfs balance /mnt/foo 

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?

I am a bit concerned because a btrfs fi show prints this:

Before balance start:

 Total devices 3 FS bytes used 2.15TiB devid 1 size 2.73TiB used 2.16TiB path /dev/left devid 2 size 2.73TiB used 2.16TiB path /dev/right devid 3 size 2.73TiB used 0.00B path /dev/new_device 

During balancing:

 Total devices 3 FS bytes used 2.15TiB devid 1 size 2.73TiB used 1.93TiB path /dev/left devid 2 size 2.73TiB used 1.93TiB path /dev/right devid 3 size 2.73TiB used 458.03GiB path /dev/new_device 

I mean, this looks like btrfs balances one half of the existing RAID-1 group to a single disk ... right?

Thus, my question, do I need to specify a balance filter to get a 3-way mirror?

PS: Does btrfs even support n-way mirrors? A note in the btrfs wiki says that it does not - but perhaps it is outdated? Oh boy, cks has a pretty recent article on the 2-way limit.

Source Link
maxschlepzig
  • 59.7k
  • 53
  • 224
  • 298

How to replace a device in BTRFS raid-1 filesystem?

I have a BTRFS RAID-1 filesystem with 2 legs. One disk needs to be replaced because of re-occuring read errors.

Thus, the plan is:

  1. add a 3rd leg -> result should be: 3 way mirror
  2. remove the faulty disk -> result should be: 2 way mirror

Thus, I did following steps:

btrfs dev add /dev/new_device /mnt/foo btrfs balance /mnt/foo 

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?

I am a bit concerned because a btrfs fi show prints this:

Before balance start:

 Total devices 3 FS bytes used 2.15TiB devid 1 size 2.73TiB used 2.16TiB path /dev/left devid 2 size 2.73TiB used 2.16TiB path /dev/right devid 3 size 2.73TiB used 0.00B path /dev/new_device 

During balancing:

 Total devices 3 FS bytes used 2.15TiB devid 1 size 2.73TiB used 1.93TiB path /dev/left devid 2 size 2.73TiB used 1.93TiB path /dev/right devid 3 size 2.73TiB used 458.03GiB path /dev/new_device 

I mean, this looks like btrfs balances one half of the existing RAID-1 group to a single disk ... right?

Thus, my question, do I need to specify a balance filter to get a 3-way mirror?

PS: Does btrfs even support n-way mirrors? A note in the btrfs wiki says that it does not - but perhaps it is outdated?