SDB:DMRAID
This article describes how to reuse disks after removing them from a DMRAID software RAID array.
Situation
You have a system with a "simple" RAID controller on the system board or an expansion card. You'd like to use the disks individually or in a different system.
If you just remove the disks and attach them to a different controller, the metadata associated with the old RAID arrays will be read by the DMRAID subsystem and the RAID array will be reassembled automatically. If you still have the RAID controller hardware, you can use it to release the disks. If you don't have the RAID controller hardware, or would just prefer not to reboot in order to use the disks, this article is for you.
openSUSE Bug #653081 describes one such instance of this issue.
Procedure
This article describes several solutions:
with YaST2
[Someone with experience doing this with YaST, please expand.]
on the command line
The easiest way to clean up the old RAID disks is by using the dmraid command. This command is the direct way to interact with dmraid devices. It can create, activate, and destroy software RAID arrays using the formats specific to simple RAID controller hardware. If all you're looking to do is release the disks, skip to the "deactivation" step and go from there.
To list the formats that dmraid will claim as its own, use the dmraid -l command:
~ # dmraid -l asr : Adaptec HostRAID ASR (0,1,10) ddf1 : SNIA DDF1 (0,1,4,5,linear) hpt37x : Highpoint HPT37X (S,0,1,10,01) hpt45x : Highpoint HPT45X (S,0,1,10) isw : Intel Software RAID (0,1,5,01) jmicron : JMicron ATARAID (S,0,1) lsi : LSI Logic MegaRAID (0,1,10) nvidia : NVidia RAID (S,0,1,10,5) pdc : Promise FastTrack (S,0,1,10) sil : Silicon Image(tm) Medley(tm) (0,1,10) via : VIA Software RAID (S,0,1,10) dos : DOS partitions on SW RAIDs
Using the dmraid -r command, it's possible to list which devices are currently claimed for dmraid's RAID arrays. As an example, here are a pair of 60 GB disks configured as a RAID1 array for an Intel controller.
~ # dmraid -r /dev/sdc: isw, "isw_dbhjdbifda", GROUP, ok, 125045422 sectors, data@ 0 /dev/sdb: isw, "isw_dbhjdbifda", GROUP, ok, 976773166 sectors, data@ 0
To create a test RAID set, you use the dmraid -C command.
~ # dmraid -f isw -C test --type 1 --disks /dev/sdb,/dev/sdc Create a RAID set with ISW metadata format RAID name: test RAID type: RAID1 RAID size: 59G (125035870 blocks) DISKS: /dev/sdb, /dev/sdc, About to create a RAID set with the above settings. Continue ? [y/n] :y
Each DMRAID array has a unique prefix, after which your RAID set name is appended. To find out the prefix, use the dmraid -s command.
~ # dmraid -s *** Group superset isw_dbhjdbjhca --> Subset name : isw_dbhjdbjhca_test size : 125035776 stride : 128 type : mirror status : ok subsets: 0 devs : 2 spares : 0
Now that the array is created, it only exists in on-disk metadata. If you were to reboot right now, the array will be activated when the system returns. To activate it manually, use the dmraid -a y command with the raid set name.
~ # dmraid -a y isw_dbhjdbjhca_test RAID set "isw_dbhjdbjhca_test" was activated device "isw_dbhjdbjhca_test" is now registered with dmeventd for monitoring
To deactivate the array, use the dmraid -a n command.
~ # dmraid -a n isw_dbhjdbjhca_test ERROR: device "isw_dbhjdbjhca_test" is not currently being monitored
To clear out the metadata and free the devices from dmraid, use the dmraid -x command with the list of devices you want to release.
~ # dmraid -x isw_dbhjdbjhca_test About to delete RAID set isw_dbhjdbjhca_test WARNING: The metadata stored on the raidset(s) will not be accessible after deletion Do you want to continue ? [y/n] :y