How to extend /boot partition in SafeSquid
Posted: Fri Aug 12, 2022 11:14 am
The older version of the SafeSquid ISO installer suggests a default partition layout with /boot partition size of 232 megabytes.
This was sufficient for older versions of the operating system (older than ubuntu 18.04 LTS) however, with newer versions of ubuntu /boot partitions get utilized rather quickly.
Example of an obsolete filesystem structure. Moreover /boot partition gets populated with old kernel modules and other leftover upgrades.
SafeSquid ISO installs, which are not recent may have issues with /boot partition utilized to 100%
This can prevent system updates and security patches essential for server security.
Example of such an error.
Attached is a complete log for detailed analysis.
In a newer version of SafeSquid ISO install, the problem of a smaller boot partition has been resolved.
/boot is configured to have comparatively large disk space.
Example of existing filesystem structure. Workaround for users with older installs and smaller boot partitions can extend their /boot partition size.
Below is a guide on how to extend your /boot partitions.
How to extend /boot partition for an older version of SafeSquid install
(Note: Test for extending /boot portion was performed on newer SafeSquid install as we do not have SafeSquid with the older install, although execution remains similar.)
Default filesystem for SafeSquid ISO install Add a new disk with a minimum of 2GB and a maximum of 5GB to your SafeSquid server.
(Note: Adding a new disk will not be covered here, you can find resources online to achieve the same based on your system type)
Validate disk status. - List all storage devices.
For me, after adding a new storage device, the existing sda storage device is now referred to as sdb and new storage device is referred to as sda Create a new filesystem of type ext4.
(Note: In this example, the new storage device is referred to as sda and the existing boot partition is referred to as /dev/sdb1.
If you are following this guide please make sure that you have selected the appropriate partitions before performing any given task.)
Create new directory in /usr/local/src/old_boot for mounting old boot partition.
Mount new partition to /boot directory
use rsync to copy all files with their permissions from the old boot directory to the new boot directory.
Edit /etc/fstab to modify the UUID of /boot directory.
To get the UUID of your storage device, use the below command.
copy UUID and edit /etc/fstab file.
Hit "Esc" and to save and exit from vim.
restart your server.
Validate if /dev/sda has automounted in /boot directory.
Executing the below command if you have any unattended updates
The system should now update without any errors.
This was sufficient for older versions of the operating system (older than ubuntu 18.04 LTS) however, with newer versions of ubuntu /boot partitions get utilized rather quickly.
Example of an obsolete filesystem structure. Moreover /boot partition gets populated with old kernel modules and other leftover upgrades.
SafeSquid ISO installs, which are not recent may have issues with /boot partition utilized to 100%
This can prevent system updates and security patches essential for server security.
Example of such an error.
Code: Select all
Preparing to unpack .../06-libcupsimage2_2.2.7-1ubuntu2.9_amd64.deb ...
Unpacking libcupsimage2:amd64 (2.2.7-1ubuntu2.9) over (2.2.7-1ubuntu2.8) ...
Preparing to unpack .../07-libcups2_2.2.7-1ubuntu2.9_amd64.deb ...
Unpacking libcups2:amd64 (2.2.7-1ubuntu2.9) over (2.2.7-1ubuntu2.8) ...
Preparing to unpack .../08-libmagickcore-6.q16-3-extra_8%3a6.9.7.4+dfsg-16ubuntu6.13_amd64.deb ...
Unpacking libmagickcore-6.q16-3-extra:amd64 (8:6.9.7.4+dfsg-16ubuntu6.13) over (8:6.9.7.4+dfsg-16ubuntu6.12) ...
Selecting previously unselected package linux-modules-4.15.0-188-generic.
Preparing to unpack .../09-linux-modules-4.15.0-188-generic_4.15.0-188.199_amd64.deb ...
Unpacking linux-modules-4.15.0-188-generic (4.15.0-188.199) ...
dpkg: error processing archive /tmp/apt-dpkg-install-DPzMI2/09-linux-modules-4.15.0-188-generic_4.15.0-188.199_amd64.deb (--unpack):
cannot copy extracted data for './boot/System.map-4.15.0-188-generic' to '/boot/System.map-4.15.0-188-generic.dpkg-new': failed to write (No space left on device)
/boot is configured to have comparatively large disk space.
Example of existing filesystem structure. Workaround for users with older installs and smaller boot partitions can extend their /boot partition size.
Below is a guide on how to extend your /boot partitions.
How to extend /boot partition for an older version of SafeSquid install
(Note: Test for extending /boot portion was performed on newer SafeSquid install as we do not have SafeSquid with the older install, although execution remains similar.)
Default filesystem for SafeSquid ISO install Add a new disk with a minimum of 2GB and a maximum of 5GB to your SafeSquid server.
(Note: Adding a new disk will not be covered here, you can find resources online to achieve the same based on your system type)
Validate disk status.
Code: Select all
lsblk
For me, after adding a new storage device, the existing sda storage device is now referred to as sdb and new storage device is referred to as sda Create a new filesystem of type ext4.
(Note: In this example, the new storage device is referred to as sda and the existing boot partition is referred to as /dev/sdb1.
If you are following this guide please make sure that you have selected the appropriate partitions before performing any given task.)
Code: Select all
mkfs.ext4 /dev/<sda>
Code: Select all
mkdir -p /usr/local/src/old_boot
Code: Select all
umount /dev/<sdb1> ; mount /dev/sdb1 /usr/local/src/old_boot
Code: Select all
mount /dev/<sda> /boot
Code: Select all
rsync -avz /usr/local/src/old_boot /boot
To get the UUID of your storage device, use the below command.
Code: Select all
blkid| grep /dev/<sda>| awk '{print $2}' | awk -F = '{print $2}' | awk -F \" '{print $2}'
Code: Select all
vim /etc/fstab
Code: Select all
:wq!
restart your server.
Validate if /dev/sda has automounted in /boot directory.
Code: Select all
lsblk
Code: Select all
apt update && apt upgrade -y