Jump to content

iSCSI lun / Volume RESIZE / Growing / Extending

  • Please log in to reply
No replies to this topic

#1 fireheadman



  • Guests
  • PipPip
  • 15 posts

Posted 29 February 2012 - 05:32 PM

I have searched the forum up and down for how to correctly expand or grow an iSCSI lun, there doesn't seem to be any good info, so here it is....

In Openfiler, you initially create a Volume (iscsi)... let say at 50G
Then you find out you need more space on that filesystem...   You go into the iscsi lun (using the edit button) and add +50G to it, now OF says the lun is 100G.

You go back to your client (in mycase, I have VMware ESXi 5 and a CentOS 6.2 server).   Both are reporting the old values of 50G    [Side note, I have 2 different luns... one point to ESXi and the other to CentOS].
I tried the following to get the client(s) to recognize the new size of 100G:
  rebooting client   (no good)
  removing the iscsi config (initiator) on the client and re-adding the iscsi lun to the client   (again no good as it still reports the old value)
  tried re-scanning the iscsi target from the client    (still no good)

...starting to lose hope on this, but then realized I have not yet rebooted my openfiler system!   But wait, I can't just rip the carpet out from my OF system like that.... There are other systems relying on it for services/data.   And it is afterall LINUX so I should be able to simply restart a service.   [Light comes on]

In OF --> Services, I restarted the iSCSI Target service  (which will cause an outage across all iSCSI targets.... this is still kinda bad in my book)
After the restart of the service I went back to my CentOS 6.2 server and performed this command:
    [firehadman@xxx]$ sudo iscsiadm --mode node --targetname iqn.2006-01.com.openfiler:tsn.283a5a89fa76:xxx_test -R
    Rescanning session [sid: 4, target: iqn.2006-01.com.openfiler:tsn.283a5a89fa76:xxx_test, portal: 192.168.x.xxx,3260]

Then did a fdisk -l to check out the lun, which now is showing the 100G iSCSI lun!!!

Next step was to expand the filesystem....    I first tried using 'resize2fs /dev/sdi1, but this didn't seem to work as it reported back  there was nothing to do.
    Second attempt I used gparted and it was able to expand the drive  [NOTE, you must have the drive unmounted first]

Now for VMware ESXi 5...   All I had to do was re-scan the iSCSI storage adapter and it immediately saw the change.
From there you can increase your DataStore size as needed.

Hope this helps others who have been pulling their hair out!