Univention Bugzilla – Bug 53319
EC2 images: grwofs broken
Last modified: 2022-07-04 14:08:18 CEST
+++ This bug was initially created as a clone of Bug #51968 comment 11 +++ FAIL partition is not resized during boot (works with the Univention Corporate Server (UCS) 4.4 (official image) rev. 9 ami) -> df -h Filesystem Size Used Avail Use% Mounted on udev/xvda1 9.7G 2.8G 6.4G 31% / -> fdisk -l /dev/xvda Disk /dev/xvda: 30 GiB, 32212254720 bytes, 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 Disklabel type: dos Disk identifier: 0x1228ee5d Device Boot Start End Sectors Size Id Type /dev/xvda1 * 2048 20969471 20967424 10G 83 Linux Is that important? Seems that cloud-initramfs-growroot (and the patched growroot) is no longer working, see utils/base_appliance.sh::setup_ec2. What worked for me now was modifying /etc/init.d/resize2fs (also a script from us -> setup_ec2) #!/bin/bash ### BEGIN INIT INFO # Provides: resize2fs # Required-Start: $local_fs # Required-Stop: # Default-Start: 2 # Default-Stop: # Short-Description: resize filesystem upon boot ### END INIT INFO +growpart /dev/xvda 1 resize2fs /dev/xvda1 & +rm $0 disown
systemd has native support for growing file systems: <https://www.freedesktop.org/software/systemd/man/systemd-makefs@.service.html#>
This no longer works with UCS-5.0 as ROOT=$UUID is used, which /usr/share/initramfs-tools/scripts/init-premount/growroot does not handle: > case "${rootdev}" in > *[0-9]) : ;; > # the root is a disk, not a partition (does not end in a digit) > # no need to do anything in this case, kernel already knows the full size. > *) exit 0;; > esac /run/initramfs/initramfs.debug: … + /scripts/init-premount/growroot + PREREQS= + . /scripts/functions + TEMP_D= + RESTORE_FROM= + '[' -f /root/var/lib/cloud/instance/root-grown + '[' -f /root/etc/growroot-disabled ] + '[' -f /root/etc/growroot-grown ] + '[' '!' -L 'UUID=b28e7ce9-76ad-475e-8684-bffdd139303e' ] + rootdev='UUID=b28e7ce9-76ad-475e-8684-bffdd139303e' + exit 0 # grep -n --color ^[^#] /etc/fstab 9:UUID=b28e7ce9-76ad-475e-8684-bffdd139303e / ext4 errors=remount-ro 0 1 10:/dev/sr0 /media/cdrom0 udf,iso9660 user,noauto 0 0 # ucr search --brief --value /dev/xvda grub/boot: /dev/xvda grub/root: /dev/xvda1 This is automatically converted to "root=UUID=…" because it is not and cannot be disabled via UCR: > /etc/default/grub:44:# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux > /etc/default/grub:45:GRUB_DISABLE_LINUX_UUID=true
<https://www.freedesktop.org/software/systemd/man/systemd-repart.html> only got added with systemd v245 and is only available from <https://packages.debian.org/source/buster-backports/systemd>. r19620 | Bug #53319: support for identifying device by LABEL= or UUID= Package: cloud-initramfs-tools Version: 0.18.debian7A~5.0.0.202206161152 Branch: ucs_5.0-0 Scope: ucs5.0-2 OK: Tested successfully on AWS EC2 PS: I've contacted Debian because their version <https://packages.debian.org/search?keywords=cloud-initramfs-tools&searchon=sourcenames&suite=all§ion=all> is severely behind upstream <https://launchpad.net/cloud-initramfs-tools>
partition is resized durig boot: OK Verified
ssh -i ~/.ssh/ph-test.pem -l root 10.210.240.245 'lsblk;df -h /' > NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT > xvda 202:0 0 17G 0 disk > └─xvda1 202:1 0 17G 0 part / > Filesystem Size Used Avail Use% Mounted on > /dev/xvda1 17G 2.8G 13G 18% /
UCS 5.0-2 has been released. https://docs.software-univention.de/release-notes-5.0-2-en.html If this error occurs again, please clone this bug.