4

One of the cool things about btrfs on linux is that it can correct bit rot if it has redundant data because of its per-block checksumming. I can get redundant data by setting up a raid1 with two disks. However, can I also get redundant data to prevent bit rot on a single disk?

I see that btrfs has a DUP option for metadata (-m dup) that stores two copies of the metadata on each drive. However, the documentation says that dup is not an option for data (i.e. -d dup is not an option). Is there a good way around this? Partition a single disk into two equal parts and raid1 them together?

Alternatively, is there another simple way to get file system level error detection and correction on linux (something like an automatic parchive for file systems)?

(I'm not interested in answers suggesting that I use two drives.)

EDIT: I did find this, which is a FUSE filesystem that mounts files with error correction as normal files. That said, it's a little hack/proof of concept the someone put together in 2009 and hasn't really touched since.

1

Btrfs supports duplicated data blocks if you enable mixed block groups:

mkfs.btrfs --mixed --metadata dup --data dup /dev/<device>

EDIT: Notice that there is a patch so that we can do this without using mixed mode. Following that thread of Nov. 2015, it appears it is being added to the mainline btrfs code.

  • --mixed is not recommended above 1GB filesystems. – Tom Hale Sep 17 at 16:04
0

What about partitioning the drive with, eg., LVM into, say, 10 partitions and raid-5-ifying them on the block level? Wouldn't this give around 10% of redundancy for error correction?

  • It would also give you bad performance. – RalfFriedl Aug 29 at 21:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.