How to configure software RAID on Dell Express Flash PCIe SSDs
Applies to:
---------------------------------------------------------------------------------------------------------------------------
Operating System(s) - Oracle Linux 6.x, RHEL 6.x
Server Platform(s) - PowerEdge R720, R820
Author:
---------------------------------------------------------------------------------------------------------------------------
Naveen Iyengar
Problem:
---------------------------------------------------------------------------------------------------------------------------
How to configure software RAID on Dell Express Flash PCIe SSDs
Solution:
--------------------------------------------------------------------------------------------------------------------------
1. Identify the Express Flash block devices– Dell’s Micron Express Flash drives show up as the following block devices in EL6.x OS
$> cat /proc/partitions
Major minor #blocks name
251 256 341873784 rssda
251 512 341873784 rssdb
2. Create a Partition – Use the fdisk linux utility as follows to create an 'fd' type partition on the Flash drives
$> fdisk –u /dev/rssda
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First sector (56-683747567, default 56: 128
Last sector, +sectors or +size…, default 683747567: <hit Enter>
Command (m for help): t
Selected partition 1
Hex code (type L to list codes): fd
Changed system type of partition 1 to fd (Linux raid autodetect)
Command (m for help): wq
The partition table has been altered!
$>
3. Create software RAID– Use the Linux utility tool called mdadm as follows to create the software RAID array on the Express Flash drives. The following example create a RAID1 using two Flash drives /dev/rssda1 and /dev/rssdb1.
$> mdadm --create /dev/md0 --level=mirror --raid-devices=2 /dev/rssd[ab]1
4. Viewing the details of the array: View the status of the multi disk array md0.
$> mdadm --detail /dev/md0
5. Make the array persistent across reboots: To add md0 to the configuration file so that it is recognized next time on boot, do the following:
$> mdadm -Es | grep md0
Check if the above command displays the details of the md0 array created. If not, try
$> mdadm -Es | grep “md/0”
Depending on which of the above two command works, run the appropriate command below to add info to the mdadm.conf file
$> mdadm -Es | grep md0 >> /etc/mdadm.conf
Or
$> mdadm -Es | grep “md/0” >> /etc/mdadm.conf
6. Check for resync complete: Run the --detail option to make sure that the two SSDs in the array are not in the Resync Status, or wait until it finishes resyncing before you run a test against them.
$> mdadm --detail /dev/md0
A. Deleting the array:
- To halt the array:
$> mdadm --stop /dev/md0 - Delete the superblock from all drives in the array
$> mdadm --zero-superblock /dev/sd[abc]1 - Edit /etc/mdadm.conf to delete any rows related to the deleted array(s)
NOTE | Thisarticleassumesthatthedisktobealignedalreadycontainsasingleprimarypartition.Ifthatisnotthecasethencreateanewsingleprimarypartitiononthediskbeforefollowingthestepsbelow. |
CAUTION | InasystemrunningtheLinuxoperatingsystem,alignthepartitiontablebeforedataiswrittentotheVolume/VirtualDisk(VD).ThepartitionmapisrewrittenandalldataontheVolume/VDisdestroyed. |
Atthecommandprompt,type:
- #>fdisk/dev/<block_device>
where <block_device> isthenameoftheblockdevicethatyouareadjusting.Forexample,iftheblockdeviceis /dev/sdb,type: fdisk/dev/sdb
Thesystemdisplaysthefollowingmessage:
Thenumberofcylindersforthisdiskissetto8782.Thereisnothingwrongwiththat,butthisislargerthan1024,andcouldincertainsetupscauseproblemswith:
1)softwarethatrunsatboottime(e.g.,oldversionsofLILO)2)bootingandpartitioningsoftwarefromotherOSs
(e.g.,DOSFDISK,OS/2FDISK)
a. Command(mforhelp):x #ToentertheexpertMode
b. Expertcommand(mforhelp):b #Tomovebeginningofdatainapartition
c. Partitionnumber(1-4):1 #Thepartitionnumbertobealigned
d. Newbeginningofdata(128-xxxxx,default128):128NOTE 128blocksor64KBisthedefaultStripeElementSizeofEqualLogicPSSeriesandPowerVaultMDLineofstoragearrays.Henceweadjustthebeginningofthedatapartitionto128blocks.
e. Expertcommand(mforhelp):wq #writeandquit Repeatstep1forallthedisksthatneedtobealigned
Runthefollowingcommandtore-scanallthepartitions:
#>partprobe
Verifythatthepartitionhasbeenalignedbyrunningthefollowingcommand:
#>fdisk-ul/dev/<block_device>
where <block_device> isthenameoftheblockdevicethatwealignedthepartitionof.Belowisanexampleofasampleoutputoftheabovecommandonablockdevicethathasbeenaligned.Ifyoupartitionisproperlyalignedthenyouwillsee 128 undertheStartcolumnagainstyourpartition.
Disk/dev/mapper/mpath70:53.6GB,53697576960bytes
255heads,63sectors/track,6528cylinders,total104878080sectors
Units=sectorsof1*512=512bytes
DeviceBoot Start End Blocks Id System/dev/mapper/mpath70p1 128 104872319 52436096 83 Linux
- Ifrequired,rebootthesystemforthekerneltobeabletore-readthenewpartitiontableorifyoudonotseeyournewlycreatedalignedpartition.