All of lore.kernel.org
 help / color / mirror / Atom feed
From: "John Stoffel" <john@stoffel.org>
To: Eli Ben-Shoshan <eli@benshoshan.com>
Cc: John Stoffel <john@stoffel.org>, linux-raid@vger.kernel.org
Subject: Re: Accidentally resized array to 9
Date: Fri, 29 Sep 2017 17:17:35 -0400	[thread overview]
Message-ID: <22990.47215.946193.433535@quad.stoffel.home> (raw)
In-Reply-To: <fadb48d2-0a09-a8fe-156b-754baaa55a27@benshoshan.com>

>>>>> "Eli" == Eli Ben-Shoshan <eli@benshoshan.com> writes:

Eli> On 09/29/2017 03:33 PM, John Stoffel wrote:
>>>>>>> "Eli" == Eli Ben-Shoshan <eli@benshoshan.com> writes:
>> 
Eli> On 09/29/2017 08:38 AM, John Stoffel wrote:
>>>>>>>>> "Eli" == Eli Ben-Shoshan <eli@benshoshan.com> writes:
>>>> 
Eli> I need to add another disk to my array (/dev/md128) when I accidentally
Eli> did an array resize to 9 with the following command:
>>>> 
Eli> First I add the disk to the array with the following:
>>>> 
Eli> mdadm --manage /dev/md128 --add /dev/sdl
>>>> 
Eli> This was a RAID6 with 8 devices. Instead of using --grow with
Eli> --raid-devices set to 9, I did the following:
>>>> 
Eli> mdadm --grow /dev/md128 --size 9
>>>> 
Eli> This happily returned without any errors so I went to go look at
Eli> /proc/mdstat and did not see a resize operation going. So I shook my
Eli> head and read the output of --grow --help and did the right thing which is:
>>>> 
Eli> mdadm --grow /dev/md128 --raid-devices=9
>>>> 
Eli> Right after that everything hit the fan. dmesg reported a lot of
Eli> filesystem errors. I quickly stopped all processes that were using this
Eli> device and unmounted the filesystems. I then, stupidly, decided to
Eli> reboot before looking around.
>>>> 
>>>> 
>>>> I think you *might* be able to fix this with just a simple:
>>>> 
>>>> mdadm --grow /dev/md128 --size max
>>>> 
>>>> And then try to scan for your LVM configuration, then fsck your volume
>>>> on there.  I hope you had backups.
>>>> 
>>>> And maybe there should be a warning when re-sizing raid array elements
>>>> without a --force option if going smaller than the current size?
>> 
Eli> I just tried that and got the following error:
>> 
Eli> mdadm: Cannot set device size in this type of array
>> 
Eli> Trying to go further down this path, I also tried to set the size
Eli> explicitly with:
>> 
Eli> mdadm --grow /dev/md150 --size 1953383512
>> 
Eli> but got:
>> 
Eli> mdadm: Cannot set device size in this type of array
>> 
Eli> I am curious if my data is actually still there on disk.
>> 
Eli> What does the --size with --grow actually do?
>> 
>> It changes the size of each member of the array.  The man page
>> explains it, though not ... obviously.
>> 
>> Are you still running with the overlays?  That would explain why it
>> can't resize them bigger.  But I'm also behind on email today...


Eli> I was still using the overlay. I just tried the grow without the overlay 
Eli> and got the same error.

Hmm.. what do the partitions on the disk look like now?  You might
need to do more digging.  But I would say that using --grow and having
it *shrink* without any warnings is a bad idea for the mdadm tools.
It should scream loudly and only run when forced to like that.

Aw crap... you used the whole disk.  I don't like doing this because
A) if I get a disk slightly *smaller* than what I currently have, it
will be painful, B) it's easy to use a small partition starting 4mb
from the start and a few hundred Mb (or even a Gb) from the end.

In your case, can you try to do the 'mdadm --grow /dev/md### --size
max' but with a version of mdadm compiled with debugging info, or at
least using the latest version of the code if at all possible.

Grab it from https://github.com/neilbrown/mdadm  and when you
configure it, make sure you enable debugging.  Or grab it from
https://www.kernel.org/pub/linux/utils/raid/mdadm/ and try the same
thing.

Can you show the output of: cat /proc/partitions as well?  Maybe you
need to do:

  mdadm --grow <dev> --size ########

which is the smallest of the max size of all your disks.  Might
work...


  reply	other threads:[~2017-09-29 21:17 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-29  4:23 Accidentally resized array to 9 Eli Ben-Shoshan
2017-09-29 12:38 ` John Stoffel
2017-09-29 14:47   ` Eli Ben-Shoshan
2017-09-29 19:33     ` John Stoffel
2017-09-29 21:04       ` Eli Ben-Shoshan
2017-09-29 21:17         ` John Stoffel [this message]
2017-09-29 21:49           ` Eli Ben-Shoshan
2017-09-29 12:55 ` Roman Mamedov
2017-09-29 14:53   ` Eli Ben-Shoshan
2017-09-29 19:50     ` Roman Mamedov
2017-09-30 16:21       ` Phil Turmel
2017-09-30 16:29         ` Roman Mamedov
2017-09-30 23:30         ` John Stoffel

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=22990.47215.946193.433535@quad.stoffel.home \
    --to=john@stoffel.org \
    --cc=eli@benshoshan.com \
    --cc=linux-raid@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 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.