linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Calvin Walton <calvin.walton@kepstin.ca>
To: Nikolaus Rath <Nikolaus@rath.org>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: File system stuck in scrub
Date: Mon, 11 Aug 2014 11:45:45 -0400	[thread overview]
Message-ID: <1407771945.6404.1.camel@kepstin.ca> (raw)
In-Reply-To: <87mwbbnjpt.fsf@vostro.rath.org>

Hi,

On Mon, 2014-08-11 at 08:12 -0700, Nikolaus Rath wrote:
> Hello,
> 
> I started a scrub of one of my btrfs filesystem and then had to 
> restart
> the system. `systemctl restart` seemed to terminate all processes, 
> but
> then got stuck at the end. The disk activity led was still flashing
> rapidly at that point, so I assume that the active scrub was 
> preventing
> the reboot (is that a bug or a feature?).
This sounds like a bug - I know that e.g. the rebalance operation is 
designed so that you can shutdown/reboot during the operation, and it 
will complete following a reboot. But I'm not familiar with the code 
in question.

> In any case, I could not wait for that so I power cycled. But now my
> file system seems to be stuck in a scrub that can neither be 
> completed
> nor cancelled:
> 
> $ sudo btrfs scrub status /home/nikratio/
> scrub status for 8742472d-a9b0-4ab6-b67a-5d21f14f7a38
>         scrub started at Sun Aug 10 18:36:43 2014, running for 1562 
> seconds
>         total bytes scrubbed: 209.97GiB with 0 errors
> 
> $ date
> Sun Aug 10 22:00:44 PDT 2014
> 
> $ sudo btrfs scrub cancel /home/nikratio/
> ERROR: scrub cancel failed on /home/nikratio/: not running
> 
> $ sudo btrfs scrub start /home/nikratio/
> ERROR: scrub is already running.
> To cancel use 'btrfs scrub cancel /home/nikratio/'.
> To see the status use 'btrfs scrub status [-d] /home/nikratio/'.
My guess is that this is a mismatch between some state stored by the 
userspace tools and the state in the kernel. One of the things you can 
try is to delete the files /var/lib/btrfs/scrub.status.* - that will 
force the btrfs tools to get the current status from the kernel (you 
will lose some statistics and scrub history.)

Running 'btrfs scrub status /home/nikratio/' after this should simply 
say 'no stats available', and you can start a new scrub later if you 
like.

> I then figured that maybe I need to run btrfsck. This gave the 
> following
> output:
As long as you didn't use --repair, this shouldn't break anything... 
Note that btrfs has to be run on an *unmounted* filesystem to give 
useful results.

>  * Is it more risky to leave the above errors uncorrected, or to run
>    btrfsck with --repair?
There probably aren't any issues on the filesystem that the runtime 
btrfs code can't handle. Don't run with --repair, at least not yet.

> 
> 
> I'm using kernel 3.14.
> 
> Thanks!
> -Nikolaus
> 
> 

-- 
Calvin Walton <calvin.walton@kepstin.ca>

  parent reply	other threads:[~2014-08-11 15:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-11 15:12 File system stuck in scrub Nikolaus Rath
2014-08-11 15:37 ` Hugo Mills
2014-08-11 15:45 ` Calvin Walton [this message]
2014-08-11 15:53   ` Marc MERLIN

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1407771945.6404.1.camel@kepstin.ca \
    --to=calvin.walton@kepstin.ca \
    --cc=Nikolaus@rath.org \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).