Error: No space left on device

389 views
Skip to first unread message

esad ergül

unread,
May 9, 2022, 9:14:59 AM5/9/22
to swupdate
Hi all,

I am building a disk image (efi based x86_64 with grub) and root file system image with elbe tool. Then I create a swu image with rootfs image. ( SWUpdate: syntax and tags with the default parser — Embedded Software Update Documentation 2021.11 documentation (sbabic.github.io)  ) When I do an update I always get the error that there is no space available, although there is enough space on the second rootfs partition (sda5). 

software = {
    version = "0.1.0";
    hardware-compatibility = ["Demo","1.0"];

    rootfs: {
        copy1: {
            images: ({
                filename = "root.img.tar.gz";
                device = "/dev/sda3";
                compressed = "zlib";
                installed-directly = true;
                type = "raw";
                sha256 = "807797c6f3e80c3abb3298973d28b7929d3d3011f8be643107728ee0df0761f9";
            });
            -------------------
        };
        copy2: {
            images: ({
                filename = "root.img.tar.gz";
                device = "/dev/sda5";
                compressed = "zlib";
                installed-directly = true;
                type = "raw";
                sha256 = "807797c6f3e80c3abb3298973d28b7929d3d3011f8be643107728ee0df0761f9";
            });
          ---------------
        };
    };
};

