linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Proper way to delete an old RAID1?
@ 2013-06-18 17:36 Mark Knecht
  0 siblings, 0 replies; 7+ messages in thread
From: Mark Knecht @ 2013-06-18 17:36 UTC (permalink / raw)
  To: Linux-RAID

I'm in the process of trying to clean up my home server. When I first
built the machine the main RAID was a partition-based 0.90 RAID1 which
is no longer used. I would like to get rid of this RAID (/dev/md127)
completely. What's the right way to do this?

mark@c2RAID6 ~ $ cat /proc/mdstat
Personalities : [linear] [raid0] [raid1] [raid10] [raid6] [raid5] [raid4]
md6 : active raid5 sdd6[2] sdb6[0] sdc6[1]
      494833664 blocks super 1.1 level 5, 64k chunk, algorithm 2 [3/3] [UUU]
      bitmap: 0/2 pages [0KB], 65536KB chunk

md7 : active raid6 sdd7[2] sdc7[1] sdb7[0] sdf2[4] sde2[3]
      395387904 blocks super 1.2 level 6, 16k chunk, algorithm 2 [5/5] [UUUUU]

md127 : active (auto-read-only) raid1 sdc5[1] sdd5[2] sdb5[0]
      52436032 blocks [3/3] [UUU]

md3 : active raid6 sdb3[0] sdf3[5] sde3[3] sdd3[2] sdc3[1]
      157305168 blocks super 1.2 level 6, 16k chunk, algorithm 2 [5/5] [UUUUU]

unused devices: <none>
mark@c2RAID6 ~ $

To I need to do anything more than:

mdadm --stop /dev/md127
mdadm --remove /dev/md127

to remove the raid1? Should I do something to zero out the partitions?
I expect to delete the partitions when this is complete and then grown
one of the other RAIDs to fill the area available.

My eventual goal is to also get rid of the raid5 /dev/md6 and then
possibly combine md3 & md7 into a single raid6 partition. I just don't
want to take the whole machine down to do it where doing reshaping,
even if slow, works fine for me.

Thanks,
Mark

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

* Re: Proper way to delete an old RAID1?
@ 2013-06-18 18:42 Caspar Smit
  2013-06-18 18:55 ` Mark Knecht
  0 siblings, 1 reply; 7+ messages in thread
From: Caspar Smit @ 2013-06-18 18:42 UTC (permalink / raw)
  To: Mark Knecht; +Cc: Linux-RAID

Hi Mark,

Stopping an MD device will not remove/delete anything.
The --remove command cannot be used AFTER an MD device is stopped.
(--remove is only for removing drives/partitions from a running MD
device NOT to remove the MD itself e.g. mdadm --remove /dev/mdX
/dev/sdb, furthermore a drive/partition can only be removed after you
fail the drive first or it has failed by itself offcouse, see the
--fail switch)

To completely erase the MD you need to stop it and then remove the
superblocks from the member drives:

mdadm --stop /dev/md127
mdadm --zero-superblock /dev/sdb5
mdadm --zero-superblock /dev/sdc5
mdadm --zero-superblock /dev/sdd5

You can combine the last 3 commands to:

mdadm --zero-superblock /dev/sd[b-d]5

but to be 100% safe use them seperately.

This will erase the superblocks on the members of /dev/md127 and you
will not be able to assemble it again and it will not be started
during a reboot (remove it from the mdadm.conf too offcourse, but
since the array comes up as /dev/md127 I presume it is already not
present in mdadm.conf)

Kind regards,
Caspar

2013/6/18 Mark Knecht <markknecht@gmail.com>:
> I'm in the process of trying to clean up my home server. When I first
> built the machine the main RAID was a partition-based 0.90 RAID1 which
> is no longer used. I would like to get rid of this RAID (/dev/md127)
> completely. What's the right way to do this?
>
> mark@c2RAID6 ~ $ cat /proc/mdstat
> Personalities : [linear] [raid0] [raid1] [raid10] [raid6] [raid5] [raid4]
> md6 : active raid5 sdd6[2] sdb6[0] sdc6[1]
>       494833664 blocks super 1.1 level 5, 64k chunk, algorithm 2 [3/3] [UUU]
>       bitmap: 0/2 pages [0KB], 65536KB chunk
>
> md7 : active raid6 sdd7[2] sdc7[1] sdb7[0] sdf2[4] sde2[3]
>       395387904 blocks super 1.2 level 6, 16k chunk, algorithm 2 [5/5] [UUUUU]
>
> md127 : active (auto-read-only) raid1 sdc5[1] sdd5[2] sdb5[0]
>       52436032 blocks [3/3] [UUU]
>
> md3 : active raid6 sdb3[0] sdf3[5] sde3[3] sdd3[2] sdc3[1]
>       157305168 blocks super 1.2 level 6, 16k chunk, algorithm 2 [5/5] [UUUUU]
>
> unused devices: <none>
> mark@c2RAID6 ~ $
>
> To I need to do anything more than:
>
> mdadm --stop /dev/md127
> mdadm --remove /dev/md127
>
> to remove the raid1? Should I do something to zero out the partitions?
> I expect to delete the partitions when this is complete and then grown
> one of the other RAIDs to fill the area available.
>
> My eventual goal is to also get rid of the raid5 /dev/md6 and then
> possibly combine md3 & md7 into a single raid6 partition. I just don't
> want to take the whole machine down to do it where doing reshaping,
> even if slow, works fine for me.
>
> Thanks,
> Mark
> --
> To unsubscribe from this list: send the line "unsubscribe linux-raid" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: Proper way to delete an old RAID1?
  2013-06-18 18:42 Proper way to delete an old RAID1? Caspar Smit
@ 2013-06-18 18:55 ` Mark Knecht
  2013-06-18 19:01   ` Caspar Smit
  0 siblings, 1 reply; 7+ messages in thread
From: Mark Knecht @ 2013-06-18 18:55 UTC (permalink / raw)
  To: Caspar Smit; +Cc: Linux-RAID

On Tue, Jun 18, 2013 at 11:42 AM, Caspar Smit <c.smit@truebit.nl> wrote:
> Hi Mark,
>
> Stopping an MD device will not remove/delete anything.
> The --remove command cannot be used AFTER an MD device is stopped.
> (--remove is only for removing drives/partitions from a running MD
> device NOT to remove the MD itself e.g. mdadm --remove /dev/mdX
> /dev/sdb, furthermore a drive/partition can only be removed after you
> fail the drive first or it has failed by itself offcouse, see the
> --fail switch)
>
> To completely erase the MD you need to stop it and then remove the
> superblocks from the member drives:
>
> mdadm --stop /dev/md127
> mdadm --zero-superblock /dev/sdb5
> mdadm --zero-superblock /dev/sdc5
> mdadm --zero-superblock /dev/sdd5
>
> You can combine the last 3 commands to:
>
> mdadm --zero-superblock /dev/sd[b-d]5
>
> but to be 100% safe use them seperately.
>
> This will erase the superblocks on the members of /dev/md127 and you
> will not be able to assemble it again and it will not be started
> during a reboot (remove it from the mdadm.conf too offcourse, but
> since the array comes up as /dev/md127 I presume it is already not
> present in mdadm.conf)
>
> Kind regards,
> Caspar
>

Thanks Caspar. What you are saying makes more sense to me and is, as
best I can tell, consistent with man mdadm.

I've used this site a few times as it seems to come up a lot when
Googling mdadm questions:

http://www.ducea.com/2009/03/08/mdadm-cheat-sheet/

Apparently his instructions in #3 are incorrect.

Cheers,
Mark

> 2013/6/18 Mark Knecht <markknecht@gmail.com>:
<SNIP>
>>
>> mdadm --stop /dev/md127
>> mdadm --remove /dev/md127
>>
>> to remove the raid1?
<SNIP>

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

* Re: Proper way to delete an old RAID1?
  2013-06-18 18:55 ` Mark Knecht
