btrfs scrub -d doesn't scan all devices
Hey.
I've just noted the following behaviour:
# btrfs scrub start -Bdr / scrub device /dev/sda2 (id 1) done scrub started at Sun Dec 27 01:59:05 2015 and finished after 00:04:04 total bytes scrubbed: 29.39GiB with 0 errors scrub device /dev/sdb2 (id 2) done scrub started at Sun Dec 27 01:59:05 2015 and finished after 00:04:08 total bytes scrubbed: 29.39GiB with 0 errors
=> that works as expected
However:
# btrfs scrub start -Bdr /dev/disk/by-label/system scrub device /dev/sdb2 (id 2) done
scrub started at Sun Dec 27 01:53:18 2015 and finished after 00:04:01 total bytes scrubbed: 29.37GiB with 0 errors
=> seems to scan only sdb2 (which is where /dev/disk/by-label/system points to)
at least, no output is given for sda2
Cheers,
Chris.
Christoph Anton Mitterer posted on Sun, 27 Dec 2015 04:38:56 +0100 as excerpted:
Quoted 17 lines
I've just noted the following behaviour:
# btrfs scrub start -Bdr / scrub device /dev/sda2 (id 1) done scrub started at Sun Dec 27 01:59:05 2015 and finished after 00:04:04 total bytes scrubbed: 29.39GiB with 0 errors scrub device /dev/sdb2 (id 2) done scrub started at Sun Dec 27 01:59:05 2015 and finished after 00:04:08 total bytes scrubbed: 29.39GiB with 0 errors=> that works as expected
However:
# btrfs scrub start -Bdr/dev/disk/by-label/systemscrub device/dev/sdb2(id 2) done
Quoted 6 lines
scrub started at Sun Dec 27 01:53:18 2015 and finished after 00:04:01 total bytes scrubbed: 29.37GiB with 0 errors=> seems to scan only sdb2 (which is where
/dev/disk/by-label/systempoints to) at least, no output is given for sda2
I'd call that NOTABUG. As the btrfs-scrub manpage suggests:
* When you point scrub at a mountpoint, it scrubs all devices composing that filesystem.
(The manpage specifically says "all devices of the filesystem identified by <path>". Emphasis on _ALL_DEVICES_ if given a normal path.)
* When you point scrub at a specific device, it scrubs that specific device.
(The manpage continues ... "or on a single <device>." Emphasis on _SINGLE_DEVICE_ if given a device node.)
Since /dev/disk/by-*/* are symlinks to various block-device nodes, it follows that if you point scrub at them, only the device pointed at is scrubbed, exactly as one might expect based on the manpage.
Signature · 3 lines
Duncan - List replies preferred. No HTML msgs. "Every nonfree program has a lord, a master -- and if you use the program, he is your master." Richard Stallman
Quoted 5 lines · Duncan
I'd call that NOTABUG. As the btrfs-scrub manpage suggests:
* When you point scrub at a mountpoint, it scrubs all devices composing
that filesystem.
Uhm,.. mine doesn't contain this,... neither do those of the master or devel branches from David's repo... or am I just blind?
Actually it says:
Quoted 3 lines
DESCRIPTION
btrfs scrub is used to scrub a btrfs filesystem, which will read all data from all disks and verify checksums.
Also, if it would allow to only selectively scrub parts of the fs (e.g. just some devices or subpaths/subvols/files) than the whole syntax for cancel, break, etc. would become ambiguous.
Quoted 5 lines
Since
/dev/disk/by-*/*are symlinks to various block-device nodes, it
follows that if you point scrub at them, only the device pointed at is
scrubbed, exactly as one might expect based on the manpage.
Sure... that was clear... but I have another manpage than yours... perhaps some distro specific patch?
Chris.
Hey.
Just noted, mine says this:
Quoted 3 lines
Start a scrub on all devices of the filesystem identified by <path> or on a single <device>. If a scrub is already running, the new one fails.
still not the text you quoted,... but there it is.
Anyway... it still contradicts the main description which implies that a scrub always scrubs everything,... so I'd still call that a documentation bug.
Further,...
- Eithr btrfs start allows multiple devices to be specified (which isn't documented either,
- or it should allow that.
- or using -d makes no sense when the scrub is launched on a device (instead of a mount point) and should thus fail or give at least a warning.
Cheers,
Chris.
Quoted 13 lines · Christoph Anton Mitterer
Hey.
Just noted, mine says this:
Quoted 3 lines
Start a scrub on all devices of the filesystem identified by <path> or on a single <device>. If a scrub is already running, the new one fails.
still not the text you quoted,... but there it is.
Anyway... it still contradicts the main description which implies that a scrub always scrubs everything,... so I'd still call that a documentation bug.
Quoted 7 lines
Further,...
- Eithr btrfs start allows multiple devices to be specified (which isn't documented either,
- or it should allow that.
- or using -d makes no sense when the scrub is launched on a device (instead of a mount point) and should thus fail or give at least a warning.
https://bugzilla.kernel.org/show_bug.cgi?id=110051
Signature · 1 line
Chris Murphy
Christoph Anton Mitterer posted on Mon, 28 Dec 2015 02:25:37 +0100 as excerpted:
Quoted 4 lines
Quoted 3 lines
Quoted 3 lines
(The manpage specifically says "all devices of the filesystem identified by <path>". Emphasis on _ALL_DEVICES_ if given a normal path.)
Quoted 8 lines
Quoted 2 lines
Quoted 2 lines
(The manpage continues ... "or on a single <device>." Emphasis on _SINGLE_DEVICE_ if given a device node.)
Just noted, mine says this:
Quoted 3 lines
Start a scrub on all devices of the filesystem identified by <path> or on a single <device>. If a scrub is already running, the new one fails.
still not the text you quoted,... but there it is.
The text I directly quoted... with quotation marks and "the manpage specifically says", is in my quote above, added back in here and marked off as the third level quote.
The material within my quotation marks is found verbatim within your quote of the manpage. So how is it not the text I quoted?
It's in quotation marks attributed with "the manpage specifically says", my own rewording is marked as the manpage _"suggests"_ (with the choice of "suggests" as opposed to "says" and quote marks rather strongly implying that part is _not_ a direct quote), how could I _possibly_ make it any clearer than that?
Signature · 3 lines
Duncan - List replies preferred. No HTML msgs. "Every nonfree program has a lord, a master -- and if you use the program, he is your master." Richard Stallman
Quoted 1 line · Duncan
So how is it not the text I quoted?
Uhm... I just thought you meant that:
Quoted 3 lines
* When you point scrub at a mountpoint, it scrubs all devices composing
that filesystem.
to be the quote which I couldn't find after a quick cross reading...
Sorry for my confusion :-)
Cheers,
Chris.
Quoted 18 lines · Christoph Anton Mitterer
Quoted 5 lines · Duncan
I'd call that NOTABUG. As the btrfs-scrub manpage suggests:
* When you point scrub at a mountpoint, it scrubs all devices composing
that filesystem.Uhm,.. mine doesn't contain this,... neither do those of the master or devel branches from David's repo... or am I just blind?
Actually it says:
Quoted 3 lines
DESCRIPTION
btrfs scrub is used to scrub a btrfs filesystem, which will read all data from all disks and verify checksums.Also, if it would allow to only selectively scrub parts of the fs (e.g. just some devices or subpaths/subvols/files) than the whole syntax for cancel, break, etc. would become ambiguous.
Quoted 7 lines
Quoted 5 lines
Since
/dev/disk/by-*/*are symlinks to various block-device nodes, it
follows that if you point scrub at them, only the device pointed at is
scrubbed, exactly as one might expect based on the manpage.Sure... that was clear... but I have another manpage than yours... perhaps some distro specific patch?
Fedora carries pretty much unmodified upstream btrfs-progs and I see what both of you are seeing (I have 4.3.1).
The description does somewhat confusingly say "btrfs scrub is used to scrub a btrfs filesystem, which will read all data from all disks and verify checksums" but under subcommand > start it contains the following qualification as the first sentence:
Start a scrub on all devices of the filesystem identified by <path> or on a single <device>.
Signature · 1 line
Chris Murphy
Christoph Anton Mitterer posted on Mon, 28 Dec 2015 02:21:28 +0100 as excerpted:
Quoted 8 lines · Duncan
Quoted 4 lines
I'd call that NOTABUG. As the btrfs-scrub manpage suggests:
* When you point scrub at a mountpoint, it scrubs all devices composing that filesystem.
Uhm,.. mine doesn't contain this,... neither do those of the master or devel branches from David's repo... or am I just blind?
I see that Chris Murphy just filed a bug on it with the particulars, but just to clear this up...
That's my paraphrase of what it says, thus the "suggests", but I do specifically quote, with "the manpage specifically says" and quote marks, so it's pretty hard to miss, which I /thought/, along with "suggests", should make it clear that I was NOT specifically quoting the manpage in the bullet-point.
Apparently not...
Quoted 4 lines
Actually it says:
Quoted 3 lines
DESCRIPTION
btrfs scrub is used to scrub a btrfs filesystem, which will read all data from all disks and verify checksums.
Look under scrub start... as you did in a followup...
Quoted 6 lines
Quoted 3 lines
Since
/dev/disk/by-*/*are symlinks to various block-device nodes, it follows that if you point scrub at them, only the device pointed at is scrubbed, exactly as one might expect based on the manpage.Sure... that was clear... but I have another manpage than yours... perhaps some distro specific patch?
No, just both a slightly more specific part of the manpage, under scrub start, and a mistake in believing "suggests" implies or explicitly specifies a direct quote, even when a direct quote is later actually made, complete with quotation marks and "the manpage specifically says" attribution.
btrfs-progs v4.3.1, if it matters.
Signature · 3 lines
Duncan - List replies preferred. No HTML msgs. "Every nonfree program has a lord, a master -- and if you use the program, he is your master." Richard Stallman