Re: convert raid10 to raid0

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxxx> 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@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux