kdave / btrfs-progs

Development of userspace BTRFS tools
GNU General Public License v2.0
530 stars 240 forks source link

scrub: report when block device is read-only (start, status) #666

Open sva522 opened 10 months ago

sva522 commented 10 months ago

On archlinux :

$ uname -r 6.1.47-1-lts $ btrfs scrub start /mnt/dd scrub started on /mnt/dd, fsid f47201d4-2b74-45c3-a332-b7ff8187ce63 (pid=1744) === Immediately after === $ btrfs scrub status /mnt/dd UUID: f47201d4-2b74-45c3-a332-b7ff8187ce63 Scrub started: Fri Aug 25 21:00:15 2023 Status: aborted Duration: 0:00:00 Total to scrub: 420.42GiB Rate: 0.00B/s Error summary: no errors found

Why is status is aborted ? This failure happen both on lts and zen kernel (6.4.12), both on may installed arch system an using last Endeavouros_Cassini_Nova-03-2023_R3 OS live.

I have the same failure on two different external USB drive. Scrub a couple of internal drive (RAID1) is fine.

kdave commented 10 months ago

Is there anything in the system log? Could the devices be set read-only (though I think that in that case scrub would return with a different error message). Otherwise I don't know, it's kernel 6.1 without the recent scrub rewrite.

sva522 commented 10 months ago

Device was indeed read-only. Device is not a RAID1 so no possibility to fix encountered checksum error. I though read-only was not an issue and command will just report error. Works perfectly fine now thanks.

kdave commented 10 months ago

Ok, thanks. I've tested scrub on a read-only device here and it's the reason why it is aborted is not mentioned anywhere, this could be improved. I'll update the issue subject and keep it as todo.

kdave commented 10 months ago

Btw you can still do a scrub on a read-only device by btrfs scrub start -r /mnt.