Bug 60359 - Failing to assemble a degraded array leaves behind a half-running array that can't be stopped.
Summary: Failing to assemble a degraded array leaves behind a half-running array that ...
Status: NEW
Alias: None
Product: udisks
Classification: Unclassified
Component: linux-md (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: David Zeuthen (not reading bugmail)
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-02-06 09:45 UTC by Marius Vollmer
Modified: 2013-03-26 15:36 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Marius Vollmer 2013-02-06 09:45:18 UTC
UDisks should probably clean up by explicitly stopping an array after failing to assemble it.
Comment 1 David Zeuthen (not reading bugmail) 2013-02-17 21:43:59 UTC
I agree this is a problem, but I don't think udisks should try to be smart here. I think the fix needs to be made in mdadm(8), that way command-line users also benefit...
Comment 2 Marius Vollmer 2013-02-18 07:31:14 UTC
Hmm, command line users have no immediate problem:  They can run "mdadm --stop" to clean up after a failed "mdadm --assemble".  Udisks does not allow a "mdadm --stop" to be triggered since it treats the array as 'not running'.

I have actually seen mdadm --assemble produce _two_ new, inactive arrays, when I did wild things with spares, I think.  Thus, command line users might also have a problem: digging up what kind of mess mdadm has left behind exactly.  This might not be totally straighforward, and udisks should therefore probably not attempt to do it automatically.

So maybe Udisks could recognize inactive arrays and allow them to be manipulated?
Comment 3 David Zeuthen (not reading bugmail) 2013-03-26 14:43:47 UTC
(In reply to comment #2)
> Hmm, command line users have no immediate problem:  They can run "mdadm
> --stop" to clean up after a failed "mdadm --assemble".  Udisks does not
> allow a "mdadm --stop" to be triggered since it treats the array as 'not
> running'.
> 
> I have actually seen mdadm --assemble produce _two_ new, inactive arrays,
> when I did wild things with spares, I think.  Thus, command line users might
> also have a problem: digging up what kind of mess mdadm has left behind
> exactly.  This might not be totally straighforward, and udisks should
> therefore probably not attempt to do it automatically.
> 
> So maybe Udisks could recognize inactive arrays and allow them to be
> manipulated?

I don't think udisks should try to be smart about _anything_, certainly not mess around with "inactive" arrays. Keep in mind that Linux MD-RAID can be used for virtually _anything_ and the subset that udisks2 cares about - arrays with the MD disk format (and hence, UUIDs) - is much smaller.

I'd rather that mdadm(8) do what we want it to do, which is

 - A way to start an array but _only_ if it can be started in non-degraded
   mode. This is what we'd run in the implementation of the MDRaid.Start()
   D-Bus method when @options does not contain a key 'start-degraded'
   with value TRUE.

 - A way to start an array, allowing it to be started degraded.
   Like above, we'd do this in MDRaid.Start() if 'start-degraded' is
   set to TRUE.

In either case, we shouldn't have to tell what /dev/mdN device to use, mdadm(8) should pick this itself - either it picks /dev/mdN with N=127,126,... or from the /etc/mdadm.conf configuration file. The syntax could be something like

 # mdadm --auto-assemble --uuid 1234

 # mdadm --auto-assemble --allow-degraded --uuid 1234

or similar. The point, simply, is that the only variable parameter we're passing is the UUID, that's it. Unfortunately there's currently no good way to do this with current mdadm(8)...


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.