1

I want to set up a notebook (debian) with 1 SSD and 1 HDD each with Luks and Btrfs on it. Because the SSD and the HDD doesn't have the same speed, i don't want to use Btrfs' Raid-1 on it, but i also don't want to miss Btrfs' checksumming and autocorrection.

Now i am thinking about to use the HDD only for storing snapshots from the SSD. In the meantime i've found this https://superuser.com/a/1099181 , the script create the first time an initial read-only snapshot on the source drive (SSD) and later with example cron, an daily incremental snapshot with btrfs send -p and btrfs receive.

My questions now: If the SSD get some troubles for example bitrot errors, will and how will i know that this happens? I dont think that Btrfs on the SSD will automatically correct this errors the next time when i make an snapshot and use btrfs send -p with btrfs receive, because it is simply no Raid-1, am I right?

Btw, snaps on the same notebook but different drive aren't my (full) backup strategy.

  • do your btrfs filesystems have any redundancy (i.e. more than one disk in at least a raid-1 like configuration)? if not then btrfs can not correct errors, it can only detect them, because there isn't a redundant copy to correct them from. – cas Aug 13 '17 at 6:50
  • add a second SSD to match your first SSD, and a second HDD to match the HDD. THEN you'll have redundancy on both the original and the backups fs. – cas Aug 13 '17 at 6:51
  • I've clarified my question. If it's not possible to get an Raid-1 nearly function with Btrfs on this setup, i will buy an second SSD to use the 2 SSD with Btrfs Raid-1. – X. Y. Aug 13 '17 at 20:57
  • zfs has a copies= dataset parameter which can provide redundancy with only one drive (obviously, that can only protect against bad blocks, but not complete drive failure), but btrfs doesn't. So redundancy on btrfs requires at least two drives per filesystem. – cas Aug 14 '17 at 0:05
1

You can enable mirroring / raid1 for the metadata only on the SSD. This would require manual error corrections (from a backup) though.

  1. Split a single drive into two equal partitions
  2. Create a BTRFS array with mirrored metadata and striped data. For example,

    mkfs.btrfs -d raid0 -m raid1 /dev/partition1 /dev/partition2

If files are corrupted, a btrfs scrub should detect them. Then you can restore the hopefully intact file from your backup. In this case, you'd want to complete a scrub before overwriting previous backups, or use versioning, or both.

Ideally, you'll automate the btrfs scrubbing and error reporting. I believe there are some btrfs maintenance scripts but I haven't tested them.

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.