Close

Short-Sizing StorNext (cvfs) LUNs

Situation

Every now and then you may have seen it or never have … lucky you. Under certain circumstances you may face the problem that you have configured your RAID with the same LUN size or even have used the wizard of the RAID vendor and StorNext (and other tools) will show you a different size on the LUNs in the OS.

Details

As a starting point, let’s assume our configured RAID provides 4 LUNs to the system. Two of those LUNs have a sector size of 9065074317 and two LUNs have a sector size of 9065074333. This can be seen in the output of /usr/bin/cvfs/cvlabel -l as follows:

/dev/sde [ABC   xyz] SNFS "FS1_DATA0"  Sectors: 9065074333. Sector_Size 512.  Maximum sectors: 9065074333.
/dev/sdf [ABC   xyz] SNFS "FS1_DATA1"  Sectors: 9065074317. Sector_Size 512.  Maximum sectors: 9065074317.
/dev/sdg [ABC   XYZ] SNFS "FS1_DATA2"  Sectors: 9065074333. Sector_Size 512.  Maximum sectors: 9065074333.
/dev/sdh [ABC   XYZ] SNFS "FS1_DATA3"  Sectors: 9065074317. Sector_Size 512.  Maximum sectors: 9065074317.

While we want to have all LUNs in one single stripegroup for best performance we have to make them match or StorNext will not allow to build the file system. Therefore our desire is to have all LUNs be of size 9065074317 sectors (the least common size in this example).  Now we can go back to the RAID configuration and poke around to find the reason and may start over or we can use a little trick and short-size the LUNs with StorNext’s cvlabel. How to do this is shown in this small example to short-size the LUN(s) which do not meet the criteria:

  • Unlabel the incorrect LUN(s) if they already have labels
    cvlabel -u FS1_DATA1 ; cvlabel -u FS1_DATA2
  • Create a new labels file cvlabel -c > /tmp/new_labels :
    CvfsDisk_UNKNOWN /dev/sde    # host  lun 0 sectors 9065074333 sector_size 512 inquiry
    FS1_DATA1 /dev/sdf    # host  lun 1 sectors 9065074317 sector_size 512 inquiry
    CvfsDisk_UNKNOWN /dev/sdg    # host  lun 2 sectors 9065074333 sector_size 512 inquiry
    FS1_DATA3 /dev/sdh    # host  lun 3 sectors 9065074317 sector_size 512 inquiry
  • Edit the /tmp/new_labels file, just the entries that we care to change (in this case just /dev/sde and /dev/sdg), adding the desired size of the array (in sectors) as the last valid element on the line (i.e. before the # character):
    FS1_DATA0 /dev/sde 9065074317  # host  lun 0 sectors 9065074333 sector_size 512 inquiry
    FS1_DATA1 /dev/sdf    # host  lun 1 sectors 9065074317 sector_size 512 inquiry
    FS1_DATA2 /dev/sdg 9065074317  # host  lun 2 sectors 9065074333 sector_size 512 inquiry
    FS1_DATA3 /dev/sdh    # host  lun 3 sectors 9065074317 sector_size 512 inquiry
  • Run the cvlabel tool again: cvlabel /tmp/new_labels and confirm the changes
  • Review resulting labels cvlabel -l:
    /dev/sde   [-stuff-]  SNFS  "FS1_DATA0"  Sectors: 9065074317. Sector_Size: 512.  Maximum sectors: 9065074333.
    /dev/sdf   [-stuff-]  SNFS  "FS1_DATA1"  Sectors: 9065074317. Sector_Size: 512.  Maximum sectors: 9065074317.
    /dev/sdg   [-stuff-]  SNFS  "FS1_DATA2"  Sectors: 9065074317. Sector_Size: 512.  Maximum sectors: 9065074333.
    /dev/sdh   [-stuff-]  SNFS  "FS1_DATA3"  Sectors: 9065074317. Sector_Size: 512.  Maximum sectors: 9065074317.

    While /dev/sde and /dev/sdg still have more “Maximum sectors” than the other LUNs, it’s reported size to the file system is now exactly that of the other arrays. Now you will be able to have all 4 LUNs in the same stripegroup and can build the file system.

Leave a Reply

Your email address will not be published.