What is partition resizing and why would I want to do it?
Cache resizing is the process of making the cache partition smaller to allow more space going into the general "/opt" partition on the Web Gateway. The default scheme uses a large cache partition where sometimes it may be necessary to allocate more space to the partition where the log files are stored or the "/opt" partition. The default installation of Web Gateway on all hardware appliances restricts the opt partition to 40GB and gives the remaining space to the cache. When you switch to the alternate scheme, the cache partition size will be limited to 40GB and and the opt partition gets the remainder.
NOTE: Resizing the cache partition is permanent and there is no rollback procedure aside from re-imaging the appliance to restore default partition size.
- Partition resizing is only possible on MWG 7.3.2 or newer installs.
- The partition resizing can be done right after a fresh install or at any time in the future. You will not lose any of the data stored in your /opt partition!
- A reboot is required for the repartitioning to be applied.
- The minimum hard disk size for the repartitioning to work is 40GB. It is not recommended to modify your partition sizes if the hard disk size is under 100GB. For hard disk sizes under 100GB you would not see much benefit from the resizing.
- To verify your hard disk size, run the 'df -h' command from the ssh console. Afterwards, add the values of the 'Size' column to determine the total size of your hard disk. (See the screenshot in the next section)
- Prior to starting the resizing wizard below, it is recommended to perform a backup, To do so, go to the following location within the Web Gateway UI:
- "Troubleshooting > Backup/Restore [Backup to file...]"
How to check current partition size
- Log into the Web Gateway appliance as the "root" user using SSH.
NOTE: This password was setup when you initially built the appliance.
- After logging into the Web Gateway run the "df -h" to take a look at your current partition scheme. The two partitions to note are the opt partition and cache partition below:
NOTE: In the example above, the opt partition is 40GB and the cache partition is 725GB. The goal of resizing the cache is to reduce its size and reallocate that space to the opt partition where logs are stored.
How to resize the cache
In order to start the cache resize you will need to be logged into the Web Gateway as "root" and then enter the "mwg-cache-wizard" command:
root@mwg-appl #> mwg-cache-wizard
You will then get a screen which looks like the following:
- Option 1 (Default scheme with full Web Cache) will leave the default partition scheme in place.
- Select Option 2 (Alternate scheme with limited Web Cache) and select OK.
On the resulting screen below, the current cache size for the appliance along with the new partition scheme is displayed. Sizes will vary based on space available, but notice that in the new partition scheme, the cache size is reduced to provide more space to logs on the opt partition!
- Select "Yes" to save the new configuration and restart the appliance.
- During the bootup process the following information is displayed
After the Cache resize
After the cache has been resized, you will be able to check the size of the partitions with the same "df -h" command as before. As you can see in the last 2 lines, the opt partition has been increased to 726GB and the cache has been reduced to 40GB.
Can the wizard be used a second time?
Partition resizing can only be performed once. There are safeguards in place that will prevent you from re-running the format process which look like the image below. The only way to revert the partitioning changes is to re-image the appliance and re-import a backup.
Or you could see the following: