linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
To: Marc MERLIN <marc@merlins.org>
Cc: linux-raid@vger.kernel.org, Jes Sorensen <jes@trained-monkey.org>
Subject: Re: mdadm --detail works, mdadm --stop says "does not appear to be an md device"
Date: Wed, 22 Mar 2023 08:11:26 +0100	[thread overview]
Message-ID: <20230322081126.0000066d@linux.intel.com> (raw)
In-Reply-To: <20230321020101.GC4049235@merlins.org>

On Mon, 20 Mar 2023 19:01:01 -0700
Marc MERLIN <marc@merlins.org> wrote:

> On Mon, Mar 20, 2023 at 04:16:59PM +0100, Mariusz Tkaczyk wrote:
> > On Mon, 20 Mar 2023 07:50:35 -0700
> > Marc MERLIN <marc@merlins.org> wrote:
> >   
> > > On Mon, Mar 20, 2023 at 03:36:39PM +0100, Mariusz Tkaczyk wrote:  
> > > > Hi,
> > > > mdadm is unable to complete this task because it cannot ensure that it
> > > > is safe to stop the array. It cannot open the array with O_EXCL.
> > > > If it is mounted then it may hang if filesystem needs to flush some
> > > > data.    
> > >  
> > > Thanks for the reply. The array was not mounted, that said, given that
> > > it was fully down, there wasn't a way to flush the data if it had been
> > > (cable problem to an enclosure, all the drives disappeared at once)
> > >   
> > > > Please, try umount the array if it mounted somewhere and then try:
> > > > 
> > > > # echo inactive > /sys/block/md6/md/array_state
> > > > # echo clear > /sys/block/md6/md/array_state    
> > > 
> > > I can try this next time (already had to reboot), thanks.
> > > 
> > > That said, mdadm should output a better message in this case  
> > > > > mdadm: /dev/md6 does not appear to be an md device    
> > > is clearly wrong 
> > > 
> > > Is that something easy to fix/improve?  
> > 
> > Oh, sorry my bad, please see the code:
> > https://git.kernel.org/pub/scm/utils/mdadm/mdadm.git/tree/mdopen.c#n472
> > 
> > We are failing to "understand" the array:
> > https://git.kernel.org/pub/scm/utils/mdadm/mdadm.git/tree/util.c#n229
> > It has nothing to do with open and O_EXCL. I didn't dig into to determine
> > why.
> > 
> > Anyway, now error seems to be reasonable but maybe we should be able to
> > tract this array as valid? I requires more work and analysis so it is not
> > simple fix.  
> 
> You are definitely more knowledgeable about this than I am.
> All I can say is that the array was down, not mounted, and I couldn't
> stop it without a reboot, and that's a problem.
> 
> Any way to force stop in a case like this, would be quite welcome :)
> 
> Thanks,
> Marc

Jes, how you see this?

Thanks,
Mariusz

  reply	other threads:[~2023-03-22  7:12 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-17 17:38 mdadm --detail works, mdadm --stop says "does not appear to be an md device" Marc MERLIN
2023-03-20 14:36 ` Mariusz Tkaczyk
2023-03-20 14:50   ` Marc MERLIN
2023-03-20 15:16     ` Mariusz Tkaczyk
2023-03-21  2:01       ` Marc MERLIN
2023-03-22  7:11         ` Mariusz Tkaczyk [this message]
2023-03-22 18:59           ` Jes Sorensen
2023-03-28 16:47             ` 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=20230322081126.0000066d@linux.intel.com \
    --to=mariusz.tkaczyk@linux.intel.com \
    --cc=jes@trained-monkey.org \
    --cc=linux-raid@vger.kernel.org \
    --cc=marc@merlins.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).