$ lsblk
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda      8:0    0  29.8G  0 disk
|-sda1   8:1    0 190.8M  0 part /boot/efi
|-sda2   8:2    0 190.8M  0 part /boot/grub
|-sda3   8:3    0   3.7G  0 part /
|-sda4   8:4    0 333.8M  0 part /config
|-sda5   8:5    0   3.7G  0 part
`-sda6   8:6    0  21.7G  0 part /data

df -h /dev/sd*
Filesystem      Size  Used Avail Use% Mounted on
udev            3.9G     0  3.9G   0% /dev
/dev/sda1       191M  144K  191M   1% /boot/efi
/dev/sda2       181M  8.9M  159M   6% /boot/grub
/dev/sda3       3.7G  3.2G  253M  93% /
/dev/sda4       316M  2.3M  293M   1% /config
udev            3.9G     0  3.9G   0% /dev
/dev/sda6        22G  1.3G   19G   6% /data



May 09 13:57:09 Demo swupdate[13413]: IDLE Waiting for requests...
May 09 14:02:28 Demo swupdate.sh[13413]: [TRACE] : SWUPDATE running :  [network_thread] : Incoming network request: processing...
May 09 14:02:28 Demo swupdate.sh[13413]: [INFO ] : SWUPDATE started :  Software Update started !
May 09 14:02:28 Demo swupdate.sh[13413]: [TRACE] : SWUPDATE running :  [network_initializer] : Software update started
May 09 14:02:28 Demo swupdate.sh[13413]: [TRACE] : SWUPDATE running :  [extract_file_to_tmp] : Found file
May 09 14:02:28 Demo swupdate.sh[13413]: [TRACE] : SWUPDATE running :  [extract_file_to_tmp] :         filename sw-description
May 09 14:02:28 Demo swupdate.sh[13413]: [TRACE] : SWUPDATE running :  [extract_file_to_tmp] :         size 1429
May 09 14:02:28 Demo swupdate.sh[13413]: [TRACE] : SWUPDATE running :  [extract_file_to_tmp] : Found file
May 09 14:02:28 Demo swupdate.sh[13413]: [TRACE] : SWUPDATE running :  [extract_file_to_tmp] :         filename sw-description.sig
May 09 14:02:28 Demo swupdate.sh[13413]: [TRACE] : SWUPDATE running :  [extract_file_to_tmp] :         size 2088
May 09 14:02:28 Demo swupdate[13413]: RUN [network_thread] : Incoming network request: processing...
May 09 14:02:28 Demo swupdate.sh[13413]: [TRACE] : SWUPDATE running :  [swupdate_verify_file] : Verified OK
May 09 14:02:28 Demo swupdate.sh[13413]: [TRACE] : SWUPDATE running :  [get_common_fields] : Version 0.1.0
May 09 14:02:28 Demo swupdate.sh[13413]: [TRACE] : SWUPDATE running :  [parse_hw_compatibility] : Accepted Hw Revision : Demo
May 09 14:02:28 Demo swupdate.sh[13413]: [TRACE] : SWUPDATE running :  [parse_hw_compatibility] : Accepted Hw Revision : 1.0
May 09 14:02:28 Demo swupdate.sh[13413]: [TRACE] : SWUPDATE running :  [_parse_images] : Found compressed Image: root.img.tar.gz in device : /dev/sda5 for handler raw (installed from stream)
May 09 14:02:28 Demo swupdate.sh[13413]: [TRACE] : SWUPDATE running :  [_parse_scripts] : Found Script: update.sh
May 09 14:02:28 Demo swupdate.sh[13413]: [TRACE] : SWUPDATE running :  [_parse_bootloader] : Bootloader var: boot_entry = 1
May 09 14:02:28 Demo swupdate.sh[13413]: [TRACE] : SWUPDATE running :  [check_hw_compatibility] : Hardware Demo Revision: 1.0
May 09 14:02:28 Demo swupdate.sh[13413]: [TRACE] : SWUPDATE running :  [check_hw_compatibility] : Hardware compatibility verified
May 09 14:02:28 Demo swupdate.sh[13413]: [TRACE] : SWUPDATE running :  [extract_files] : Found file
May 09 14:02:28 Demo swupdate.sh[13413]: [TRACE] : SWUPDATE running :  [extract_files] :         filename root.img.tar.gz
May 09 14:02:28 Demo swupdate.sh[13413]: [TRACE] : SWUPDATE running :  [extract_files] :         size 1244954714 required
May 09 14:02:28 Demo swupdate.sh[13413]: [TRACE] : SWUPDATE running :  [extract_files] : Installing STREAM root.img.tar.gz, 1244954714 bytes
May 09 14:02:28 Demo swupdate[13413]: START Software Update started !
May 09 14:02:28 Demo swupdate.sh[13413]: [TRACE] : SWUPDATE running :  [install_single_image] : Found installer for stream root.img.tar.gz raw
May 09 14:02:28 Demo swupdate[13413]: RUN [network_initializer] : Software update started
May 09 14:02:28 Demo swupdate[13413]: RUN [extract_file_to_tmp] : Found file
May 09 14:02:28 Demo swupdate[13413]: RUN [extract_file_to_tmp] :         filename sw-description
May 09 14:02:28 Demo swupdate[13413]: RUN [extract_file_to_tmp] :         size 1429
May 09 14:02:28 Demo swupdate[13413]: RUN [extract_file_to_tmp] : Found file
May 09 14:02:28 Demo swupdate[13413]: RUN [extract_file_to_tmp] :         filename sw-description.sig
May 09 14:02:28 Demo swupdate[13413]: RUN [extract_file_to_tmp] :         size 2088
May 09 14:02:28 Demo swupdate[13413]: RUN [swupdate_verify_file] : Verified OK
May 09 14:02:28 Demo swupdate[13413]: RUN [get_common_fields] : Version 0.1.0
May 09 14:02:28 Demo swupdate[13413]: RUN [parse_hw_compatibility] : Accepted Hw Revision : Demo
May 09 14:02:28 Demo swupdate[13413]: RUN [parse_hw_compatibility] : Accepted Hw Revision : 1.0
May 09 14:02:28 Demo swupdate[13413]: RUN [_parse_images] : Found compressed Image: root.img.tar.gz in device : /dev/sda5 for handler raw (installed from stream)
May 09 14:02:28 Demo swupdate[13413]: RUN [_parse_scripts] : Found Script: update.sh
May 09 14:02:28 Demo swupdate[13413]: RUN [_parse_bootloader] : Bootloader var: boot_entry = 1
May 09 14:02:28 Demo swupdate[13413]: RUN [check_hw_compatibility] : Hardware Demo Revision: 1.0
May 09 14:02:28 Demo swupdate[13413]: RUN [check_hw_compatibility] : Hardware compatibility verified
May 09 14:02:28 Demo swupdate[13413]: RUN [extract_files] : Found file
May 09 14:02:28 Demo swupdate[13413]: RUN [extract_files] :         filename root.img.tar.gz
May 09 14:02:28 Demo swupdate[13413]: RUN [extract_files] :         size 1244954714 required
May 09 14:02:28 Demo swupdate[13413]: RUN [extract_files] : Installing STREAM root.img.tar.gz, 1244954714 bytes
May 09 14:02:28 Demo swupdate[13413]: RUN [install_single_image] : Found installer for stream root.img.tar.gz raw
May 09 14:04:00 Demo swupdate.sh[13413]: [ERROR] : SWUPDATE failed [0] ERROR : cannot write 8687 bytes: No space left on device
May 09 14:04:00 Demo swupdate[13413]: FAILURE ERROR : cannot write 8687 bytes: No space left on device
May 09 14:04:05 Demo swupdate.sh[13413]: [TRACE] : SWUPDATE running :  [install_single_image] : Installer for raw not successful !
May 09 14:04:05 Demo swupdate.sh[13413]: [ERROR] : SWUPDATE failed [0] ERROR : Error streaming root.img.tar.gz
May 09 14:04:05 Demo swupdate.sh[13413]: [ERROR] : SWUPDATE failed [1] Image invalid or corrupted. Not installing ...
May 09 14:04:05 Demo swupdate[13413]: RUN [install_single_image] : Installer for raw not successful !
May 09 14:04:05 Demo swupdate.sh[13413]: [TRACE] : SWUPDATE running :  [network_initializer] : Main thread sleep again !


If I write the root.img file directly with dd command to second rootfs partition, it works and the system can be booted from second rootfs (if I set bootloader variables manually and reboot the device).

$ fdisk -l
Disk /dev/sda: 29.8 GiB, 32017047552 bytes, 62533296 sectors
Disk model: TS32GSSD370S
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: gpt
Disk identifier: F4AF0D42-57C1-4315-AE65-AE14EDC9DE9E

Device        Start      End  Sectors   Size Type
/dev/sda1      2048   392672   390625 190.8M EFI System
/dev/sda2    392673   783297   390625 190.8M Linux filesystem
/dev/sda3    783298  8595797  7812500   3.7G Linux filesystem
/dev/sda4   8595798  9279390   683593 333.8M Linux filesystem
/dev/sda5   9279391 17091890  7812500   3.7G Linux filesystem
/dev/sda6  17092608 62531583 45438976  21.7G Linux filesystem
$ cpio -idv < ../demo_1.0.swu
sw-description
sw-description.sig
root.img.tar.gz
update.sh
2431565 blocks
$ ls
root.img.tar.gz  sw-description  sw-description.sig  update.sh
$ tar -xzOf root.img.tar.gz | dd of=/dev/sda5 bs=1M status=progress
3820850688 bytes (3.8 GB, 3.6 GiB) copied, 73 s, 52.3 MB/s
0+217655 records in
0+217655 records out
4000000000 bytes (4.0 GB, 3.7 GiB) copied, 82.7683 s, 48.3 MB/s
$ mkdir /newroot
$ mount /dev/sda5 /newroot/
$ ls /newroot/
bin   dev  home        initrd.img.old  lib32  libx32      md5sums.bz2  mnt   opt   root  sbin  sys  usr  vmlinuz
boot  data      etc  initrd.img  lib             lib64  lost+found  media        nand  proc  run   srv   tmp  var  vmlinuz.old
$ df -h /dev/sd*
Filesystem      Size  Used Avail Use% Mounted on
udev            3.9G     0  3.9G   0% /dev
/dev/sda1       191M  144K  191M   1% /boot/efi
/dev/sda2       181M  8.9M  159M   6% /boot/grub
/dev/sda3       3.7G  3.2G  253M  93% /
/dev/sda4       316M  2.3M  293M   1% /config
/dev/sda5       3.7G  3.2G  253M  93% /newroot
/dev/sda6        22G  6.1G   15G  31% /data

I would be very happy if someone could give me a hint how to fix this error.

Best regards,
Esad

esad ergül

unread,
May 11, 2022, 5:11:44 AM5/11/22
to swupdate
Sorry, I found my mistake, I created the second rootfs partition with parted in MB. Therefore some bytes were missing. I calculated the partition size in bytes and then created the partiiton. Then it worked.

Best regards

Esad
Reply all
Reply to author
Forward
0 new messages