sort multipath sectional data

Hi all,

I'm running a command on an ESXi server and the output for multipath device info is not in order. Can any of you SED or AWK gurus show me how I might sort the sectional data where both LUN paths are in order?

Output:

fc.20000000c9799e9a:10000000c9799e9a-fc.2001000402fc546c:5000402001fc546c-naa.6000402001fc546c637e40a300000000
Runtime Name: vmhba2:C0:T7:L61
Device: naa.6000402001fc546c637e40a300000000
Device Display Name: NEXSAN Fibre Channel Disk (naa.6000402001fc546c637e40a300000000)
Group State: active
Storage Array Type Path Config:
Path Selection Policy Path Config: {current: no; preferred: no}

fc.20000000c9799e9a:10000000c9799e9a-fc.2001000402fc546c:5000402001fc546c-naa.6000402001fc546c637e40e200000000
Runtime Name: vmhba2:C0:T7:L62
Device: naa.6000402001fc546c637e40e200000000
Device Display Name: NEXSAN Fibre Channel Disk (naa.6000402001fc546c637e40e2
Group State: active
Storage Array Type Path Config:
Path Selection Policy Path Config: {current: no; preferred: no}

fc.20000000c9799e9a:10000000c9799e9a-fc.2001000402fc546c:5000402101fc546c-naa.6000402001fc546c637e40a300000000
Runtime Name: vmhba2:C0:T5:L61
Device: naa.6000402001fc546c637e40a300000000
Device Display Name: NEXSAN Fibre Channel Disk (naa.6000402001fc546c637e40a300000000)
Group State: active
Storage Array Type Path Config:
Path Selection Policy Path Config: {current: yes; preferred: yes}

What I'd like to see:

fc.20000000c9799e9a:10000000c9799e9a-fc.2001000402fc546c:5000402101fc546c-naa.6000402001fc546c637e40a300000000
Runtime Name: vmhba2:C0:T5:L61
Device: naa.6000402001fc546c637e40a300000000
Device Display Name: NEXSAN Fibre Channel Disk (naa.6000402001fc546c637e40a300000000)
Group State: active
Storage Array Type Path Config:
Path Selection Policy Path Config: {current: yes; preferred: yes}

fc.20000000c9799e9a:10000000c9799e9a-fc.2001000402fc546c:5000402001fc546c-naa.6000402001fc546c637e40a300000000
Runtime Name: vmhba2:C0:T7:L61
Device: naa.6000402001fc546c637e40a300000000
Device Display Name: NEXSAN Fibre Channel Disk (naa.6000402001fc546c637e40a300000000)
Group State: active
Storage Array Type Path Config:
Path Selection Policy Path Config: {current: no; preferred: no}

fc.20000000c9799e9a:10000000c9799e9a-fc.2001000402fc546c:5000402001fc546c-naa.6000402001fc546c637e40e200000000
Runtime Name: vmhba2:C0:T7:L62
Device: naa.6000402001fc546c637e40e200000000
Device Display Name: NEXSAN Fibre Channel Disk (naa.6000402001fc546c637e40e2
Group State: active
Storage Array Type Path Config:
Path Selection Policy Path Config: {current: no; preferred: no}

Thanks,

Stovie1000

So which lines are LUN paths? Line 1 and 3 in every section?

The LUN path would be the second line; however, I would need all the info from each section starting with the fc line and ending with the Path Selection line.

I would just like to see both paths for the same LUN IDs and there sectional info follow each other instead of being randomly displayed from the output.

Guess there is no "|" in your file. (or you can replace it by any character which is not appear in your file.)

awk '{printf (/^$/)?$0"\n":$0"|" }' urfile |sort -t\| -k2  |tr "|" "\n"