Storage

Permanent storage per testbed

When a node is swapped in in your experiment, an NFS share will be mounted, which is accessible by all people in your subauthority/project.

This NFS share is mounted as:

/groups/wall2-ilabt-iminds-be/[projectname]/

(if you have a certificate from another authority than the Virtual Wall, the 2nd part will be different)

The nice thing is that:

  • the share is mounted automatically on all your nodes
  • the share is permanent, so after your experiment is done, the data will remain there
  • the share is shared with all people in your project

Note that this storage is only available per testbed, so it is not shared accross the testbeds.

Local storage per node

To speed up the deployment of nodes on the testbed, the initial image that is deployed only occupies a small partition off a bigger disk. When you plan on creating a new image of your node later on, you should avoid enlarging this partition too much, as this will slow down the imaging process (both creation and later deployment).

However, if you are not planning on imaging your server for later use, you can safely enlarge the partition to occupy the full disk. Another option is to use this free space on the disk to create a separate partition for your local storage needs.

Enlarging your root partition to the full disk size

You can use the following script to enlarge your partition to occupy the full disk. This script will also reconfigure the swap to use a swapfile on the root partition instead of a separate partition on the disk:

maximize-sda1.sh
#!/bin/bash

echo "** Disabling swap"
swapoff -a

echo "** Updating partition table"

# This magic string means:
# create one partition from start to end of disk (the +), without specified id, and make it bootable (the *)
echo ",+,,*" | sfdisk /dev/sda --no-reread

#force online reload of partition table
echo "** Forcing re-read of partition table"
partprobe

echo "** Resizing file-system"
resize2fs /dev/sda1

echo "** Reinstating swap via swapfile of 2G"
SWAPSIZE=$(expr 2 \* 1024 \* 1024)

sudo dd if=/dev/zero of=/swapfile bs=1024 count=$SWAPSIZE
chmod 600 /swapfile
mkswap /swapfile 
swapon /swapfile

echo "** Update /etc/fstab"
mv /etc/fstab /etc/fstab.bak

echo "*** OLD fstab:"
cat /etc/fstab.bak

cat /etc/fstab.bak | grep -v swap >> /etc/fstab
echo "/swapfile swap swap defaults 0 0" >> /etc/fstab

echo "*** NEW /etc/fstab:"
cat /etc/fstab

Partial enlargement of your root partition

Currently, there are images with ‘MBRv2’ which have a 6GB root filesystem, and there are images with ‘MBRv3’ which have a 15GB root filesystem (UBUNTU14-64-STD, DEB77-64-STD, CENTOS65-64-STD).

This might be too small in some cases. You can enlarge these partitions easily with the commands below.

Warning

This only works on a fresh machine, not if you already have activated an extra partition. Then you will loose data with this method. You have been warned ! This normally does not loose data on the root partition.

Note

NOTE: this 20GB or 25GB is just an example - it is based on 512 bytes sectors, so if you change further the size and then start of next partition, you can also make other sizes. Be careful with typos.

For MBRv3 images:

You can enlarge this as follows (creates a 25GB root partition on /dev/sda1):

echo "unit: sectors" > disklayout
echo "" >> disklayout
echo "/dev/sda1 : start=     2048, size= 48828125, Id=83, bootable" >> disklayout
echo "/dev/sda2 : start= 48830173, size=  6291456, Id= 0" >> disklayout
echo "/dev/sda3 : start= 55121629, size=  6291456, Id=82" >> disklayout
echo "/dev/sda4 : start= 61413085, size=442257776, Id= 0" >> disklayout

sudo sfdisk --force /dev/sda < disklayout

sudo reboot

sudo resize2fs /dev/sda1

For MBRv2 images (legacy):

You can enlarge this as follows (creates a 20GB root partition on /dev/sda2):

echo "unit: sectors" > disklayout
echo "" >> disklayout
echo "/dev/sda1 : start=       63, size= 12305790, Id=a5">> disklayout
echo "/dev/sda2 : start= 12305853, size= 39070080, Id=83, bootable">> disklayout
echo "/dev/sda3 : start= 51375933, size=  2100357, Id=82">> disklayout
echo "/dev/sda4 : start=        0, size=        0, Id= 0" >> disklayout
sudo sfdisk --force /dev/sda < disklayout

sudo reboot

sudo resize2fs /dev/sda2

Extra disk space on extra partition

There is still free space on the disk, that you can partition yourself with cfdisk e.g. The pcgen1 nodes on Virtual Wall 1 have even another 3 extra disks (/dev/sdb, /dev/sdc, /dev/sdd) which work nicely in a RAID0 configuration.

See Hardware for information on disk capacity per node.