Local Disk Configuration and Resizing

This document explains how to configure local disk storage (including SSD) for a StorReduce virtual machine, and how to resize local disk storage if running short on space.

For information on recommended sizes for local disks (magnetic and SSD) please see the On-Premises Installation Guide.

Disk Storage Preparation

The StorReduce virtual appliance comes pre-configured with three disks. The default disk sizes are relatively small but are suitable for evaluation of StorReduce.

Disk

VMware Name

Unix Device Name

Mount Point

Suggested Allocation

Boot ‘Hard Disk’ /dev/sda1 / Magnetic disk
High IOPS ‘Hard Disk 2’ /dev/sdb1 /mnt/srdb SSD
Standard ‘Hard Disk 3’ /dev/sdc1 /mnt/srkeydb Magnetic disk

For production servers you should increase the size of the High IOPS and Standard disks to match your expected data volumes. Within your Linux VM you will need to expand the file system on these disks to cover the full allocated capacity - see the ‘Expanding Local Disks’ section below.

If you have more than one SSD attached to the StorReduce server machine then they should be combined into a single RAID 0 device and mounted at the High IOPS disk mount mount (/dev/srdb) - see the ‘RAID for Multiple SSDs’ section below.

Expanding Local Disks

Whenever you wish to use a disk larger than the default size, or when a local disk is close to being full, you will need to expand the local disk and the filesystem it contains. Here are the steps involved:

  1. Shut down the VM

  2. Expand the disk in VMware. In the picture below we’ve used the VMware vSphere client to expand the High IOPS disk (Disk 2) from 100GB to 200GB.

  3. Start the VM and SSH in.

  4. Run lsblk - you should notice the disk size for sdb has increased but the partition size for sdb1 has remained the same:

    [root@localhost ~]# lsblk
    NAME            MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
    sda               8:0    0   20G  0 disk
    |-sda1            8:1    0  500M  0 part /boot
    |-sda2            8:2    0 19.5G  0 part
    sdb               8:16   0  200G  0 disk
    |-sdb1            8:17   0  100G  0 part /mnt/srdb
    sdc               8:32   0  100G  0 disk
    |-sdc1            8:33   0  100G  0 part /mnt/srkeydb
    
  5. Stop the StorReduce server by typing supervisorctl stop storreduce

  6. Unmount the partition you want to resize, in this case by typing umount /dev/sdb1

  7. Run lsblk which should now show that the partition is no longer mounted:

    [root@localhost ~]# lsblk
    NAME            MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
    sda               8:0    0   20G  0 disk
    |-sda1            8:1    0  500M  0 part /boot
    |-sda2            8:2    0 19.5G  0 part
    sdb               8:16   0  200G  0 disk
    |-sdb1            8:17   0  100G  0 part
    sdc               8:32   0  100G  0 disk
    |-sdc1            8:33   0  100G  0 part /mnt/srkeydb
    
  8. Resize the partition with fdisk

    fdisk /dev/sdb - specify the device here e.g. sdb

    use d to delete the existing partition (not this will NOT delete your data)

    use n to create a new partition - by default this will use all available space

    use w to write the new partition table

    [root@localhost ~]# fdisk /dev/sdb
    Welcome to fdisk (util-linux 2.23.2).
    
    Command (m for help): d
    Selected partition 1
    Partition 1 is deleted
    
    Command (m for help): n
    Partition type:
       p   primary (0 primary, 0 extended, 4 free)
       e   extended
    Select (default p): p
    Partition number (1-4, default 1):
    First sector (2048-419430399, default 2048):
    Using default value 2048
    Last sector, +sectors or +size{K,M,G} (2048-419430399, default 419430399):
    Using default value 419430399
    Partition 1 of type Linux and of size 200 GiB is set
    
    Command (m for help): p
    
    Disk /dev/sdb: 214.7 GB, 214748364800 bytes, 419430400 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk label type: dos
    Disk identifier: 0xd959dac1
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sdb1            2048   419430399   209714176   83  Linux
    
    Command (m for help): w
    The partition table has been altered!
    Calling ioctl() to re-read partition table.
    Syncing disks.
    
  9. Ensure that the filesystem is unmounted, by typing umount /dev/sdb1

  10. Verify the existing filesystem by typing e2fsck -f /dev/sdb1

  11. Resize the filesystem by typing resize2fs /dev/sdb1
    (note that this will default to using all available space)

    [root@localhost ~]# resize2fs /dev/sdb1
    resize2fs 1.42.9 (28-Dec-2013)
    Resizing the filesystem on /dev/sdb1 to 52428544 (4k) blocks.
    The filesystem on /dev/sdb1 is now 52428544 blocks long.
    
  12. Re-mount the filesystem mount /dev/sdb1 /mnt/srdb

  13. Use ‘lsblk’ to verify the new filesystem size:

    [root@localhost ~]# lsblk
    NAME            MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
    sda               8:0    0   20G  0 disk
    |-sda1            8:1    0  500M  0 part /boot
    |-sda2            8:2    0 19.5G  0 part
    sdb               8:16   0  200G  0 disk
    |-sdb1            8:17   0  200G  0 part /mnt/srdb
    sdc               8:32   0  100G  0 disk
    |-sdc1            8:33   0  100G  0 part /mnt/srkeydb
    
  14. Start storreduce by typing supervisorctl start storreduce

RAID for Multiple SSDs

If more than one SSD is available to the StorReduce server machine then they should be combined into a single RAID 0 device and mounted at the High IOPS disk mount mount (/dev/srdb).

One way to do this is to use the Linux Software raid module, using a command like this:

# mdadm --create --verbose /dev/md0 --level=0 -c256 --raid-devices=2 /dev/AAA /dev/BBB
# echo DEVICE /dev/AAA /dev/BBB > /etc/mdadm.conf
# mdadm --detail --scan >> /etc/mdadm.conf

where /dev/AAA and /dev/BBB are the SSDs, 2 is the number of SSDs and /dev/md0 is the RAID device to be created. The SSD(s) should be formatted with the EXT2 filesystem (it offers the best performance) and mounted at /mnt/srdb. E.g.,

# mkfs -t ext2 /dev/XXX
# mkdir -p /mnt/srdb
# e2label /dev/XXX SRDB
# echo "LABEL=SRDB /mnt/srdb ext2 noatime 0 0" >> /etc/fstab

Where /dev/XXX is the SSD device (e.g., /dev/sdb) or RAID device (e.g., /dev/md0).