Migrating to new server drive

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:

  1. Create an iSCSI volume on a SAN
  2. configure an iSCSI initiator on the server to connect to the SAN
  3. add the volume as a disk on the server
  4. copy all the data to the SAN
  5. share the iSCSI volume to the users
  6. physically add another hard drive
  7. reconfigure the RAID array
  8. copy the data back to the local drives
  9. 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.

array-before-adding-drive

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.

SAN-volume

 

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.

SAN-access-control

 

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.

iscsi-discovery

 

Then go to the target tab, highlight the connection and click the connect button.

iscsi-connect

 

Then you can go over to the Volumes and Devices Tab and add it as a drive.

iscsi-add-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.

set-drive-online

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 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.

delete-logical-drive

 

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.

create-array

 

 

 

create-array-select-drives

 

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.

create-array4

 

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.

create-array3

 

 

With the logical drive created, I can now see my drive in the HP Array manager.

create-array4

The same way we brought the iSCSI drive online, initialized, and formatted above, we do that for the new logical drive.

initialize-disk

 

 

Since this drive is now over 2TB, the GPT partition style has to be selected.

initialize-disk2

 

Assign it a drive letter to finish that step.

new-drive-created

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.

delete-iscsi

 

Next, set it offline.

delete-iscsi2

 

Then go over to the iSCSI initiator, and disconnect from the SAN.

delete-iscsi3

 

Then remove the target.

delete-iscsi4

 

Once that is done you can go over to your SAN and delete the volume there and you’re done.

head-shoulders-extramile
Mike Davis
mdd-headshot