• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • VCS
  • Interview Questions
  • Database
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

How to Replace a Failed Btrfs Device

by admin

The Problem

Originally the btrfs file system is build on multiple disks.

# btrfs filesystem show
Label: 'MYBTRFS' uuid: 09138ad8-eb2f-4c7c-aef7-90482a67c45c
Total devices 3 FS bytes used 768.00KiB
devid 1 size 5.00GiB used 1.52GiB path /dev/xvdb
devid 2 size 5.00GiB used 520.00MiB path /dev/xvdc
devid 3 size 5.00GiB used 1.51GiB path /dev/xvdd

For some reason one disk is faulty and needs to be replaced.

# btrfs filesystem show
Label: 'MYBTRFS' uuid: 09138ad8-eb2f-4c7c-aef7-90482a67c45c
Total devices 3 FS bytes used 768.00KiB
devid 1 size 5.00GiB used 1.52GiB path /dev/xvdb
devid 3 size 5.00GiB used 1.51GiB path /dev/xvdd
*** Some devices missing

The Solution

1. Mount the btrfs with “-o degraded” option from existing good volume:

# mount -o degraded /dev/xvdd /mnt/btrfs

2. Replace the absent disk with the missing one:

# btrfs replace start 2 /dev/xvdc /mnt/btrfs

3. Balance the file system:

# btrfs filesystem balance

If any error, please check the output of “dmesg”. You may also need to contact your support team if there are errors in dmesg.

Filed Under: Linux

Some more articles you might also be interested in …

  1. umask: command not found
  2. mate-search-tool Command Examples in Linux
  3. aspell Command Examples in Linux
  4. “git verify-tag” Command Examples
  5. duc Command Examples in Linux
  6. “git show-refs” Command Examples
  7. g++: Compiles C++ source files
  8. dunstify: command not found
  9. bmon: command not found
  10. po4a-gettextize Command Examples in Linux

You May Also Like

Primary Sidebar

Recent Posts

  • Vanilla OS 2 Released: A New Era for Linux Enthusiasts
  • mk Command Examples
  • mixxx Command Examples
  • mix Command Examples

© 2025 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright