Gentoo Archives: gentoo-user

From: Rich Freeman <rich0@g.o>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] BTRFS problem? [WAS Quick check on net-print/hplip-3.14.10]
Date: Fri, 18 Sep 2015 18:30:59
Message-Id: CAGfcS_kx2txHRGdZWOGiCo31MTp__ULf3Pm+NyyuXLrOtwjBGw@mail.gmail.com
In Reply to: Re: [gentoo-user] BTRFS problem? [WAS Quick check on net-print/hplip-3.14.10] by Mick
1 On Fri, Sep 18, 2015 at 2:19 PM, Mick <michaelkintzios@×××××.com> wrote:
2 > On Friday 18 Sep 2015 19:15:50 Rich Freeman wrote:
3 >> On Fri, Sep 18, 2015 at 1:56 PM, Mick <michaelkintzios@×××××.com> wrote:
4 >> > On Friday 18 Sep 2015 17:16:54 Marc Joliet wrote:
5 >> >> On Friday 18 September 2015 10:31:01 Mick wrote:
6 >> >> >A couple of months ago the akonadi DB went sideways and kmail played up
7 >> >> >as a result. Again I was suspicious of btrfs, but neither the logs
8 >> >> >nor fsck showed up anything.
9 >> >>
10 >> >> I take it "btrfs scrub" didn't turn up anything, or is that what you
11 >> >> meant by fsck?
12 >> >
13 >> > Am I supposed to run scrub with I do not have a RAID running? I thought
14 >> > scrub was meant for comparing checksums between mirrored fs - have I got
15 >> > this wrong?
16 >>
17 >> You can actually run scrub on a non-raid btrfs setup. Btrfs will
18 >> report any errors that it detects (using the checksumming in the
19 >> filesystem), but it would not be able to fix errors unless you have it
20 >> storing redundant data somewhere (even on non-raid it still stores
21 >> redundant metadata by default, and you can choose to do this with data
22 >> as well which protects against block-level failures but not disk-level
23 >> failures, obviously).
24 >>
25 >> However, you'd have gotten the same errors in dmesg just trying to
26 >> read the files - btrfs checks the checksum on all file read
27 >> operations. That is a big part of the value of both btrfs and zfs.
28 >
29 > Ah! V interesting ... can I run scrub with mounted partitions, or do I have
30 > to do it from a LiveCD?
31
32 I didn't check, but I suspect you can only run scrub on a mounted
33 partition. I also suspect that fsck probably has an option to do
34 something equivalent offline.
35
36 You do get the error-detection anyway just by reading files, and if
37 you just ran find on your filesystem and catted every file you have to
38 /dev/null that would actually accomplish the same thing as long as
39 you're not in a redundant mode (simply reading all the files doesn't
40 guarantee that all copies of each file are checked).
41
42 The main reason for doing a scrub is to detect latent issues, and if
43 you have redundancy that means you can auto-correct them today, rather
44 than discovering them a month from now when the drive containing the
45 only good copy fails. Even if you don't have redundancy maybe you
46 rotate your backups every 30 days and detecting the error might mean
47 having the ability to go back and restore a good copy of the file
48 before it is completely replaced with bad copies.
49
50 --
51 Rich

Replies

Subject Author
Re: [gentoo-user] BTRFS problem? [WAS Quick check on net-print/hplip-3.14.10] Mick <michaelkintzios@×××××.com>