systemd / mkosi

💽 Build Bespoke OS Images
https://mkosi.systemd.io/
GNU Lesser General Public License v2.1
1.11k stars 302 forks source link

No space left on device while populating file system #2435

Closed a-andre closed 4 months ago

a-andre commented 4 months ago

On Arch Linux with mkosi version 20.2-2 and systemd version 255.4-1

mkosi build fails with the following error

‣  Generating disk image
Pre-populating ext4 filesystem of partition 10-root.conf twice to calculate minimal partition size
Populating ext4 filesystem.
Successfully populated ext4 filesystem.
mke2fs 1.47.0 (5-Feb-2023)
Discarding device blocks: done                            
Creating filesystem with 268435456 4k blocks and 67108864 inodes
Filesystem UUID: eb2e7b5a-e488-46a5-8c96-8819a68f1570
Superblock backups stored on blocks: 
    32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 
    4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968, 
    102400000, 214990848

Allocating group tables: done                            
Writing inode tables: done                            
Creating journal (262144 blocks): done
Copying files into the device: pt: No space left on device while looking up "pt"
mkfs.ext4: No space left on device while populating file system
(mkfs) failed with exit status 1.
‣ "systemd-repart --empty=allow --size=auto --dry-run=no --json=pretty --no-pager --offline=yes --seed random /home/user/.cache/mkosi-workspace28ef2quy/staging/arch.raw --root /home/user/.cache/mkosi-workspace28ef2quy/root --empty=create --defer-partitions esp,xbootldr --definitions /home/user/.cache/mkosi-workspace28ef2quy/repart-definitions" returned non-zero exit code 1.

More than 200GB free storage is available on the used partition.

Content of the used mkosi.conf:

[Distribution]
Distribution=arch
Architecture=x86-64

[Output]
Format=disk
Output=arch
BuildDirectory=mkosi.builddir
CacheDirectory=mkosi.cache

[Content]
Autologin=no
Bootable=yes
CleanPackageMetadata=no
RootPassword=root
WithDocs=no

Packages=
    base
    base-devel
    bash-completion
    breeze-icons
    cargo
    cmake
    eigen
    featherpad
    gnuplot
    gsl
    gvfs
    jdk-openjdk
    less
    linux
    lxqt
    nano
    openssh
    python
    python-matplotlib
    python-numpy
    python-pandas
    sddm
    unzip
    vim

[Host]
Incremental=yes
QemuGui=yes

With python-pandas or jdk-openjdk (and maybe others) removed from Packages the error is gone.

DaanDeMeyer commented 4 months ago

@a-andre This output very likely indicates some filesystem on your host system is running out of space trying to build the image. Are you sure your home directory filesystem has sufficient space available?

a-andre commented 4 months ago

Yes. Watching the usage of the different file systems when running mkosi, only the usage of one partition changes and that's the one with the working directory and ~/.cache/mkosi*/. There is plenty of space left on that partition, about 200GB. Is mkosi writing to some other locations than the working directory and ~/.cache/mkosi*/, maybe some tmpfs?

Can you create a disk image using the above mkosi.conf?

DaanDeMeyer commented 4 months ago

@a-andre The mkosi.conf you provided works fine for me.

mkosi should not be writing outside of ~/.cache generally. You could try running with --debug to see if it writes to some other location.

Please also make sure the problem still reproduces when running from mkosi git.

a-andre commented 4 months ago

I don't get the error using current master (c54ce6e6). So it seems the problem was fixed somewhere between v20.2 and c54ce6e6.