All of lore.kernel.org
 help / color / mirror / Atom feed
From: NeilBrown <neilb@suse.com>
To: Stan Hoeppner <stan@hardwarefreak.org>,
	veljko3@gmail.com, linux-raid@vger.kernel.org
Subject: Re: Linear device of two arrays
Date: Mon, 10 Jul 2017 08:37:52 +1000	[thread overview]
Message-ID: <87van15j9b.fsf@notabene.neil.brown.name> (raw)
In-Reply-To: <5afd5cea-06b8-8524-e4f5-8534f23bd714@hardwarefreak.org>

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

On Sat, Jul 08 2017, Stan Hoeppner wrote:

> On 07/08/2017 05:26 AM, Veljko wrote:
>> On Sat, Jul 8, 2017 at 12:52 AM, Stan Hoeppner <stan@hardwarefreak.org> wrote:
>>> On 07/07/2017 03:26 PM, Veljko wrote:
>>>> I just noticed that I replied to Wol insted to list.
>>>>
>>>> On Wed, Jul 5, 2017 at 8:07 PM, Wols Lists <antlists@youngman.org.uk>
>>>> wrote:
>>>>> On 05/07/17 17:42, Roman Mamedov wrote:
>>>>>> On Wed, 5 Jul 2017 17:34:09 +0200
>>>>>> Veljko <veljko3@gmail.com> wrote:
>>>>>>
>>>>>>> Hello,
>>>>>>>
>>>>>>> I have a RAID10 device which I have formated using the mkfs.xfs
>>>>>>> defaults (Stan helped me with this few years back). I reached 88%
>>>>>>> capacity and it is time to expand it. I bought 4 more drives to create
>>>>>>> another RIAD10 array. I would like to create linear device out of
>>>>>>> those two and grow XFS across the 2nd device. How can this be done
>>>>>>> without loosing the existing device's data? I would also like to add a
>>>>>>> spare HDD. Do I have to have a separate spare HDD for each array or
>>>>>>> one can be used by both of them?
>>>>>> Why make another RAID10? With modern versions of mdadm and kernel you
>>>>>> should
>>>>>> be able to simply reshape the current RAID10 to increase the number of
>>>>>> devices used from 4 to 8.
>>>>>>
>>>>>>
>>>>> I was thinking of replying, but isn't that not possible for some
>>>>> versions of RAID-10?
>>>>>
>>>>> My feeling was, if you can't just add drives to the existing raid 10,
>>>>> create a new one which you can expand, migrate the fs across (btrfs
>>>>> would let you do that live, I believe, so xfs probably can too), then
>>>>> you can scrap the old raid-10 and add the drives into the new one.
>>>>>
>>>>> Cheers,
>>>>> Wol
>>>>
>>>> Thanks for your input, Roman and Wol.
>>>>
>>>> Expanding existing RAID is one of the options, but I was advised by
>>>> Stan Hoeppner to do it this way and I tend to believe him on this
>>>> subject. With my metadata heavy backup workload, this will provide
>>>> better performance.
>>>>
>>>> So my question is still, how can an existing array be added to linear
>>>> device, and it's file system expanded over the second array.
>>> For this to work the existing RAID10 array must already be a member of a
>>> linear device with one component device.  If this linear array already
>>> exists then you could add another RAID10 array to the linear device.  If you
>>> currently have an XFS filesystem sitting atop a 'bare' RAID10 then I don't
>>> believe the linear option will work for you.  Thus I'd tend to agree with
>>> others that reshaping your current RAID10 is the best option.
>>>
>>> My apologies if I wasn't clear in my previous advice.
>>>
>>> Stan
>> Here is your previous advice:
>> "Do not use LVM.  Directly format the RAID10 device using the mkfs.xfs
>> defaults.  mkfs.xfs will read the md configuration and automatically
>> align the filesystem to the stripe width.
>>
>> When the filesystem reaches 85% capacity, add 4 more drives and create
>> another RAID10 array.  At that point we'll teach you how to create a
>> linear device of the two arrays and grow XFS across the 2nd array."
>>
>>  From this I concluded that it is possible to create linear device
>> using existing array, but since it is not the case, I'll just have to
>> create new array, move data to it, than add first array to a new
>> linear device (1 member), copy my data to it, and than join second
>> device to it. I wanted to avoid all this copying but will have to do
>> it. Than I will add one drive to spare-group both arrays will be a
>> members of, as advised by Andreas. Does this sound OK?
>
> Yes.  Although, I was hoping Neil Brown would chime in here. I'm not 
> entirely sure that you can't do this the way I originally mentioned.

I wasn't clear to me that I needed to chime in..  and the complete lack
of details (not even an "mdadm --examine" output), meant I could only
answer in vague generalizations.
However, seeing you asked.
If you really want to have a 'linear' of 2 RAID10s, then
0/ unmount the xfs filesystem
1/ backup the last few megabytes of the device
    dd if=/dev/mdXX of=/safe/place/backup bs=1M skip=$BIGNUM
2/ create a linear array of the two RAID10s, ensuring the
   metadata is v1.0, and the dataoffset is zero (should be default with
   1.0)
    mdadm -C /dev/mdZZ -l linear -n 2 -e 1.0 --data-offset=0 /dev/mdXX /dev/mdYY
3/ restore the saved data
    dd of=/dev/mdZZ if=/safe/place/backup bs=1M seek=$BIGNUM
4/ grow the xfs filesystem
5/ be happy.

I cannot comment on the values of "few" and "$BUGNUM" without seeing
specifics.

NeilBrown

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

  reply	other threads:[~2017-07-09 22:37 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-05 15:34 Linear device of two arrays Veljko
2017-07-05 16:42 ` Roman Mamedov
2017-07-05 18:07   ` Wols Lists
2017-07-07 11:07     ` Nix
2017-07-07 20:26     ` Veljko
2017-07-07 21:20       ` Andreas Klauer
2017-07-07 21:53         ` Roman Mamedov
2017-07-07 22:20           ` Andreas Klauer
2017-07-07 22:33           ` Andreas Klauer
2017-07-07 22:52       ` Stan Hoeppner
2017-07-08 10:26         ` Veljko
2017-07-08 21:24           ` Stan Hoeppner
2017-07-09 22:37             ` NeilBrown [this message]
2017-07-10 11:03               ` Veljko
2017-07-12 10:21                 ` Veljko
2017-07-14  2:03                   ` NeilBrown
2017-07-14  1:57                 ` NeilBrown
2017-07-14  2:05                   ` NeilBrown
2017-07-14 13:40                   ` Veljko
2017-07-15  0:12                     ` NeilBrown
2017-07-17 10:16                       ` Veljko
2017-07-18  8:58                         ` Veljko
2017-07-20 21:40                           ` Veljko
2017-07-20 22:00                         ` NeilBrown
2017-07-21  9:15                           ` Veljko
2017-07-21 11:37                             ` Veljko
2017-07-22 23:03                               ` NeilBrown
2017-07-23 10:05                                 ` Veljko

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=87van15j9b.fsf@notabene.neil.brown.name \
    --to=neilb@suse.com \
    --cc=linux-raid@vger.kernel.org \
    --cc=stan@hardwarefreak.org \
    --cc=veljko3@gmail.com \
    /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.