Closed nils-ossenbrink closed 1 year ago
Many thanks for reporting this bug! It seems to affect only new devices and therefore the automated tests did not discover the glitch. I will take a look at it as soon as possible.
I need to verify the change on a new setup and eventually backport it to Debian bullseye.
What do I have to do to get fdisk installed during the image build process?
The typical workflow in this case looks as follows:
sudo edi -v image create iot-gate-imx8.yml
sudo edi -v image create --recursive-clean 4 iot-gate-imx8.yml
sudo edi -v image create iot-gate-imx8.yml
Explanation of step 4:
The --recursive-clean
is done according to the command pipeline. As the above change is a simple addition of a package we do not need to re-create the entire LXD container. Instead we can keep it and just run the Ansible playbooks on it again. This will make sure that fdisk gets installed. If substantial changes are done on the container then a --recursive-clean 5
might be a safe bet as this will remove the LXD container and the Ansible playbooks will be applied again on a fresh container. A --recursive-clean 10
will delete all artifacts including the ones that got created using debootstrap
. On fundamental playbook changes it is also advisable to start the image build using the --debug
option: sudo edi -v --debug image create iot-gate-imx8.yml
. Using this option it is possible to change playbooks on the fly as soon as they hit an error.
edi
does not even try to be smart about what needs to be re-created because of a certain project configuration change. However, the developer can easily decide:
--recursive-clean 1
if a post processing step got changed.--recursive-clean 4
if a small addition has been done on a playbook.--recursive-clean 5
if the whole LXD container shall get re-created (e.g. due to a fundamental playbook change).--recursive-clean 10
if everything shall get re-created e.g. due to a bootstrapping modification.Now also fixed on Debian bullseye:
compulab@iot-gate-imx8:~$ sudo systemctl status edi-resize-rootfs
● edi-resize-rootfs.service - resize root file system
Loaded: loaded (/lib/systemd/system/edi-resize-rootfs.service; enabled; vendor preset: enabled)
Active: inactive (dead) since Sat 2023-10-28 21:26:40 UTC; 46s ago
Process: 334 ExecStart=/usr/bin/edi-resize-rootfs (code=exited, status=0/SUCCESS)
Main PID: 334 (code=exited, status=0/SUCCESS)
CPU: 524ms
Oct 28 21:26:30 iot-gate-imx8 edi-resize-rootfs[416]: Re-reading the partition table failed.: Device or resource busy
Oct 28 21:26:30 iot-gate-imx8 edi-resize-rootfs[416]: The kernel still uses the old table. The new table will be used at the next reboot or after you run partprobe(8) or partx(8).
Oct 28 21:26:30 iot-gate-imx8 edi-resize-rootfs[416]: Syncing disks.
Oct 28 21:26:31 iot-gate-imx8 edi-resize-rootfs[447]: resize2fs 1.46.2 (28-Feb-2021)
Oct 28 21:26:40 iot-gate-imx8 edi-resize-rootfs[447]: Filesystem at /dev/sda3 is mounted on /; on-line resizing required
Oct 28 21:26:40 iot-gate-imx8 edi-resize-rootfs[447]: old_desc_blocks = 1, new_desc_blocks = 1
Oct 28 21:26:40 iot-gate-imx8 edi-resize-rootfs[447]: The filesystem on /dev/sda3 is now 931328 (4k) blocks long.
Oct 28 21:26:40 iot-gate-imx8 edi-resize-rootfs[334]: disk layout of sda successfully changed
Oct 28 21:26:40 iot-gate-imx8 systemd[1]: edi-resize-rootfs.service: Succeeded.
Oct 28 21:26:40 iot-gate-imx8 systemd[1]: Finished resize root file system.
compulab@iot-gate-imx8:~$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/root 3.5G 407M 3.0G 12% /
devtmpfs 989M 0 989M 0% /dev
tmpfs 991M 0 991M 0% /dev/shm
tmpfs 397M 6.2M 390M 2% /run
tmpfs 5.0M 0 5.0M 0% /run/lock
/dev/sda1 104M 32K 95M 1% /boot/firmware
/dev/sda2 224M 60K 206M 1% /data
tmpfs 199M 0 199M 0% /run/user/2000
compulab@iot-gate-imx8:~$ sudo systemctl status edi-resize-rootfs
● edi-resize-rootfs.service - resize root file system
Loaded: loaded (/lib/systemd/system/edi-resize-rootfs.service; enabled; vendor preset: enabled)
Active: inactive (dead) since Sat 2023-10-28 21:26:40 UTC; 46s ago
Process: 334 ExecStart=/usr/bin/edi-resize-rootfs (code=exited, status=0/SUCCESS)
Main PID: 334 (code=exited, status=0/SUCCESS)
CPU: 524ms
Oct 28 21:26:30 iot-gate-imx8 edi-resize-rootfs[416]: Re-reading the partition table failed.: Device or resource busy
Oct 28 21:26:30 iot-gate-imx8 edi-resize-rootfs[416]: The kernel still uses the old table. The new table will be used at the next reboot or after you run partprobe(8) or partx(8).
Oct 28 21:26:30 iot-gate-imx8 edi-resize-rootfs[416]: Syncing disks.
Oct 28 21:26:31 iot-gate-imx8 edi-resize-rootfs[447]: resize2fs 1.46.2 (28-Feb-2021)
Oct 28 21:26:40 iot-gate-imx8 edi-resize-rootfs[447]: Filesystem at /dev/sda3 is mounted on /; on-line resizing required
Oct 28 21:26:40 iot-gate-imx8 edi-resize-rootfs[447]: old_desc_blocks = 1, new_desc_blocks = 1
Oct 28 21:26:40 iot-gate-imx8 edi-resize-rootfs[447]: The filesystem on /dev/sda3 is now 931328 (4k) blocks long.
Oct 28 21:26:40 iot-gate-imx8 edi-resize-rootfs[334]: disk layout of sda successfully changed
Oct 28 21:26:40 iot-gate-imx8 systemd[1]: edi-resize-rootfs.service: Succeeded.
Oct 28 21:26:40 iot-gate-imx8 systemd[1]: Finished resize root file system.
compulab@iot-gate-imx8:~$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/root 3.5G 407M 3.0G 12% /
devtmpfs 989M 0 989M 0% /dev
tmpfs 991M 0 991M 0% /dev/shm
tmpfs 397M 6.2M 390M 2% /run
tmpfs 5.0M 0 5.0M 0% /run/lock
/dev/sda1 104M 32K 95M 1% /boot/firmware
/dev/sda2 224M 60K 206M 1% /data
tmpfs 199M 0 199M 0% /run/user/2000
Many thanks for the detailed explanantion! I will dig deeper into the "edi-world" in the next weeks to get a clearer understanding how everything works together...
Cheers Nils
First of all thanks for this great framework. This is exactly what i was looking for!
I had success building the image for the iot gateway and booting it. Unfortunately the resize script was failing on first boot because the command sfdisk was missing. I tried adding fdisk to the "playbook" but had no success with it. After installing it "by hand" on the device and executing the script the resize was successfull. What do I have to di to get fdisk installed during the image build process? Thanks! Nils