@ 2013-06-18 19:01   ` Caspar Smit
  2013-06-18 19:08     ` Mark Knecht
  0 siblings, 1 reply; 7+ messages in thread
From: Caspar Smit @ 2013-06-18 19:01 UTC (permalink / raw)
  To: Mark Knecht; +Cc: Linux-RAID

Mark,

His instructions at #3 are correct, #6 are incorrect (or someone has
to correct me and knows the --remove will work on an entire MD
device?).


Kind regards,
Caspar
Met vriendelijke groet,

Caspar Smit
Systemengineer
TB BV
Dorsvlegelstraat 13
1445 PA Purmerend

T: +31(0)299 410 475
F: +31(0)299 410 476
@: c.smit@truebit.nl
W: www.truebit.nl


2013/6/18 Mark Knecht <markknecht@gmail.com>:
> On Tue, Jun 18, 2013 at 11:42 AM, Caspar Smit <c.smit@truebit.nl> wrote:
>> Hi Mark,
>>
>> Stopping an MD device will not remove/delete anything.
>> The --remove command cannot be used AFTER an MD device is stopped.
>> (--remove is only for removing drives/partitions from a running MD
>> device NOT to remove the MD itself e.g. mdadm --remove /dev/mdX
>> /dev/sdb, furthermore a drive/partition can only be removed after you
>> fail the drive first or it has failed by itself offcouse, see the
>> --fail switch)
>>
>> To completely erase the MD you need to stop it and then remove the
>> superblocks from the member drives:
>>
>> mdadm --stop /dev/md127
>> mdadm --zero-superblock /dev/sdb5
>> mdadm --zero-superblock /dev/sdc5
>> mdadm --zero-superblock /dev/sdd5
>>
>> You can combine the last 3 commands to:
>>
>> mdadm --zero-superblock /dev/sd[b-d]5
>>
>> but to be 100% safe use them seperately.
>>
>> This will erase the superblocks on the members of /dev/md127 and you
>> will not be able to assemble it again and it will not be started
>> during a reboot (remove it from the mdadm.conf too offcourse, but
>> since the array comes up as /dev/md127 I presume it is already not
>> present in mdadm.conf)
>>
>> Kind regards,
>> Caspar
>>
>
> Thanks Caspar. What you are saying makes more sense to me and is, as
> best I can tell, consistent with man mdadm.
>
> I've used this site a few times as it seems to come up a lot when
> Googling mdadm questions:
>
> http://www.ducea.com/2009/03/08/mdadm-cheat-sheet/
>
> Apparently his instructions in #3 are incorrect.
>
> Cheers,
> Mark
>
>> 2013/6/18 Mark Knecht <markknecht@gmail.com>:
> <SNIP>
>>>
>>> mdadm --stop /dev/md127
>>> mdadm --remove /dev/md127
>>>
>>> to remove the raid1?
> <SNIP>

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

