All of lore.kernel.org
 help / color / mirror / Atom feed
* Should "mdadm --add" complain if the new device appears to have a filesystem on it?
@ 2013-07-23  1:39 NeilBrown
  2013-07-23  7:41 ` Holger Kiehl
  2013-07-23 17:17 ` Piergiorgio Sartor
  0 siblings, 2 replies; 4+ messages in thread
From: NeilBrown @ 2013-07-23  1:39 UTC (permalink / raw)
  To: linux RAID; +Cc: Christian Iversen

[-- Attachment #1: Type: text/plain, Size: 1400 bytes --]


As you probably know, when you use "mdadm -C" to create an array, it will
check if the devices appear to contain a filesystem or similar already and
will complain if they do - requiring you do say "yes" or use "--run" to avoid
the warning.

However if you use "--add" to add a device to an existing array no such
checks are done.  So it isn't too hard to destroy all those cat photos you
have saved on a USB drive (because device names change every time you boot
and you got confused).


I could easily change "--add" to be more cautious, but that might break
existing scripts, which I would rather not do.

Or I could add a "policy" line to mdadm.conf which would indicate the policy
for "--add" - either "spare" or "force-spare".  But then I would need to
decide on a default.  The default should probably be safe otherwise people
probably won't change it until they get burned.  So people with scripts would
still experience breakage, but could now fix it easily with a "policy" line.

Or maybe "--add" should be deprecated so people have to choose between
"--re-add" or a new "--spare" with --spare requiring "--force" to destroy
data.
Then "--add" would generate a deprecation message which scripts could  ignore
but people might learn from.


I don't think there is an obviously-correct answer here so I'm open to
suggestions.  What do people think?

NeilBrown

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Should "mdadm --add" complain if the new device appears to have a filesystem on it?
  2013-07-23  1:39 Should "mdadm --add" complain if the new device appears to have a filesystem on it? NeilBrown
@ 2013-07-23  7:41 ` Holger Kiehl
  2013-07-23 10:18   ` Christian Iversen
  2013-07-23 17:17 ` Piergiorgio Sartor
  1 sibling, 1 reply; 4+ messages in thread
From: Holger Kiehl @ 2013-07-23  7:41 UTC (permalink / raw)
  To: NeilBrown; +Cc: linux RAID, Christian Iversen

Hello Neil,

first, many many thanks for all your good work on MD and always helping
us here on this list!

On Tue, 23 Jul 2013, NeilBrown wrote:

>
> As you probably know, when you use "mdadm -C" to create an array, it will
> check if the devices appear to contain a filesystem or similar already and
> will complain if they do - requiring you do say "yes" or use "--run" to avoid
> the warning.
>
> However if you use "--add" to add a device to an existing array no such
> checks are done.  So it isn't too hard to destroy all those cat photos you
> have saved on a USB drive (because device names change every time you boot
> and you got confused).
>
>
> I could easily change "--add" to be more cautious, but that might break
> existing scripts, which I would rather not do.
>
> Or I could add a "policy" line to mdadm.conf which would indicate the policy
> for "--add" - either "spare" or "force-spare".  But then I would need to
> decide on a default.  The default should probably be safe otherwise people
> probably won't change it until they get burned.  So people with scripts would
> still experience breakage, but could now fix it easily with a "policy" line.
>
> Or maybe "--add" should be deprecated so people have to choose between
> "--re-add" or a new "--spare" with --spare requiring "--force" to destroy
> data.
> Then "--add" would generate a deprecation message which scripts could  ignore
> but people might learn from.
>
>
> I don't think there is an obviously-correct answer here so I'm open to
> suggestions.  What do people think?
>
I first thought of a --initialize, but I do not think it is any better.
So I would vote for the second solution, depreciating --add and using
--spare plus --force.

Holger

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Should "mdadm --add" complain if the new device appears to have a filesystem on it?
  2013-07-23  7:41 ` Holger Kiehl
@ 2013-07-23 10:18   ` Christian Iversen
  0 siblings, 0 replies; 4+ messages in thread
From: Christian Iversen @ 2013-07-23 10:18 UTC (permalink / raw)
  To: Holger Kiehl; +Cc: NeilBrown, linux RAID

On 2013-07-23 09:41, Holger Kiehl wrote:
> Hello Neil,
>
> first, many many thanks for all your good work on MD and always helping
> us here on this list!
>
> On Tue, 23 Jul 2013, NeilBrown wrote:
>
>>
>> As you probably know, when you use "mdadm -C" to create an array, it will
>> check if the devices appear to contain a filesystem or similar already
>> and
>> will complain if they do - requiring you do say "yes" or use "--run"
>> to avoid
>> the warning.
>>
>> However if you use "--add" to add a device to an existing array no such
>> checks are done.  So it isn't too hard to destroy all those cat photos
>> you
>> have saved on a USB drive (because device names change every time you
>> boot
>> and you got confused).
>>
>>
>> I could easily change "--add" to be more cautious, but that might break
>> existing scripts, which I would rather not do.
>>
>> Or I could add a "policy" line to mdadm.conf which would indicate the
>> policy
>> for "--add" - either "spare" or "force-spare".  But then I would need to
>> decide on a default.  The default should probably be safe otherwise
>> people
>> probably won't change it until they get burned.  So people with
>> scripts would
>> still experience breakage, but could now fix it easily with a "policy"
>> line.
>>
>> Or maybe "--add" should be deprecated so people have to choose between
>> "--re-add" or a new "--spare" with --spare requiring "--force" to destroy
>> data.
>> Then "--add" would generate a deprecation message which scripts could
>> ignore
>> but people might learn from.
>>
>>
>> I don't think there is an obviously-correct answer here so I'm open to
>> suggestions.  What do people think?
>>
> I first thought of a --initialize, but I do not think it is any better.
> So I would vote for the second solution, depreciating --add and using
> --spare plus --force.

If we have to change the options anyway, then I'm more in the mood for 
--add --force for new volumes, and --add for existing ones. It would be 
more in line with what we have now, IMHO.

(please CC, not on the list)

-- 
Med venlig hilsen
Christian Iversen

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Should "mdadm --add" complain if the new device appears to have a filesystem on it?
  2013-07-23  1:39 Should "mdadm --add" complain if the new device appears to have a filesystem on it? NeilBrown
  2013-07-23  7:41 ` Holger Kiehl
@ 2013-07-23 17:17 ` Piergiorgio Sartor
  1 sibling, 0 replies; 4+ messages in thread
From: Piergiorgio Sartor @ 2013-07-23 17:17 UTC (permalink / raw)
  To: NeilBrown; +Cc: linux RAID, Christian Iversen

Hi Neil,

On Tue, Jul 23, 2013 at 11:39:02AM +1000, NeilBrown wrote:
> 
> As you probably know, when you use "mdadm -C" to create an array, it will
> check if the devices appear to contain a filesystem or similar already and
> will complain if they do - requiring you do say "yes" or use "--run" to avoid
> the warning.
> 
> However if you use "--add" to add a device to an existing array no such
> checks are done.  So it isn't too hard to destroy all those cat photos you
> have saved on a USB drive (because device names change every time you boot
> and you got confused).
> 
> 
> I could easily change "--add" to be more cautious, but that might break
> existing scripts, which I would rather not do.

my 2 cents on this.
Advertise it properly and then change it.

I personally think that a bit of "safety" is worth
going thru the scripts to change them.
Not to mention, script will break only in case where
people have the chances to take action directly.

My guess would be that there are few automated scripts
adding devices with filesystem or similar on them.

bye,

pg

> Or I could add a "policy" line to mdadm.conf which would indicate the policy
> for "--add" - either "spare" or "force-spare".  But then I would need to
> decide on a default.  The default should probably be safe otherwise people
> probably won't change it until they get burned.  So people with scripts would
> still experience breakage, but could now fix it easily with a "policy" line.
> 
> Or maybe "--add" should be deprecated so people have to choose between
> "--re-add" or a new "--spare" with --spare requiring "--force" to destroy
> data.
> Then "--add" would generate a deprecation message which scripts could  ignore
> but people might learn from.
> 
> 
> I don't think there is an obviously-correct answer here so I'm open to
> suggestions.  What do people think?
> 
> NeilBrown



-- 

piergiorgio

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-07-23 17:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-23  1:39 Should "mdadm --add" complain if the new device appears to have a filesystem on it? NeilBrown
2013-07-23  7:41 ` Holger Kiehl
2013-07-23 10:18   ` Christian Iversen
2013-07-23 17:17 ` Piergiorgio Sartor

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.