You are on page 1of 2

Gaia disk expanding and snapshots

This procedure is not known to be officially supported and has been tested to work in as far as the systems booted and a policy could be installed and traffic passed through
the firewall. What more could you want. Snapshots and backups worked too.

Expanding disks

This procedure shows an example of how to increase the partitions sizes of a Gaia based system.
The example below is Gaia installed onto a 20GB hard disk drive using the default disk partitions.
The disk is then cloned onto another 250GB hard disk drive.
The 20GB drive is removed from the system and the 250GB is the single drive in the system.
The 2 partitions are then resizes (increased in size). These are the root (/) and /var/log
The files systems are then adjusted (resized) to match the partitions sizes.

Logged into Gaia expert mode after booting from the 250GB hard disk drive:
fdisk /dev/sda
Delete partition 3 and re-add it as new primary partition with the new, bigger size - options used are d and n (and defaults).
Set the type to 0x8e (Linux LVM) - option t and 8e.
Exit,saving changes - option w
Reboot
In expert mode:
pvdisplay
pvresize /dev/sda3
vgdisplay should show the new free size usable for images.
lvdisplay
lvresize -L +100GB /dev/vg_splat/lv_current - This will increase the root (/) from 6GB to 30GB
lvresize -L +300GB /dev/vg_splat/lv_log - This will increase the /var/log from 2GB to 102GB
lvresize -L +5GB /dev/vg_splat/lv_log
lvdisplay
Reboot and break into the boot screen by pressing any key
Start Gaia in maintenance mode
Run:
e2fsck -f /dev/mapper/vg_splat-lv_log
e2fsck -f /dev/mapper/vg_splat-lv_current
resize2fs /dev/vg_splat/lv_log
resize2fs /dev/vg_splat/lv_current

By: Don Paterson Gaia disks 2012


halt and reboot (Ctrl + Alt + Del)

If you for example had a 20GB drive in Gaia and cloned the contents to a 250GB drive or resized the virtual drive. You may want the root (/) and /var/log to have more than
the default 6GB and 2GB respectively.
You could resize the logical volumes to 30GB (/) and 102GB (/var/log), as shown in the lvresize commands above.
You may not want to go too big for the root since the snapshot (image management) will need a logical volume of 30GB in size while the snapshot is running.
Even though the snapshot may only be 3 to 4GB in size in the end. During the snapshot the 30GB LV must exist. This is done using free disk space (space not assigned to the
root / or /var/log). The command pvscan will show this free space.
In this example there is about 121GB of free space on the physical volume (before any snapshots are made). This means that you can store a number of snapshots of 3GB in
size before you have to delete any of them in order to free up the 30GB for the next snapshot.
The lvs and lvdisplay commands show the space usage of the snapshots and are interesting to look at during a snapshot (system image creation).
The pvscan command helps to understand how much free space is available for snapshots to be created.

Snapshots

If you plan to export snapshots then you need to make sure that the /var/log partition has enough space. It needs to have twice the space of the snapshot image.
Even though the export file can be half the size of a snapshot after it is compressed for download. The space is needed to create the compressed file.
Alternatively you can skip using the Gaia WebUI Portal and use the CLISH command: set snapshot export <image name> path </you/decide/>.
This will allow you to avoid the default ultimate storage location of /var/log/download.
This will not avoid needing the free space on the /var/log partition since that location is always used.
The snapshot (image) export process will do a dd copy of the snapshoted partition and gzip it and then tar the files.
It uses the /var/log/tmp_snapshot directory where it creates a new directory with the same name as the image. This is deleted once the export file is created.
When exporting snapshots in the WebUI. The export file is stored in /var/log/download and is named after the image with a .tar file extension.
The .tar file is not deleted out of the /var/log/download directory after you download it though the WebUI. Let's hope Check Point manage that automatically somehow in
order to avoid disk space issues in the future.

By: Don Paterson Gaia disks 2012