* Re: Proper way to delete an old RAID1?
  2013-06-18 19:01   ` Caspar Smit
@ 2013-06-18 19:08     ` Mark Knecht
  2013-06-18 20:02       ` Mark Knecht
  2013-06-20  9:58       ` Caspar Smit
  0 siblings, 2 replies; 7+ messages in thread
From: Mark Knecht @ 2013-06-18 19:08 UTC (permalink / raw)
  To: Caspar Smit; +Cc: Linux-RAID

On Tue, Jun 18, 2013 at 12:01 PM, Caspar Smit <c.smit@truebit.nl> wrote:
> Mark,
>
> His instructions at #3 are correct, #6 are incorrect (or someone has
> to correct me and knows the --remove will work on an entire MD
> device?).
>
>
> Kind regards,
> Caspar
> Met vriendelijke groet,

You're right, I'm wrong. It was #6 I was referring to when I first posted.

Thanks for the correction. We'll see if anyone else suggests #6 actually works.

Cheers,
Mark

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

* Re: Proper way to delete an old RAID1?
  2013-06-18 19:08     ` Mark Knecht
@ 2013-06-18 20:02       ` Mark Knecht
  2013-06-20  9:58       ` Caspar Smit
  1 sibling, 0 replies; 7+ messages in thread
From: Mark Knecht @ 2013-06-18 20:02 UTC (permalink / raw)
  To: Caspar Smit; +Cc: Linux-RAID

On Tue, Jun 18, 2013 at 12:08 PM, Mark Knecht <markknecht@gmail.com> wrote:
> On Tue, Jun 18, 2013 at 12:01 PM, Caspar Smit <c.smit@truebit.nl> wrote:
>> Mark,
>>
>> His instructions at #3 are correct, #6 are incorrect (or someone has
>> to correct me and knows the --remove will work on an entire MD
>> device?).
>>
>>
>> Kind regards,
>> Caspar
>> Met vriendelijke groet,
>
> You're right, I'm wrong. It was #6 I was referring to when I first posted.
>
> Thanks for the correction. We'll see if anyone else suggests #6 actually works.
>
> Cheers,
> Mark

I suppose one other small point on this topic, should anyone read it
in the distant future, is that once I've stopped the RAID and zero'ed
the superblocks the RAID itself is gone and cannot be reassembled but
the partitions are still there, and they are still marked as 'Linux
raid autodetect' in fdisk.

To move forward with growing other RAIDs I need to remove the existing
but now unused partitions to make room for future changes.

Cheers,
Mark

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

* Re: Proper way to delete an old RAID1?
  2013-06-18 19:08     ` Mark Knecht
  2013-06-18 20:02       ` Mark Knecht
@ 2013-06-20  9:58       ` Caspar Smit
  1 sibling, 0 replies; 7+ messages in thread
From: Caspar Smit @ 2013-06-20  9:58 UTC (permalink / raw)
  To: Mark Knecht; +Cc: Linux-RAID

To all interested,

I tested the --remove option on an entire MD device it immediatly
returned to the command prompt with no output/action whatsoever.
The MD was still active and runnning. So I can confirm it does nothing
and the instruction on the mentioned page are incorrect.

Tested with mdadm v3.1.4

Kind regards,
Caspar

2013/6/18 Mark Knecht <markknecht@gmail.com>:
> On Tue, Jun 18, 2013 at 12:01 PM, Caspar Smit <c.smit@truebit.nl> wrote:
>> Mark,
>>
>> His instructions at #3 are correct, #6 are incorrect (or someone has
>> to correct me and knows the --remove will work on an entire MD
>> device?).
>>
>>
>> Kind regards,
>> Caspar
>> Met vriendelijke groet,
>
> You're right, I'm wrong. It was #6 I was referring to when I first posted.
>
> Thanks for the correction. We'll see if anyone else suggests #6 actually works.
>
> Cheers,
> Mark

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

end of thread, other threads:[~2013-06-20  9:58 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-18 18:42 Proper way to delete an old RAID1? Caspar Smit
2013-06-18 18:55 ` Mark Knecht
2013-06-18 19:01   ` Caspar Smit
2013-06-18 19:08     ` Mark Knecht
2013-06-18 20:02       ` Mark Knecht
2013-06-20  9:58       ` Caspar Smit
  -- strict thread matches above, loose matches on Subject: below --
2013-06-18 17:36 Mark Knecht

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).