Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
mdadm: Grow raid0 to raid5
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
GlemSom
n00b
n00b


Joined: 26 Oct 2004
Posts: 31

PostPosted: Sat Sep 29, 2012 7:05 pm    Post subject: mdadm: Grow raid0 to raid5 Reply with quote

Using losetup, I've tested growing a raid0 with 2 devices, to a raid5 with 3 devices.

Test-procedure - which works:

Code:
dd if=/dev/zero of=fil0 bs=1000M count=1
dd if=/dev/zero of=fil1 bs=1000M count=1
dd if=/dev/zero of=fil2 bs=1100M count=1

cfdisk /dev/loop0
cfdisk /dev/loop1
cfdisk /dev/loop2

mdadm /dev/md1 --create --chunk=64 --level=0 --metadata=0.90 --raid-devices=2 /dev/loop0p1 /dev/loop1p1

mdadm /dev/md0 --grow --level=5

mdadm /dev/md1 --add /dev/loop2



md1 looks like this before growing:
Quote:
mdadm --detail /dev/md1
/dev/md1:
Version : 0.90
Creation Time : Sat Sep 29 20:58:22 2012
Raid Level : raid0
Array Size : 2047744 (2000.09 MiB 2096.89 MB)
Raid Devices : 2
Total Devices : 2
Preferred Minor : 1
Persistence : Superblock is persistent

Update Time : Sat Sep 29 20:58:22 2012
State : clean
Active Devices : 2
Working Devices : 2
Failed Devices : 0
Spare Devices : 0

Chunk Size : 64K

UUID : 7664bd06:f105820c:c1a11112:11979c50 (local to host ws-gentoo)
Events : 0.1

Number Major Minor RaidDevice State
0 259 0 0 active sync /dev/loop0p1
1 259 1 1 active sync /dev/loop1p1


And after
Quote:

ws-gentoo ~ # mdadm --detail /dev/md1
/dev/md1:
Version : 0.90
Creation Time : Sat Sep 29 20:58:22 2012
Raid Level : raid5
Array Size : 2047744 (2000.09 MiB 2096.89 MB)
Used Dev Size : 1023872 (1000.04 MiB 1048.44 MB)
Raid Devices : 3
Total Devices : 2
Preferred Minor : 1
Persistence : Superblock is persistent

Update Time : Sat Sep 29 21:02:53 2012
State : clean, degraded
Active Devices : 2
Working Devices : 2
Failed Devices : 0
Spare Devices : 0

Layout : parity-last
Chunk Size : 64K

UUID : 7664bd06:f105820c:c1a11112:11979c50 (local to host ws-gentoo)
Events : 0.2

Number Major Minor RaidDevice State
0 259 0 0 active sync /dev/loop0p1
1 259 1 1 active sync /dev/loop1p1
2 0 0 2 removed

At this point, I can then add the 3rd loopback device - and it will start rebuilding.


but, doing the exact same procedure on my md0 fails when trying to change level.
I just get: "mdadm: /dev/md0: could not set level to raid5"

Details of md0:
Quote:
ws-gentoo ~ # mdadm --detail /dev/md0
/dev/md0:
Version : 0.90
Creation Time : Sun Jul 25 03:27:33 2010
Raid Level : raid0
Array Size : 486332096 (463.80 GiB 498.00 GB)
Raid Devices : 2
Total Devices : 2
Preferred Minor : 0
Persistence : Superblock is persistent

Update Time : Sun Jul 25 03:27:33 2010
State : clean
Active Devices : 2
Working Devices : 2
Failed Devices : 0
Spare Devices : 0

Chunk Size : 64K

UUID : de87a664:b2e0493c:cb201669:f728008a
Events : 0.1

Number Major Minor RaidDevice State
0 8 19 0 active sync /dev/sdb3
1 8 49 1 active sync /dev/sdd1


In my dmesg, I see this:
Quote:
md/raid:md0: cannot takeover raid0 with more than one zone.
md: md0: raid5 would not accept array
mdadm: sending ioctl 1261 to a partition!
mdadm: sending ioctl 1261 to a partition!

What could be causing this?
Back to top
View user's profile Send private message
katfish
Tux's lil' helper
Tux's lil' helper


Joined: 14 Nov 2011
Posts: 119

PostPosted: Tue Oct 02, 2012 1:30 am    Post subject: Reply with quote

what happens when u add the third partition first as spare before growing to l5?
Back to top
View user's profile Send private message
GlemSom
n00b
n00b


Joined: 26 Oct 2004
Posts: 31

PostPosted: Mon Oct 08, 2012 1:01 pm    Post subject: Reply with quote

katfish wrote:
what happens when u add the third partition first as spare before growing to l5?


That still didn't work.

Though, I found the issue.
If a raid0 is created with more then 1 zone - reshaping is not supported. (If one partition is slightly larger then the others)

So, I had to dump all of my data out - re-create the array - and dump back in...
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum