* Question about how to migrate raid0 to raid5
@ 2012-07-19 7:11 Zhang Jiejing
2012-07-22 23:22 ` NeilBrown
0 siblings, 1 reply; 2+ messages in thread
From: Zhang Jiejing @ 2012-07-19 7:11 UTC (permalink / raw)
To: NeilBrown; +Cc: linux-raid
Hi Neil Brown,
Sorry for interrupt you.
I'm using linux md raid0 in my server, and it's working very good unless
it's outof space recently.
Thanks for you good job.
I have two question about linux md,
1. the first one maybe a common one:
I install my server /home dir as RAID-0 for speed, this server is
usually to code build and development, but recently I need add a 2TB HDD
to this md, and I found add disk on RAID-0 is not supported, but I found
there will maybe a way to convert my RAID-0 to RAID-5, and then add
other disk on the RAID-5 (I don't covert it back).
I sow some patch about md takeover:
like
md/raid4: permit raid0 takeover
md: Fix dev_sectors on takeover from raid0 to raid4/5
But I'm a newbie about linux md, can you give a some guide about how to
do this or it was not supported ?
My kernel version: Linux 2.6.38-15-server #64-Ubuntu SMP Fri Jul 6
19:08:52 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux
mdadm - v3.1.4 - 31st August 2010
2. the second question is about radi0.c : create_strip_zones() function,
this function will scan mddev->disks and check them EQUAL size or not,
can you give me some guide about where this disks passed to this mddev ?
The reason I ask this question is, I add a new HD, and partition two
"Linux raid autodetect" partition on this disk, but I don't know how to
add this disk to md1.
So I type:
mdadm --add /dev/md1 /dev/sdc
and report -EINVAL error.
I first tough is I caused by my partition not right, so I partition my
sdc to 2 partition, with partition type is "Linux raid autodetect".
and found also failed, so I did some google, and found RAID-0 don't
support add disk online.
After did a ubuntu "do-release-upgrade", and reboot, I found kernel will
check /dev/sdc, looking at sdc, and then failed to create the zone.
After remove the HD in BIOS, I can success mount the md1 again, so my
question is do I need do some mdadm command to remove the /dev/sdc in my
md1 (maybe it record the device node in some where ?)
Thanks for you advance.
--
BR,
Jiejing
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Question about how to migrate raid0 to raid5
2012-07-19 7:11 Question about how to migrate raid0 to raid5 Zhang Jiejing
@ 2012-07-22 23:22 ` NeilBrown
0 siblings, 0 replies; 2+ messages in thread
From: NeilBrown @ 2012-07-22 23:22 UTC (permalink / raw)
To: Zhang Jiejing; +Cc: linux-raid
[-- Attachment #1: Type: text/plain, Size: 3024 bytes --]
On Thu, 19 Jul 2012 15:11:06 +0800 Zhang Jiejing <b33651@freescale.com> wrote:
> Hi Neil Brown,
>
> Sorry for interrupt you.
>
> I'm using linux md raid0 in my server, and it's working very good unless
> it's outof space recently.
> Thanks for you good job.
>
> I have two question about linux md,
> 1. the first one maybe a common one:
> I install my server /home dir as RAID-0 for speed, this server is
> usually to code build and development, but recently I need add a 2TB HDD
> to this md, and I found add disk on RAID-0 is not supported, but I found
> there will maybe a way to convert my RAID-0 to RAID-5, and then add
> other disk on the RAID-5 (I don't covert it back).
>
> I sow some patch about md takeover:
> like
> md/raid4: permit raid0 takeover
> md: Fix dev_sectors on takeover from raid0 to raid4/5
>
> But I'm a newbie about linux md, can you give a some guide about how to
> do this or it was not supported ?
If you use a recent kernel (3.4) and a recent mdadm you should be able to
grow a RAID0 array. It will be converted to RAID5, reshaped, then converted
back.
I recommend creating some 'loopback' devices to experiment with just to make
sure it works.
i.e. create 4 big files, use "losetup /dev/loop0 filename" etc to create 4
loopback devices. Create a RAID0 over 3 of those, then try to add a device.
The command is:
mdadm --grow /dev/md0 --raid-devices=4 --add /dev/loop3
or similar.
>
> My kernel version: Linux 2.6.38-15-server #64-Ubuntu SMP Fri Jul 6
> 19:08:52 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux
>
> mdadm - v3.1.4 - 31st August 2010
You'll definitely need newer kernel and mdadm.
>
>
> 2. the second question is about radi0.c : create_strip_zones() function,
> this function will scan mddev->disks and check them EQUAL size or not,
> can you give me some guide about where this disks passed to this mddev ?
>
> The reason I ask this question is, I add a new HD, and partition two
> "Linux raid autodetect" partition on this disk, but I don't know how to
> add this disk to md1.
>
> So I type:
> mdadm --add /dev/md1 /dev/sdc
> and report -EINVAL error.
You cannot add a device to a RAID0 - there is nowhere to put it.
To grow a RAID0, you give the --add in the same command as the --grow, as
above.
>
> I first tough is I caused by my partition not right, so I partition my
> sdc to 2 partition, with partition type is "Linux raid autodetect".
>
> and found also failed, so I did some google, and found RAID-0 don't
> support add disk online.
>
> After did a ubuntu "do-release-upgrade", and reboot, I found kernel will
> check /dev/sdc, looking at sdc, and then failed to create the zone.
>
> After remove the HD in BIOS, I can success mount the md1 again, so my
> question is do I need do some mdadm command to remove the /dev/sdc in my
> md1 (maybe it record the device node in some where ?)
>
>
> Thanks for you advance.
>
NeilBrown
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-07-22 23:22 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-19 7:11 Question about how to migrate raid0 to raid5 Zhang Jiejing
2012-07-22 23:22 ` NeilBrown
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).