btrfs
RAID issues.btrfs
?btrfs
is a modern Linux file system that offers RAID support without additional third party software tools or RAID cards. Whilst not as fast as hardware RAID, btrfs
file systems are reliable and easy manage. Remote management is also easy. StitchIt has been tested on platter btrfs
RAID 1+0. IO heavy functions read and write in parallel to leverage the advantages of the file system.df -Th
to list disk usage and also file system type.btrfs
mean for me?btrfs
on Ubuntu 16.04:mkfs.btrfs -L data /dev/<drive1> /dev/<drive2>
... (where <drive1>
, <drive2>
etc. stands for the full drives used in the RAID pool) make a RAID0 volume not a redundant RAID1 or RAID10. use mkfs.btrfs -L data -d raid1 /dev/<drive1> /dev/<drive2>
... to get RAID1 for data at creation time. Use -m raid1
to get RAID1 for metadata too (seems to be the default actually).btrfs filesystem usage /mnt/data
gives a nice summary.btrfs balance start -dconvert=raid1 -mconvert=raid1 /mnt/data
(here to convert data and metadata to RAID1). No need to unmount /mnt/data
. It can take quite some time, so running the command in a tmux
session or in background is in general a good idea.dmesg
:/dev/sda
) as follows:sudo btrfs scrub start <mount point>
and wait a long time (e.g. 7H for 4x4 TB drives).sudo btrfs scrub status <mount point>
to see the number of unrecoverable errorsdmesg | grep BTRFS | grep path
smartctl
(installed via sudo apt install smartmontools
):sudo smartctl -t short <dev path>
or sudo smartctl -t long <dev path>
to start short or long test, in the backgroundsudo smartctl -a <dev path>
or sudo smartctl -x <dev path>
to get short or long report about drive and test outcomessmartctl --all /dev/sdc | grep Power_On_Hours
) then you should likely change the disk. Ideally you want your PC to have an empty hot-swap SATA bay. Into this you can plug the new drive without powering down. Then:sudo wipefs -a <dev path of new drive>
(CAREFUL!) sudo btrfs replace start <ID> <dev new> <mount point> where <ID>
is the btrfs number for the device to replace (can be obtained using sudo btrfs device usage <mount point>
for example)btrfs
device delete to remove the problematic drive! btrfs
will try to re-duplicate data elsewhere, it will take ages and may not succeed depending on the actual remaining space, and this is not interruptible.sudo btrfs balance start <mount point>
(use -dusage option, to avoid a full balancing that can take a very long time) and use sudo btrfs balance status <mount point>
to monitor it.