* convert raid10 to raid0
@ 2010-07-07 19:29 Tóth Csaba
2010-07-07 22:50 ` Neil Brown
2010-07-07 22:51 ` Tóth Csaba
0 siblings, 2 replies; 8+ messages in thread
From: Tóth Csaba @ 2010-07-07 19:29 UTC (permalink / raw)
To: linux-raid
Hey List,
i have a serious problem: have a file server with 4 disk (4x750GB),
using them in a software RAID10 array. One of the HDDs have a bad sector
(because some administration problems, i cannot replace them), and the
motherboard sometimes drops the connection with two HDDs. Not with the
same as the bad sector has, but with a resync i always managed the
problem. But now 3 drive form the RAID10 array dropped.
In the past the sdc6 and the sdd6 partitions were the partitions i
resynced the others, so i know exactly where to look for the proper
datas. Can i use them as a RAID0 array somehow?
In past mdadm warning letters i saw the config:
Personalities : [linear] [raid0] [raid1] [raid10] [raid6] [raid5]
[raid4] [multipath] [faulty]
md5 : active raid10 sdc6[0] sdd6[3] sdb6[1](F) sda6[2](F)
1434619904 blocks super 1.1 512K chunks 2 near-copies [4/2] [U__U]
md1 : active raid1 sdb5[0] sdc5[1]
14763635 blocks super 1.1 [2/2] [UU]
md0 : active raid1 sdd5[0] sda5[2](F)
14659200 blocks [2/1] [U_]
unused devices: <none>
Now i have:
minerva ~ # cat /proc/mdstat
Personalities : [linear] [raid0] [raid1] [raid10] [raid6] [raid5]
[raid4] [multipath] [faulty]
md5 : inactive sdd6[3]
717310119 blocks super 1.1
md1 : active raid1 sdc5[0] sdb5[1]
14763635 blocks super 1.1 [2/2] [UU]
md0 : active raid1 sda5[1] sdd5[0]
14659200 blocks [2/2] [UU]
unused devices: <none>
minerva ~ # mdadm --detail /dev/md5
/dev/md5:
Version : 1.1
Creation Time : Thu Nov 26 14:50:07 2009
Raid Level : raid10
Used Dev Size : 717309952 (684.08 GiB 734.53 GB)
Raid Devices : 4
Total Devices : 1
Persistence : Superblock is persistent
Update Time : Wed Jul 7 10:34:32 2010
State : active, FAILED, Not Started
Active Devices : 1
Working Devices : 1
Failed Devices : 0
Spare Devices : 0
Layout : near=2
Chunk Size : 512K
Name : minerva:5 (local to host minerva)
UUID : a73f5902:accc2488:aecfdc14:05a6e2f4
Events : 3981420
Number Major Minor RaidDevice State
0 0 0 0 removed
1 0 0 1 removed
2 0 0 2 removed
3 8 54 3 active sync /dev/sdd6
If i try to add sdc6 to the md5 array it fails, because it tries to add
as a fifth device:
minerva ~ # mdadm /dev/md5 -a /dev/sdc6
mdadm: add new device failed for /dev/sdc6 as 4: Invalid argument
Please help, i don't want to destroy the datas, and i have never job
with RAID10 under linux.
thanks in advance,
regards,
Csaba
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: convert raid10 to raid0
2010-07-07 19:29 convert raid10 to raid0 Tóth Csaba
@ 2010-07-07 22:50 ` Neil Brown
2010-07-07 23:34 ` Tóth Csaba
2010-07-08 7:58 ` Tóth Csaba
2010-07-07 22:51 ` Tóth Csaba
1 sibling, 2 replies; 8+ messages in thread
From: Neil Brown @ 2010-07-07 22:50 UTC (permalink / raw)
To: Tóth Csaba; +Cc: linux-raid
On Wed, 07 Jul 2010 21:29:49 +0200
Tóth Csaba <csaba.toth@i3rendszerhaz.hu> wrote:
> Hey List,
>
> i have a serious problem: have a file server with 4 disk (4x750GB),
> using them in a software RAID10 array. One of the HDDs have a bad sector
> (because some administration problems, i cannot replace them), and the
> motherboard sometimes drops the connection with two HDDs. Not with the
> same as the bad sector has, but with a resync i always managed the
> problem. But now 3 drive form the RAID10 array dropped.
>
> In the past the sdc6 and the sdd6 partitions were the partitions i
> resynced the others, so i know exactly where to look for the proper
> datas. Can i use them as a RAID0 array somehow?
It should be sufficient to:
mdadm -S /dev/md5
mdadm -C /dev/md5 --level raid0 --raid-devices 2 --chunk 512 \
--metadata=1.1 /dev/sdc6 /dev/sdd6
to get your data available.
There is a possible small complication though. If you use a different
version of mdadm to the one you used to create the array at first, it might
choose a different 'data offset'.
To be sure this doesn't happen, use
mdadm -E /dev/sdc6
and take note of the "Data Offset". It would probably be a good idea to keep
a copy of "mdadm -E" of all of the devices, just to be on the same side.
Then after you create the raid0, use the same command
mdadm -E /dev/sdc6
to check the Data Offset again and make sure it is the same.
I suspect it will be, so everything will be fine.
However if it isn't don't try to access the array. Post the details and I'll
figure out what to do next.
NeilBrown
> In past mdadm warning letters i saw the config:
>
> Personalities : [linear] [raid0] [raid1] [raid10] [raid6] [raid5]
> [raid4] [multipath] [faulty]
> md5 : active raid10 sdc6[0] sdd6[3] sdb6[1](F) sda6[2](F)
> 1434619904 blocks super 1.1 512K chunks 2 near-copies [4/2] [U__U]
>
> md1 : active raid1 sdb5[0] sdc5[1]
> 14763635 blocks super 1.1 [2/2] [UU]
>
> md0 : active raid1 sdd5[0] sda5[2](F)
> 14659200 blocks [2/1] [U_]
>
> unused devices: <none>
>
>
> Now i have:
>
> minerva ~ # cat /proc/mdstat
> Personalities : [linear] [raid0] [raid1] [raid10] [raid6] [raid5]
> [raid4] [multipath] [faulty]
> md5 : inactive sdd6[3]
> 717310119 blocks super 1.1
>
> md1 : active raid1 sdc5[0] sdb5[1]
> 14763635 blocks super 1.1 [2/2] [UU]
>
> md0 : active raid1 sda5[1] sdd5[0]
> 14659200 blocks [2/2] [UU]
>
> unused devices: <none>
> minerva ~ # mdadm --detail /dev/md5
> /dev/md5:
> Version : 1.1
> Creation Time : Thu Nov 26 14:50:07 2009
> Raid Level : raid10
> Used Dev Size : 717309952 (684.08 GiB 734.53 GB)
> Raid Devices : 4
> Total Devices : 1
> Persistence : Superblock is persistent
>
> Update Time : Wed Jul 7 10:34:32 2010
> State : active, FAILED, Not Started
> Active Devices : 1
> Working Devices : 1
> Failed Devices : 0
> Spare Devices : 0
>
> Layout : near=2
> Chunk Size : 512K
>
> Name : minerva:5 (local to host minerva)
> UUID : a73f5902:accc2488:aecfdc14:05a6e2f4
> Events : 3981420
>
> Number Major Minor RaidDevice State
> 0 0 0 0 removed
> 1 0 0 1 removed
> 2 0 0 2 removed
> 3 8 54 3 active sync /dev/sdd6
>
>
>
>
> If i try to add sdc6 to the md5 array it fails, because it tries to add
> as a fifth device:
>
> minerva ~ # mdadm /dev/md5 -a /dev/sdc6
> mdadm: add new device failed for /dev/sdc6 as 4: Invalid argument
>
>
>
> Please help, i don't want to destroy the datas, and i have never job
> with RAID10 under linux.
>
> thanks in advance,
> regards,
> Csaba
> --
> To unsubscribe from this list: send the line "unsubscribe linux-raid" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: convert raid10 to raid0
2010-07-07 19:29 convert raid10 to raid0 Tóth Csaba
2010-07-07 22:50 ` Neil Brown
@ 2010-07-07 22:51 ` Tóth Csaba
1 sibling, 0 replies; 8+ messages in thread
From: Tóth Csaba @ 2010-07-07 22:51 UTC (permalink / raw)
To: linux-raid
2010.07.07. 21:29 keltezéssel, Tóth Csaba írta:
> Hey List,
>
> [...]
my mdadm -E:
minerva ~ # mdadm -E /dev/sdc6
/dev/sdc6:
Magic : a92b4efc
Version : 1.1
Feature Map : 0x0
Array UUID : a73f5902:accc2488:aecfdc14:05a6e2f4
Name : minerva:5 (local to host minerva)
Creation Time : Thu Nov 26 14:50:07 2009
Raid Level : raid10
Raid Devices : 4
Avail Dev Size : 1434619910 (684.08 GiB 734.53 GB)
Array Size : 2869239808 (1368.16 GiB 1469.05 GB)
Used Dev Size : 1434619904 (684.08 GiB 734.53 GB)
Data Offset : 592 sectors
Super Offset : 0 sectors
State : clean
Device UUID : a8f10e59:dbf96c47:4c4eb9bd:2db4c161
Update Time : Wed Jul 7 10:34:32 2010
Checksum : df7a8ba6 - correct
Events : 0
Layout : near=2
Chunk Size : 512K
Device Role : spare
Array State : ...A ('A' == active, '.' == missing)
minerva ~ # mdadm -E /dev/sdd6
/dev/sdd6:
Magic : a92b4efc
Version : 1.1
Feature Map : 0x0
Array UUID : a73f5902:accc2488:aecfdc14:05a6e2f4
Name : minerva:5 (local to host minerva)
Creation Time : Thu Nov 26 14:50:07 2009
Raid Level : raid10
Raid Devices : 4
Avail Dev Size : 1434620238 (684.08 GiB 734.53 GB)
Array Size : 2869239808 (1368.16 GiB 1469.05 GB)
Used Dev Size : 1434619904 (684.08 GiB 734.53 GB)
Data Offset : 264 sectors
Super Offset : 0 sectors
State : clean
Device UUID : 2536b63d:4cb4de23:1b8e3157:f4031701
Update Time : Wed Jul 7 10:34:32 2010
Checksum : d99dda94 - correct
Events : 3981420
Layout : near=2
Chunk Size : 512K
Device Role : Active device 3
Array State : ...A ('A' == active, '.' == missing)
thanks in advance,
Csaba
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: convert raid10 to raid0
2010-07-07 22:50 ` Neil Brown
@ 2010-07-07 23:34 ` Tóth Csaba
2010-07-08 7:58 ` Tóth Csaba
1 sibling, 0 replies; 8+ messages in thread
From: Tóth Csaba @ 2010-07-07 23:34 UTC (permalink / raw)
To: Neil Brown; +Cc: linux-raid
Hi,
2010.07.08. 0:50 keltezéssel, Neil Brown írta:
> On Wed, 07 Jul 2010 21:29:49 +0200
> Tóth Csaba <csaba.toth@i3rendszerhaz.hu> wrote:
>
>> Hey List,
>>
>> i have a serious problem: have a file server with 4 disk (4x750GB),
>> using them in a software RAID10 array. One of the HDDs have a bad sector
>> (because some administration problems, i cannot replace them), and the
>> motherboard sometimes drops the connection with two HDDs. Not with the
>> same as the bad sector has, but with a resync i always managed the
>> problem. But now 3 drive form the RAID10 array dropped.
>>
>> In the past the sdc6 and the sdd6 partitions were the partitions i
>> resynced the others, so i know exactly where to look for the proper
>> datas. Can i use them as a RAID0 array somehow?
>
> It should be sufficient to:
> mdadm -S /dev/md5
> mdadm -C /dev/md5 --level raid0 --raid-devices 2 --chunk 512 \
> --metadata=1.1 /dev/sdc6 /dev/sdd6
>
> to get your data available.
> There is a possible small complication though. If you use a different
> version of mdadm to the one you used to create the array at first, it might
> choose a different 'data offset'.
> To be sure this doesn't happen, use
>
> mdadm -E /dev/sdc6
>
> and take note of the "Data Offset". It would probably be a good idea to keep
> a copy of "mdadm -E" of all of the devices, just to be on the same side.
>
> Then after you create the raid0, use the same command
> mdadm -E /dev/sdc6
> to check the Data Offset again and make sure it is the same.
> I suspect it will be, so everything will be fine.
> However if it isn't don't try to access the array. Post the details and I'll
> figure out what to do next.
>
i have made a small test case:
DTADIR=/mnt/data
MDF=/dev/md8
dd bs=512 count=180000 if=/dev/zero of=${DTADIR}/a
dd bs=512 count=180000 if=/dev/zero of=${DTADIR}/b
dd bs=512 count=180000 if=/dev/zero of=${DTADIR}/c
dd bs=512 count=180000 if=/dev/zero of=${DTADIR}/d
losetup /dev/loop0 ${DTADIR}/a
losetup /dev/loop1 ${DTADIR}/b
losetup /dev/loop2 ${DTADIR}/c
losetup /dev/loop3 ${DTADIR}/d
mdadm --create ${MDF} --level=10 --metadata=1.1 \
--raid-devices=4 /dev/loop0 /dev/loop1 /dev/loop2 /dev/loop3
mkfs.ext4 ${MDF}
mkdir ${DTADIR}/tmp
mount ${MDF} ${DTADIR}/tmp
cp -a /etc ${DTADIR}/tmp
umount ${MDF}
mdadm -S ${MDF}
mdadm -C /dev/md5 --level raid0 --raid-devices 2 --chunk 512 \
--metadata=1.1 /dev/loop0 /dev/loop3
mount ${MDF} ${DTADIR}/tmp
ls -al ${DTADIR}/tmp
umount ${MDF}
mdadm -S ${MDF}
losetup --detach /dev/loop0 /dev/loop1 /dev/loop2 /dev/loop3
i used loop0 and loop3 to construct the raid0 array, because they were
at the same (0 and 3) position than the devices i had in my real raid10
array. so this should work, but not :(
but after i made a raid0 array, and than recreate the raid10 array it
worked well. can't i create a raid10 array with two drives?
regards,
Csaba
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: convert raid10 to raid0
2010-07-07 22:50 ` Neil Brown
2010-07-07 23:34 ` Tóth Csaba
@ 2010-07-08 7:58 ` Tóth Csaba
2010-07-08 8:27 ` Tóth Csaba
1 sibling, 1 reply; 8+ messages in thread
From: Tóth Csaba @ 2010-07-08 7:58 UTC (permalink / raw)
To: Neil Brown; +Cc: linux-raid
2010.07.08. 0:50 keltezéssel, Neil Brown írta:
> Then after you create the raid0, use the same command
> mdadm -E /dev/sdc6
> to check the Data Offset again and make sure it is the same.
> I suspect it will be, so everything will be fine.
> However if it isn't don't try to access the array. Post the details and I'll
> figure out what to do next.
>
It doesn't work, and the data offsets are different (in the mean time i
figured out that i made a mistake, and not sdc6 but sdb6 is the other
correct device):
Old:
sdb6: 592 sectors
sdd6: 264 sectors
New:
sdb6: 2048 sectors
sdd6: 2048 sectors
if i modify the source code of the mdadm, but don't know how to make it
to set differently based on the partition..
thanks in advance!
Csaba
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: convert raid10 to raid0
2010-07-08 7:58 ` Tóth Csaba
@ 2010-07-08 8:27 ` Tóth Csaba
2010-07-08 23:15 ` Neil Brown
0 siblings, 1 reply; 8+ messages in thread
From: Tóth Csaba @ 2010-07-08 8:27 UTC (permalink / raw)
To: Neil Brown; +Cc: linux-raid
2010.07.08. 9:58 keltezéssel, Tóth Csaba írta:
> 2010.07.08. 0:50 keltezéssel, Neil Brown írta:
>> Then after you create the raid0, use the same command
>> mdadm -E /dev/sdc6
>> to check the Data Offset again and make sure it is the same.
>> I suspect it will be, so everything will be fine.
>> However if it isn't don't try to access the array. Post the details and I'll
>> figure out what to do next.
>>
>
> It doesn't work, [...]
forget to explain what i did: my idea was to create a new array with
--assume-clean, than kick out the knowed bad members:
minerva data-bck # mdadm --create /dev/md5 --assume-clean --metadata=1.1
--level=10 --raid-devices=4 /dev/sdb6 /dev/sda6 /dev/sdc6 /dev/sdd6
mdadm: /dev/sdb6 appears to be part of a raid array:
level=raid10 devices=4 ctime=Thu Jul 8 09:47:43 2010
mdadm: /dev/sda6 appears to be part of a raid array:
level=raid10 devices=4 ctime=Thu Jul 8 09:47:43 2010
mdadm: /dev/sdc6 appears to be part of a raid array:
level=raid10 devices=4 ctime=Thu Jul 8 09:47:43 2010
mdadm: /dev/sdd6 appears to be part of a raid array:
level=raid10 devices=4 ctime=Thu Jul 8 09:47:43 2010
Continue creating array? yes
mdadm: array /dev/md5 started.
minerva data-bck #
minerva data-bck # man mdadm
minerva data-bck # mdadm /dev/md5 --fail /dev/sda6 --fail /dev/sdc6
mdadm: set /dev/sda6 faulty in /dev/md5
mdadm: set /dev/sdc6 faulty in /dev/md5
minerva data-bck # cat /proc/mdstat
Personalities : [linear] [raid0] [raid1] [raid10] [raid6] [raid5]
[raid4] [multipath] [faulty]
md5 : active raid10 sdd6[3] sdc6[2](F) sda6[1](F) sdb6[0]
1434617856 blocks super 1.1 512K chunks 2 near-copies [4/2] [U__U]
this is exactly the same layout as i had before, just the data offset
doesn't match.
regards,
Csaba
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: convert raid10 to raid0
2010-07-08 8:27 ` Tóth Csaba
@ 2010-07-08 23:15 ` Neil Brown
2010-07-12 13:26 ` Tóth Csaba
0 siblings, 1 reply; 8+ messages in thread
From: Neil Brown @ 2010-07-08 23:15 UTC (permalink / raw)
To: Tóth Csaba; +Cc: linux-raid
On Thu, 08 Jul 2010 10:27:46 +0200
Tóth Csaba <csaba.toth@i3rendszerhaz.hu> wrote:
> 2010.07.08. 9:58 keltezéssel, Tóth Csaba írta:
> > 2010.07.08. 0:50 keltezéssel, Neil Brown írta:
> >> Then after you create the raid0, use the same command
> >> mdadm -E /dev/sdc6
> >> to check the Data Offset again and make sure it is the same.
> >> I suspect it will be, so everything will be fine.
> >> However if it isn't don't try to access the array. Post the details and I'll
> >> figure out what to do next.
> >>
> >
> > It doesn't work, [...]
>
> forget to explain what i did: my idea was to create a new array with
> --assume-clean, than kick out the knowed bad members:
>
> minerva data-bck # mdadm --create /dev/md5 --assume-clean --metadata=1.1
> --level=10 --raid-devices=4 /dev/sdb6 /dev/sda6 /dev/sdc6 /dev/sdd6
> mdadm: /dev/sdb6 appears to be part of a raid array:
> level=raid10 devices=4 ctime=Thu Jul 8 09:47:43 2010
> mdadm: /dev/sda6 appears to be part of a raid array:
> level=raid10 devices=4 ctime=Thu Jul 8 09:47:43 2010
> mdadm: /dev/sdc6 appears to be part of a raid array:
> level=raid10 devices=4 ctime=Thu Jul 8 09:47:43 2010
> mdadm: /dev/sdd6 appears to be part of a raid array:
> level=raid10 devices=4 ctime=Thu Jul 8 09:47:43 2010
> Continue creating array? yes
> mdadm: array /dev/md5 started.
> minerva data-bck #
> minerva data-bck # man mdadm
> minerva data-bck # mdadm /dev/md5 --fail /dev/sda6 --fail /dev/sdc6
> mdadm: set /dev/sda6 faulty in /dev/md5
> mdadm: set /dev/sdc6 faulty in /dev/md5
> minerva data-bck # cat /proc/mdstat
> Personalities : [linear] [raid0] [raid1] [raid10] [raid6] [raid5]
> [raid4] [multipath] [faulty]
> md5 : active raid10 sdd6[3] sdc6[2](F) sda6[1](F) sdb6[0]
> 1434617856 blocks super 1.1 512K chunks 2 near-copies [4/2] [U__U]
>
>
> this is exactly the same layout as i had before, just the data offset
> doesn't match.
>
OK, there are two things you can do - both might be interesting.
1/ You can temporarily adjust the data offset by writing directly to sysfs.
cd /sys/block/md5/md
echo inactive > array_state
echo 592 > dev-sdb6/offset
echo 264 > dev-sdd6/offset
echo readonly > array_state
Now you should be able to examine you data and assure yourself that it is
all there. However this doesn't change the metadata so when you stop and
restart the array the offset will be back where it started.
2/ hack the code in 'super1.c' and re-create the array.
in write_init_super1, after the 'switch' statement that set data_offset,
put
if (strcmp(di->devname, "/dev/sdb6") ==0) sb->data_offset = __cpu_to_le64(592);
if (strcmp(di->devname, "/dev/sdd6") ==0) sb->data_offset = __cpu_to_le64(264);
ofcourse you should check that code and make sure you agree that I have
written it correctly.
I plan to enhance mdadm so you can 'recreate' and array - it then takes
offsets etc out of current metadata and only changes the bits you ask it to
change. Had I done this already this would have been a lot easier for you,
but unfortunately I haven't.
good luck,
NeilBrown
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: convert raid10 to raid0
2010-07-08 23:15 ` Neil Brown
@ 2010-07-12 13:26 ` Tóth Csaba
0 siblings, 0 replies; 8+ messages in thread
From: Tóth Csaba @ 2010-07-12 13:26 UTC (permalink / raw)
To: Neil Brown; +Cc: linux-raid
Hey there,
thanks for help, we modified the mdadm's source code, and everything
worked fine. You saved us!! :)))
best wishes,
Csaba
2010.07.09. 1:15 keltezéssel, Neil Brown írta:
> On Thu, 08 Jul 2010 10:27:46 +0200
> Tóth Csaba <csaba.toth@i3rendszerhaz.hu> wrote:
>
>> 2010.07.08. 9:58 keltezéssel, Tóth Csaba írta:
>>> 2010.07.08. 0:50 keltezéssel, Neil Brown írta:
>>>> Then after you create the raid0, use the same command
>>>> mdadm -E /dev/sdc6
>>>> to check the Data Offset again and make sure it is the same.
>>>> I suspect it will be, so everything will be fine.
>>>> However if it isn't don't try to access the array. Post the details and I'll
>>>> figure out what to do next.
>>>>
>>>
>>> It doesn't work, [...]
>>
>> forget to explain what i did: my idea was to create a new array with
>> --assume-clean, than kick out the knowed bad members:
>>
>> minerva data-bck # mdadm --create /dev/md5 --assume-clean --metadata=1.1
>> --level=10 --raid-devices=4 /dev/sdb6 /dev/sda6 /dev/sdc6 /dev/sdd6
>> mdadm: /dev/sdb6 appears to be part of a raid array:
>> level=raid10 devices=4 ctime=Thu Jul 8 09:47:43 2010
>> mdadm: /dev/sda6 appears to be part of a raid array:
>> level=raid10 devices=4 ctime=Thu Jul 8 09:47:43 2010
>> mdadm: /dev/sdc6 appears to be part of a raid array:
>> level=raid10 devices=4 ctime=Thu Jul 8 09:47:43 2010
>> mdadm: /dev/sdd6 appears to be part of a raid array:
>> level=raid10 devices=4 ctime=Thu Jul 8 09:47:43 2010
>> Continue creating array? yes
>> mdadm: array /dev/md5 started.
>> minerva data-bck #
>> minerva data-bck # man mdadm
>> minerva data-bck # mdadm /dev/md5 --fail /dev/sda6 --fail /dev/sdc6
>> mdadm: set /dev/sda6 faulty in /dev/md5
>> mdadm: set /dev/sdc6 faulty in /dev/md5
>> minerva data-bck # cat /proc/mdstat
>> Personalities : [linear] [raid0] [raid1] [raid10] [raid6] [raid5]
>> [raid4] [multipath] [faulty]
>> md5 : active raid10 sdd6[3] sdc6[2](F) sda6[1](F) sdb6[0]
>> 1434617856 blocks super 1.1 512K chunks 2 near-copies [4/2] [U__U]
>>
>>
>> this is exactly the same layout as i had before, just the data offset
>> doesn't match.
>>
>
> OK, there are two things you can do - both might be interesting.
>
> 1/ You can temporarily adjust the data offset by writing directly to sysfs.
>
> cd /sys/block/md5/md
> echo inactive > array_state
> echo 592 > dev-sdb6/offset
> echo 264 > dev-sdd6/offset
> echo readonly > array_state
>
> Now you should be able to examine you data and assure yourself that it is
> all there. However this doesn't change the metadata so when you stop and
> restart the array the offset will be back where it started.
>
> 2/ hack the code in 'super1.c' and re-create the array.
> in write_init_super1, after the 'switch' statement that set data_offset,
> put
> if (strcmp(di->devname, "/dev/sdb6") ==0) sb->data_offset = __cpu_to_le64(592);
> if (strcmp(di->devname, "/dev/sdd6") ==0) sb->data_offset = __cpu_to_le64(264);
>
> ofcourse you should check that code and make sure you agree that I have
> written it correctly.
>
> I plan to enhance mdadm so you can 'recreate' and array - it then takes
> offsets etc out of current metadata and only changes the bits you ask it to
> change. Had I done this already this would have been a lot easier for you,
> but unfortunately I haven't.
>
> good luck,
> NeilBrown
>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2010-07-12 13:26 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-07 19:29 convert raid10 to raid0 Tóth Csaba
2010-07-07 22:50 ` Neil Brown
2010-07-07 23:34 ` Tóth Csaba
2010-07-08 7:58 ` Tóth Csaba
2010-07-08 8:27 ` Tóth Csaba
2010-07-08 23:15 ` Neil Brown
2010-07-12 13:26 ` Tóth Csaba
2010-07-07 22:51 ` Tóth Csaba
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox