Resize Data Disk /var/storage/

Hi, I installed the UTM Software on an apu1d4.

It works quite well so far but there are two things that bother me.

First thing is the data disk. I have a 16GB msata installed in the system but the UTM installer didn't use all of the space.

Especially the data disk is pretty small and thus almost full. I did a rebuild of the postgres db, that helped a little. Don't know how long it will last till I have to rebuild the db again but I don't want to loose all of my logs all the time.

So, is there anybody who can tell me, how I can resize the data disk without reinstalling?

The problem with intalling on the apu1d4 is that it does not have a vga port, only a console port and since the utm installer does not send output to the seriell port I have to install it blind with a parallel installation in a vm so I can kind of see what I am doing. :-)

Here is the output from df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda6       5.2G  2.3G  2.7G  47% /
udev            2.0G  104K  2.0G   1% /dev
tmpfs           2.0G     0  2.0G   0% /dev/shm
/dev/sda1       331M   16M  295M   5% /boot
/dev/sda5       1.5G  619M  745M  46% /var/storage
/dev/sda7       1.9G  117M  1.7G   7% /var/log
/dev/sda8       535M  7.4M  488M   2% /tmp
tmpfs           2.0G     0  2.0G   0% /var/sec/chroot-httpd/dev/shm
tmpfs           2.0G     0  2.0G   0% /var/storage/chroot-reverseproxy/dev/shm
tmpfs           2.0G   32K  2.0G   1% /var/storage/chroot-smtp/tmp/ram


Thanks

