[lug] Convert swap from raid0 to raid1

dio2002 at indra.com dio2002 at indra.com
Thu Jul 26 01:44:20 MDT 2007


>> You can have two completely seperate swap partitions that aren't
>> mirrored.  In fstab, ass prio=1 to both of them and presto, you have
>> swap partition load balancing without mirroring.  But I digress...
>>
>> Since it's swap and not data it should be easy to convert.
>>
>> Turn off swap with swapoff (might want to be in single user mode).
>> Nuke the metadevice with mdadm
>
> how do you nuke the metadevice?  i've searched the mdadm manpage and there
> is no option for that.  the only thing i can think of is to simply
> recreate the new array using the old array.

fyi, I just went ahead and recreated the new array definition on top of
the old md and it replaces it:

# mdadm --create /dev/md2 --level=1 --raid-devices=2 /dev/sd[ab]3
mdadm: /dev/sda3 appears to be part of a raid array:
    level=raid0 devices=2 ctime=Tue Jul 24 21:09:28 2007
mdadm: /dev/sdb3 appears to be part of a raid array:
    level=raid0 devices=2 ctime=Tue Jul 24 21:09:28 2007
Continue creating array?
Continue creating array? (y/n) y
mdadm: array /dev/md2 started.

#  mdadm --detail --scan /dev/md2
ARRAY /dev/md2 level=raid1 num-devices=2
UUID=f6a27223:8a46b294:fec765b2:bc207993

still curious how you would manually nuke the md if you don't mind sharing.




More information about the LUG mailing list