December 23, 2015

Expanding a RAID 5 Volume on a XenServer 5.6 Server: Part 2 of 2

An additional drive was added to the RAID 5 configuration, see Part 1 for more information. The next step was to enable the XenServer to see the additional storage capabilities.

This is comprised of 4 steps using the XenServer console and command lines. Warning: you should be familiar with basic commands before proceeding and as always have appropriate backups.

1. Increase the Partition using fdisk
2. Update the LVM to include the resized physical volume
3. Resize the Logical Volume
4. Resize the File System

Increase the Partition using fdisk
The last partition needs to be deleted and then recreated to allocate the new available disk space.

Here are the commands to enter at the prompt #
Fdisk /dev/sda3        (or whatever your naming scheme is)
p (to display the original partitions)
d (to delete the last partition)
3 (this is the last partition in my server, yours may be different)
n (creates a new partition)
p (primary partition)
3 (recreate partition #3)
 (press enter for default first cylinder)
 (press enter for default last cylinder)
t (sets the partition type)
3 (partition #3)
8e (changes the partition type to Linux LVM)
p (to display the new partitions)
w (to write the partition table)
reboot (to reboot the system)

Update the LVM about the resized physical volume
Upon completion of the fdisk commands above, the LVM needs to be able to see the new blocks

Here are the commands to enter at the prompt #
pvdisplay (to display the original physical volume information)
pvresize /dev/sda3     (to resize the physical volume, your /dev/sda3 path will be different)
pvdisplay (to display the new physical volume information)

Resize the Logical Volume
Once the LVM is resized the logical volume needs to be resized.

Here are the commands to enter at the prompt #
vgdisplay (to display the original volume group information
make a note of the Free PE)
lvdisplay (to display the logical volume information
make a note of the LV Name)
lvresize –l +20480 /dev/files (increases the size of logical volume using the Free PE, your LV                                                             name will be different)
vfdisplay (to display the new volume group information)

Resize the File System 
Finally, the file system needs to be resized. Note this process will take some time to complete.

Here are the commands to enter at the prompt #
resize2fs /dev/files (to resize the file system, your LV name will be different)

The expansion should now be completed and the new space should be available to XenServer.

Much of this process is documented a following this link.

Hopefully this brief guide has helped you. Please leave a comment if so.

No comments: