How to resize your unencrypted nmd | HyperDrive Appliance data disk

Notes:
If your appliance uses an encrypted filesystem (this is a choice in the /va wizard at first setup), please follow the guide for encrypted filesystem resizing.

Keep in mind that resizing an appliance is a risky procedure (high chance of human error), so we recommend to:
- Take a backup of your data disk
- Choose a size that is large enough, so you will not have to re-do this procedure regularly.

Detect how your disk was partitioned

There are 2 ways which the appliance has used to partition disks (fdisk or parted).
The 2 ways require a different procedure for resizing the disk.
The guide below will show you which procedure to follow.

On your HyperDrive Appliance console execute this command:

NOTE: The /dev/sdb1 and /dev/sdb which is used below is an example please use your disk name.

# fdisk /dev/sdb -l

Now you will see the partition information of the /dev/sdb disk and you will see one partition.

If under the system column `Linux` is returned then the disk is partition with fdisk: please use 'procedure 1'.

If under the system column 'GPT' is returned then the disk is partitioned with parted: please use 'procedure 2'

 

Procedure 1 (for drives partitioned with fdisk):

First make sure that you have a good backup!

Then enlarge the LUN in the SAN environment of the local disk within your virtual environment.

After this you can use the following commands on the HyperDrive appliance to resize the LUN or local disk.
NOTE: The /dev/sdb1 and /dev/sdb which is used below is an example please use your disk name.

Note: If you use an older version of nmd | HyperDrive the PostgreSQL service name is: postgresql

// stop services which use /va
# service httpd stop
# service stunnel stop
# service postgresql-9.4 stop

// unmount the data disk
# umount /va
# fsck -n /dev/sdb1

// disable journaling 
# tune2fs -O ^has_journal /dev/sdb1
# resize2fs /dev/sdb1 <new size of your disk>

// delete the /dev/sdb1 partition & recreate it (your data will remain)
# fdisk /dev/sdb
In the fdisk utility use these commands
p (show partition information the disk)
d (delete partition)
n (create new partition), then press p (primary partition), then press 1 (for the first partition), type first cylinder (normally this is 1), then type last cylinder (use the value which you see behind default)
w (write partition)

# e2fsck -f /dev/sdb1
# resize2fs /dev/sdb1
# fsck -n /dev/sdb1

// enable journaling again
# tune2fs -j /dev/sdb1
# mount -a

// start services
# service stunnel start
# service postgresql-9.4 start
# service httpd start

When using iSCSI the service `haldaemon` should also be stopped & started.
# service haldaemon restart

Same steps with more details: http://www.howtoforge.com/linux_resizing_ext3_partitions

NOTE: In some circumstances the new disk size is not detected by the Linux operating system when using iSCSI disks. In this case a rescan of the drives can solve this. Use the following procedure to force the rescan of the disk

//check wich scsi bus needs to be rescanned
# cd /sys/class/scsi_disk
# ls

//configure the `rescan` file of the correct SCSI bus (in this example the bus 0:0:0:0: is being used)
# cd 0\:0\0:\0/
# echo `1` > device/rescan

Then restart the prodedure again to add the additional disk space.

Procedure 2 (for drives partitioned with parted):

First make sure that you have a good backup!

Then enlarge the LUN in the SAN environment of the local disk within your virtual environment.

After this you can use the following commands on the nmd | HyperDrive appliance to resize the LUN or local disk.
NOTE: The /dev/sdb1 and /dev/sdb which is used below is an example please use your disk name.

// stop services which use /va

Note: If you use an older version of nmd | HyperDrive the PostgreSQL service name is: postgresql

# service httpd stop
# service stunnel stop
# service postgresql-9.4 stop

// unmount the data disk
# umount /va
# e2fsck -f /dev/sdb1

// delete the /dev/sdb1 partition & recreate it
# parted -a optimal /dev/sdb --script print rm 1 mklabel gpt mkpart primary ext3 0% 100% print

// check the partition on errors and resize the partition
# e2fsck -f /dev/sdb1
# resize2fs /dev/sdb1
# e2fsck -f /dev/sdb1

// mount the extended disk as /va
# mount -a

// start services
# service stunnel start
# service postgresql-9.4 start
# service httpd start

When using iSCSI the service `haldaemon` should also be stopped & started.
# service haldaemon restart

Same steps with more details: http://www.howtoforge.com/linux_resizing_ext3_partitions

NOTE: In some circumstances the new disk size is not detected by the Linux operating system when using iSCSI disks. In this case a rescan of the drives can solve this. Use the following procedure to force the rescan of the disk

//check wich scsi bus needs to be rescanned
# cd /sys/class/scsi_disk
# ls

//configure the `rescan` file of the correct SCSI bus (in this example the bus 0:0:0:0: is being used)
# cd 0\:0\0:\0/
# echo `1` > device/rescan

Then restart the prodedure again to add the additional disk space.

Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.