In this post I’ll show how to add space to a RAID array and migrate data to an iSCSI volume so that the RAID array can be deleted and created. On a really small scale you could just ad an external hard drive as the swing space, but in my case I didn’t have an external drive that large.
Here are the basic steps:
- Create an iSCSI volume on a SAN
- configure an iSCSI initiator on the server to connect to the SAN
- add the volume as a disk on the server
- copy all the data to the SAN
- share the iSCSI volume to the users
- physically add another hard drive
- reconfigure the RAID array
- copy the data back to the local drives
- share the local volume to the users
If you were doing this with an external hard drive, you would just skip the iSCSI and SAN items.
Here is a look at the drive configuration in side the HP Proliant DL120 G6. The built in controller only supports 2 logical drives and to expand a RAID 0 array, you have to delete the logical drive and create a new one. I’m starting with a single 2TB drive and want to add a second 2TB drive in a RAID 0 configuration so that I’ll have a new 4TB volume.
First you need to create a volume on the SAN. I’m using a Dell Equallogic SAN. Simply create the volume as big as you need.
After that it’s important to set access to the volume so that your iSCSI initiator can get to it and nothing else. I’m using the IP address for simplicity sake. If this were going to be for something more long term, I would use CHAP.
With the volume on the SAN created, it’s time to connect to it from the server. Launch the iSCSI initiator. The tabs are note really set up in the order that you use them. First go to the discovery tab and add the IP address of the SAN.
Then go to the target tab, highlight the connection and click the connect button.
Then you can go over to the Volumes and Devices Tab and add it as a drive.
You can close the iSCSI initiator and open up Computer Management and go to Disk Management under Storage. You’ll see the drive, but it will be offline. Just right click it to bring it online. From there, initialize it, and format it.
With the drive formatted, it’s ready for data to be copied. I used a robocopy command for this.
echo Copying projects from drive to drive
rem /E for copying sub directories, even empty ones
rem /COPY:DATSOU (copyflags : D=Data, A=Attributes, T=Timestamps (S=Security=NTFS ACLs, O=Owner info, U=aUditing info).
rem /R:1 retry once
rem /W:30 wait 30 seconds between retries
rem /NP don't display percentage copied
robocopy b:\vol2 d:\vol2 /E /COPY:DATSOU /R:1 /W:30 /NP /log:C:\temp\robocopy-b2d.log
The advantage of using robocopy like this is that it will copy the files with permissions from one volume to the next. If the file is already there, it won’t copy it again. This doesn’t matter the first time it’s run, but you can make a second pass that will check all the files and only copy the ones it missed or new files. On the 2TB volume I was working on, it took 12 hours for the first copy. It only took 30 minutes for the second pass to run and verify everything.
After a second pass of the batch file to make sure all the files were copied (check the log file to do this) the next step was to stop sharing the original volume, and share the new one. Check the permissions on the share and make sure the users mapped drives aren’t having any problems connecting. Once you have double and triple checked that, it’s time to delete the logical drive from the server’s controller. In the HP Array Manager, find the logical drive and click delete.
Next you can power down the server and physically add the new drive. You could actually do this step first if you started out onside and were going to do the rest remotely. When the server boots back up, go in to the array manager and you’ll see your new drive as unassigned.
HP does this backwards from how the typical Dell controllers do things. First you create the array as above, and then you create the logical drives.
AFTER you create the logical drives, you set the RAID level. On most other controllers, you select the RAID level you would like and it makes you pick the drives you want to add to the array and disables the RAID levels that are not possible with the drives you have. On this controller, your only options are RAID 0 and RAID 1. This particular server is an archive server with data that doesn’t change much and is backed up regularly, but cheap storage space is needed, so RAID 0 is what I’m selecting. Please note, if this were a server that need a recovery time objective of less than 24 hours, RAID 0 would be a very bad idea.
With the logical drive created, I can now see my drive in the HP Array manager.
The same way we brought the iSCSI drive online, initialized, and formatted above, we do that for the new logical drive.
Since this drive is now over 2TB, the GPT partition style has to be selected.
Assign it a drive letter to finish that step.
At this point you can use the robocopy batch file with the drive letters reversed to copy your data back. Once that is done, you’ll have to stop sharing the iSCSI volume and share the logical volume as above. When that process is complete, the only thing left is to remove the iSCSI disk and initiator settings.
Next, set it offline.
Then go over to the iSCSI initiator, and disconnect from the SAN.
Then remove the target.
Once that is done you can go over to your SAN and delete the volume there and you’re done.