The other thing has to do with Wifi but I will ask this in another thread if I can't figure it out by myself. :-)

  • I don't gave U any kind of guarantee 4 this but you may try resize2fs. (MAKE A BACKUP)
    The filesystem should be ext4 so U will be able 2 resize it Online!
    resize2fs -p /dev/sda5
    This will add all available space on the disk 2 the /var/storage.
  • FYI, the MINIMUM recommended disk size is 40GB for UTM. You need to buy a bigger disk. 16GB just won't cut it, unless you use no features but firewall and reduce log/report retention down to nothing.
  • Sorry for my late answer. I didn't get an email notification. Thanks for your replys.

    @Scott_Klassen: If it needs at least 40GB why didn't the installer use the 16GB? I might add another sata ssd to it. Right now it is in testing so 16GB are fine. But thanks for the information.

    @/dev/nul: This could work but only if sda5 is the last partiton on the disk, which apparently it isn't . There are also sda7 and 8. Guess I would have to delete all of them and recreate them. :-( I might try to plug the msata into my laptop and boot from gparted and try to resize/move the disks and afterwards use resize2fs as you mentioned.
  • The following information should allow you to resize partitions for the UTM and iView using a hardware appliance, Hyper V or VMware installations.

    Before making any changes like this, I would take a backup and review all the steps carefully.

    Expanding Partitions on the UTM and iView

    www.rootusers.com/.../

    Current drive space on test UTM:
    utm:/root # df -h | grep ^/dev
    /dev/sda6 5.2G 2.3G 2.7G 46% /
    /dev/sda1 331M 16M 295M 5% /boot
    /dev/sda5 4.2G 1.9G 2.1G 47% /var/storage
    /dev/sda7 5.5G 108M 5.1G 3% /var/log
    /dev/sda8 677M 143M 486M 23% /tmp

    Verify it is a Linux Native partition with ID 83:
    utm:/root # fdisk -l

    Disk /dev/sda: 21.5 GB, 21474836480 bytes
    255 heads, 63 sectors/track, 2610 cylinders, total 41943040 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 identifier: 0x000620ee

    Device Boot Start End Blocks Id System
    /dev/sda1 * 2048 718848 358400+ 83 Linux
    /dev/sda2 718849 4913152 2097152 82 Linux swap / Solaris
    /dev/sda3 4913153 7010304 1048576 83 Linux
    /dev/sda4 7010305 41943039 17466367+ f W95 Ext'd (LBA)
    /dev/sda5 7010306 16506880 4748287+ 83 Linux
    /dev/sda6 16506882 27770880 5631999+ 83 Linux
    /dev/sda7 27770882 40292352 6260735+ 83 Linux
    /dev/sda8 40292354 41734144 720895+ 83 Linux
    utm:/root #

    **Before taking a snapshot, the drive space will need to be increased**

    To increase drive space:
    Settings > Hard Disk > Expand Disk...

    Then increase drive space from 20GB to 30GB
    Then save the changes

    ** To save the current state of the VM, created a clone of the virtual machine **

    Download the gparted iso at gparted.sourceforge.net/download.php
    (selected sourceforge.net/.../download)
    because of using 16GB RAM and x64 architecture

    To change the boot order on the UTM, reboot the virtual machine
    Press Esc once
    Then select GParted Live (Default settings)
    Choose the default 'Don't touch keymap'
    Choose the language, pressing enter defaults to English
    Next, select the default option 0, by pressing enter, to use the GUI

    After following the documentation: www.rootusers.com/.../
    to assign the unallocated 10GB space to be a logical drive as part of the extended /dev/sda4 partition.

    This resulted in GParted reporting:
    Unable to Satisfy All Constraints


    Further troubleshooting steps to try to resolve the "Unable to Satisfy All Constraints"
    fix partitions:
    www.rodsbooks.com/.../
    gparted.org/h2-fix-msdos-pt.php
    gparted.org/faq.php


    Solution for the UTM:
    Best idea for expanding disk size on the UTM is to follow the steps below:
    Create a new virtual UTM with the desired disk size.
    Import the configuration from a backup from the original VM.
    If using Endpoint Protection:
    On the original UTM, enter the following command to get the system ID: cc get settings system_id
    On the new UTM, ensure the system ID imported from backup properly by entering the same command above.
    If it has a different system ID, use cc set settings system_id <id of original utm> to set it to the old ID
    Ensure the original VM is removed so they do not conflict with each other.
    If you want to preserve logs/db/quarantined mail, another way of doing this is to create a VM of larger disk size, link it to the original UTM in HA and wait for everything to transfer, then set it as the master UTM and remove the old VM from the cluster.


    restoring from a 9.313 backup does not work on any lower UTM versions, need to do an up2date with audld.plx to update to 9.313 then apply the backup

    Verifying the current filesystem size on the UTM was expanded from 20GB to 30GB:
    utm:/root # df -h
    Filesystem Size Used Avail Use% Mounted on
    /dev/sda6 5.2G 2.2G 2.8G 44% /
    udev 1003M 96K 1003M 1% /dev
    tmpfs 1003M 0 1003M 0% /dev/shm
    /dev/sda1 331M 16M 295M 5% /boot
    /dev/sda5 8.1G 616M 7.1G 8% /var/storage
    /dev/sda7 11G 48M 10G 1% /var/log
    /dev/sda8 878M 1.2M 816M 1% /tmp
    tmpfs 1003M 0 1003M 0% /var/sec/chroot-httpd/dev/shm
    tmpfs 1003M 0 1003M 0% /var/storage/chroot-reverseproxy/dev/shm
    tmpfs 1003M 36K 1003M 1% /var/storage/chroot-smtp/tmp/ram

    utm:/root # fdisk -l

    Disk /dev/sda: 32.2 GB, 32212254720 bytes
    255 heads, 63 sectors/track, 3916 cylinders, total 62914560 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 identifier: 0x000cdd4e

    Device Boot Start End Blocks Id System
    /dev/sda1 * 2048 718848 358400+ 83 Linux
    /dev/sda2 718849 4913152 2097152 82 Linux swap / Solaris
    /dev/sda3 4913153 7010304 1048576 83 Linux
    /dev/sda4 7010305 62910539 27950117+ f W95 Ext'd (LBA)
    /dev/sda5 7010306 25315328 9152511+ 83 Linux
    /dev/sda6 25315330 36579328 5631999+ 83 Linux
    /dev/sda7 36579330 60635136 12027903+ 83 Linux
    /dev/sda8 60635138 62494720 929791+ 83 Linux

    Solution for iView:
    Checked the filesystem on the iView and it is listed as using gpt instead of msdos

    iview:/root # sudo parted /dev/sda -l unit s print && echo -e "\n" && df -h | grep ^/dev | sort -u
    Model: VMware, VMware Virtual S (scsi)
    Disk /dev/sda: 32.2GB
    Sector size (logical/physical): 512B/512B
    Partition Table: gpt

    Number Start End Size File system Name Flags
    1 17.4kB 368MB 368MB ext3 primary boot, , , , , , , , , , ,
    2 368MB 2516MB 2147MB linux-swap primary , , , , , , , , , , ,
    3 2516MB 3589MB 1074MB ext3 primary , , , , , , , , , , ,
    4 3589MB 18.3GB 14.7GB ext3 primary , , , , , , , , , , ,
    5 18.3GB 24.1GB 5767MB ext3 primary , , , , , , , , , , ,
    6 24.1GB 31.0GB 6956MB ext3 primary , , , , , , , , , , ,
    7 31.0GB 32.0GB 952MB ext3 primary , , , , , , , , , , ,

    Warning: Unable to open /dev/sr0 read-write (Read-only file system). /dev/sr0 has been opened read-only.
    Error: /dev/sr0: unrecognised disk label

    /dev/sda1 332M 14M 301M 5% /boot
    /dev/sda4 13G 691M 12G 6% /var/storage
    /dev/sda5 5.2G 1.9G 3.1G 38% /
    /dev/sda6 6.0G 36M 5.6G 1% /var/log
    /dev/sda7 878M 1.2M 832M 1% /tmp
    iview:/root #

    After applying the changes below using a GParted LiveCD:

    expanded the iView drive from 30GB to 50GB and followed the same steps as used for the UTM:

    **Before taking a snapshot, the drive space will need to be increased**

    To increase drive space:
    Settings > Hard Disk > Expand Disk...

    Then increase drive space from 30GB to 50GB
    Then save the changes

    ** To save the current state of the VM, created a clone of the virtual machine **

    Download the gparted iso at gparted.sourceforge.net/download.php
    (selected sourceforge.net/.../download)
    because of using 16GB RAM and x64 architecture

    To change the boot order on the UTM, reboot the virtual machine
    Press Esc once
    Then select GParted Live (Default settings)
    Choose the default 'Don't touch keymap'
    Choose the language, pressing enter defaults to English
    Next, select the default option 0, by pressing enter, to use the GUI


    worked by using Resize/Move and Align to Cylinder for the /dev/sda7 tmp
    worked by using Resize/Move and Align to MiB for the /dev/sda6 log
    same align to MiB worked for all other /dev/sda*
    then added the 20GB unallocated space to /dev/sda4

    Verifying the drive space is 50GB with 36.4GB dedicated to /dev/sda4:

    iview:/root # sudo parted /dev/sda -l unit s print && echo -e "\n" && df -h | grep ^/dev | sort -u
    Model: VMware, VMware Virtual S (scsi)
    Disk /dev/sda: 53.7GB
    Sector size (logical/physical): 512B/512B
    Partition Table: gpt

    Number Start End Size File system Name Flags
    1 17.4kB 368MB 368MB ext3 primary boot, , , , , , , , , , ,
    2 368MB 2516MB 2147MB linux-swap primary , , , , , , , , , , ,
    3 2516MB 3589MB 1074MB ext3 primary , , , , , , , , , , ,
    4 3589MB 40.0GB 36.4GB ext3 primary , , , , , , , , , , ,
    5 40.0GB 45.8GB 5766MB ext3 primary , , , , , , , , , , ,
    6 45.8GB 52.7GB 6955MB ext3 primary , , , , , , , , , , ,
    7 52.7GB 53.7GB 954MB ext3 primary , , , , , , , , , , ,

    Warning: Unable to open /dev/sr0 read-write (Read-only file system). /dev/sr0 has been opened read-only.
    Error: Can't have a partition outside the disk!

    /dev/sda1 332M 14M 301M 5% /boot
    /dev/sda4 32G 697M 30G 3% /var/storage
    /dev/sda5 5.2G 1.9G 3.1G 38% /
    /dev/sda6 6.0G 37M 5.6G 1% /var/log
    /dev/sda7 880M 1.2M 833M 1% /tmp
    iview:/root #

  • In reply to TedReynolds:

    Reviewed the original post again:

    Ignore this section of my post
    **The main difference being in your case you are working on resizing /dev/sda6, instead of /dev/sda4 as mentioned in my explanation.**

    To resize /var/storage, follow the steps outlined in my post for resizing /dev/sda4.
  • In reply to TedReynolds:

    Hi, I am sorry but I did a mistake in my counting of the used sized of the msata disk.
    I forgot the swap partition which isn't shown with df -h. It is 4GB in size. So the installer did use all of the 16GB of the disk. But as Scott already mentioned I need at least 40GB to keep at least some of the logs. So, I am going to buy a bigger disk. Why I marked Teds suggestion as a solution is, cause I tried it on a VM and it did work.

    Thanks for all your replies.