Adding Drives to SimplStor

There are several ways to add drives to a SimplStor storage system. We will assume that you have already physically added the drives to empty drive slots or attached an expansion shelf. We will also assume that you are using Logical Volume Manager (LVM) to abstract the management of storage. There are several steps to this process that largely depend on whether you are creating a new Disk Group or expanding an existing Disk Group.

Add a New Disk Group:

If you have a large group of disks that you want to make into a new Disk Group, use the MegaRAID Storage Manager to create the desired Virtual Disk (VD). The Storage Manage GUI has a wizard that will step you through the process. Shortly after creating a new VD, the RAID controller will start an "initialization scan". This is actually just a simple block level integrity scan and does not alter any data on the disks. You can continue to use the VD while this scan is taking place.

If you created a new Disk Group you should now have a new Virtual Disk (VD) ready to be used by Linux. This should be visible as a new SCSI device of the appropriate size. Determine the device path of the new VD with sfdisk:

 # sfdisk -l

Now initialize the new device as an LVM Physical Volume (PV) with pvcreate (assuming we've added /dev/sde in this example):

# pvcreate /dev/sde

This new PV can be added to an existing or new LVM Volume Group (VG).

# vgextend vg1 /dev/sde

or

# vgcreate vg2 /dev/sde

The new space in the VG can be used to extend an existing or create a new LVM Logical Volume (LV). You can specify the new LV size in a number of ways (see the lvextend man page). Here we show the LV /dev/vg1/data1 with a total new size of 50 Tb. By adding the "--resizefs" option, we simultaneously extend the file system that is already on this LV.

# lvextend --resizefs -L50T /dev/vg1/data1

To create a new LV called data2 in VG vg2, we would use:

# lvcreate -L50T -n data2 vg2
# mkfs.xfs -i size=512 /dev/vg2/data2


NOTE: If you are creating a LV for use as an iSCSI backstores/block device, you should not create a file system nor should you use the --resizefs option.

Expand an Existing Disk Group:

If you have a small group of drives and want to expand an existing Disk Group, you can use another wizard in MegaRAID Storage Manager to perform this task. Be aware that a RAID-5 or RAID-6 group will need to recompute and redistribute all of the data and parity stripes across the new, larger group of drives. With typical Disk Group sizes, this can take days or even a week to complete. It is a background operation so, while performance may be degraded slightly, the system can be used while this redistribution takes place.

When the reditribution is complete, the change to the cylinder count of the VD is not dynamically recognized by the kernel. This needs to be manually triggered by either a system reboot or by running the following commands:


Identify the SCSI Host Path that contains the MegaRAID controller.

# grep megaraid /sys/class/scsi_host/host?/proc_name
/sys/class/scsi_host/host0/proc_name:megaraid_sas

Using the resulting path, enter:

# echo "- - -" > /sys/class/scsi_host/host0/scan

This string is "<dash><space><dash><space><dash>" and causes a rescan of all controllers, channels and luns on the SCSI path.

By expanding a Disk Group, you also extend the VD. The larger size should be visible on "Logical" tab of MegaRAID Storage Manager. The existing SCSI device should also show the new size at this point, but it is not represented yet in the LVM PV configuration. Determine the device path of the new VD with sfdisk:

# sfdisk -l

Now resize the PV with pvresize (assuming we are resizing /dev/sdf in this example). This simultaneously resizes the VG that contains this PV:

# pvresize /dev/sdf

The new space in the VG can be used to extend an existing or create a new LVM Logical Volume (LV). You can specify the new LV size in a number of ways (see the lvextend man page). Here we show the LV /dev/vg1/data1 with a total new size of 50 Tb. By adding the "--resizefs" option, we simultaneously extend the file system that is already on this LV.

# lvextend --resizefs -L50T /dev/vg1/data1

To create a new LV called data2 in VG vg2, we would use:

# lvcreate -L50T -n data2 vg2
# mkfs.xfs -i size=512 /dev/vg2/data2

NOTE: If you are creating a LV for use as an iSCSI backstores/block device, you should not create a file system nor should you use the --resizefs option