btrfsis 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,
btrfsfile systems are reliable and easy manage. Remote management is also easy. StitchIt has been tested on platter
btrfsRAID 1+0. IO heavy functions read and write in parallel to leverage the advantages of the file system.
df -Thto list disk usage and also file system type.
btrfsmean for me?
btrfson Ubuntu 16.04:
mkfs.btrfs -L data /dev/<drive1> /dev/<drive2>... (where
<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 raid1to get RAID1 for metadata too (seems to be the default actually).
btrfs filesystem usage /mnt/datagives 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
tmuxsession or in background is in general a good idea.
/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 errors
dmesg | grep BTRFS | grep path
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 background
sudo smartctl -a <dev path>or sudo
smartctl -x <dev path>to get short or long report about drive and test outcomes
smartctl --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)
btrfsdevice delete to remove the problematic drive!
btrfswill 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.