From: Neil Brown <neilb@suse.de>
To: saeed bishara <saeed.bishara@gmail.com>
Cc: Tuomas Leikola <tuomas.leikola@gmail.com>, linux-raid@vger.kernel.org
Subject: Re: Linux RAID migration
Date: Tue, 7 Aug 2007 21:40:55 +1000 [thread overview]
Message-ID: <18104.23111.369229.891505@notabene.brown> (raw)
In-Reply-To: message from saeed bishara on Tuesday August 7
On Tuesday August 7, saeed.bishara@gmail.com wrote:
> On 8/7/07, Neil Brown <neilb@suse.de> wrote:
> > On Tuesday August 7, saeed.bishara@gmail.com wrote:
> > > how can I create raid 5 array that preserves the contents of a given
> > > disk (part of the array)?
> > > I can do that in two steps, raid 5 on two disks then reshape it to be
> > > real raid5, but is there a direct way to do it?
> >
> > What do you mean by "real raid 5". Two disks are just as much an
> > array as 10.
> I meant by real raid 5 to raid 5 over 3 drives or above.
> > What do you mean by "direct". If I understand your requirements
> in one mdadm command
> > correctly, there are two obvious steps.
> > 1/ make the data appear in a raid5
> > 2/ change the number of devices in the raid5.
> >
> > Are two steps too many?
> in this case I two options:
> 1. keep the filesystem unmounted tell step 1 in done -> the fs will
> not be available for long time
No, it shouldn't take a long time....
What exactly do you have, and what exactly do you want to achieve?
If think you started of by saying you wanted to convert a raid1 to a
raid5. Yes, that requires the filesystem to be unmounted, but only
takes seconds to achieve:
mdadm -S /dev/md0
mdadm -C /dev/md0 -l5 -n2 /dev/sda1 /dev/sdb1
mount /dev/md0
If you have a single-disk, you first might need to shrink the
filesystem to make sure there is 128K free at the end of the device:
umount /filesystem
resize2fs /dev/sda1 whatever-number
mdadm -C /dev/md0 -l5 -n1 /dev/sda1 missing
mount /dev/md0 /filesystem
# now add the drives and grow
mdadm /dev/md0 --add /dev/sdb1 /dev/sdc1
# wait for recovery to finish
mdadm --grow /dev/md0 --raid-disks=3
something like that..
NeilBrown
next prev parent reply other threads:[~2007-08-07 11:40 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-07 8:16 Linux RAID migration saeed bishara
2007-08-07 8:26 ` Tuomas Leikola
2007-08-07 10:02 ` saeed bishara
2007-08-07 10:22 ` Neil Brown
2007-08-07 10:32 ` saeed bishara
2007-08-07 10:46 ` saeed bishara
2007-08-07 11:18 ` Neil Brown
2007-08-07 11:31 ` saeed bishara
2007-08-07 11:40 ` Neil Brown [this message]
2007-08-07 13:27 ` saeed bishara
2007-08-07 15:15 ` saeed bishara
2007-08-09 3:23 ` Neil Brown
2007-08-15 9:02 ` SWAP file on a RAID-10 array possible? Tomas France
2007-08-15 10:10 ` David Greaves
2007-08-15 10:28 ` Tomas France
2007-08-15 12:59 ` David Greaves
2007-08-15 14:32 ` Daniel Korstad
2007-08-15 21:42 ` Michael Tokarev
2007-08-18 8:52 ` Tomas France
2007-08-15 22:02 ` Bill Davidsen
2007-08-07 10:37 ` Linux RAID migration Tomasz Chmielewski
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=18104.23111.369229.891505@notabene.brown \
--to=neilb@suse.de \
--cc=linux-raid@vger.kernel.org \
--cc=saeed.bishara@gmail.com \
--cc=tuomas.leikola@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 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).