Gentoo Archives: gentoo-user

From: "J. Roeleveld" <joost@××××××××.org>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] BTRFS problem? [WAS Quick check on net-print/hplip-3.14.10]
Date: Sun, 20 Sep 2015 05:25:29
Message-Id: 5CFA80E5-AFD6-4815-9FBF-F4138E9053C8@antarean.org
In Reply to: Re: [gentoo-user] BTRFS problem? [WAS Quick check on net-print/hplip-3.14.10] by Mick
1 On 19 September 2015 22:24:19 CEST, Mick <michaelkintzios@×××××.com> wrote:
2 >On Saturday 19 Sep 2015 21:14:00 Stefan G. Weichinger wrote:
3 >> Am 2015-09-18 um 23:58 schrieb Mick:
4 >> >> The main reason for doing a scrub is to detect latent issues, and
5 >> >> if you have redundancy that means you can auto-correct them
6 >> >> today, rather than discovering them a month from now when the
7 >> >> drive containing the only good copy fails. Even if you don't
8 >> >> have redundancy maybe you rotate your backups every 30 days and
9 >> >> detecting the error might mean having the ability to go back and
10 >> >> restore a good copy of the file before it is completely replaced
11 >> >> with bad copies.
12 >> >
13 >> > Thank you Rich, I ran 'btrfs scrub start /" and it found zero
14 >> > problems. dmesg and syslog clean too.
15 >>
16 >> I wrote (= googled something and adapted it a bit) some
17 >> btrfs-scrub.service and .timer for doing that once a week (systemd
18 >> environment):
19 >>
20 >> $ cat btrfs-scrub.service
21 >> [Unit]
22 >> Description=Check volume for errors
23 >> Documentation=man:btrfs-scrub
24 >> After=fstrim.service
25 >>
26 >> [Service]
27 >> Type=oneshot
28 >> ExecStart=/bin/sh -c 'for i in $(grep btrfs /proc/mounts | cut -d" "
29 >> -f1 | sort -u | grep dev); do echo scrubbing $i; btrfs scrub start
30 >-Bd
31 >> $i; done'
32 >> IOSchedulingClass=idle
33 >> CPUSchedulingPolicy=idle
34 >>
35 >> $ cat btrfs-scrub.timer
36 >> [Unit]
37 >> Description=Check volume for errors once a week
38 >> Documentation=man:btrfs-scrub
39 >>
40 >> [Timer]
41 >> OnCalendar=weekly
42 >> AccuracySec=1h
43 >> Persistent=true
44 >>
45 >> [Install]
46 >> WantedBy=timers.target
47 >
48 >Thank you Stefan, I will probably look into doing the same for openrc.
49
50 Crontab (or one of its alternatives) would be your friend here. :)
51
52 --
53 Joost
54 --
55 Sent from my Android device with K-9 Mail. Please excuse my brevity.