Distrobuilder storage space error

When using distrobuilder to create an image, getting following error: Could not install packages due to an EnvironmentError: [Errno 28] No space left on device

I do have 70GB remaining in my ‘/’ folder, but still getting this error

Result of df -h command:

Filesystem      Size  Used Avail Use% Mounted on
udev            4.8G     0  4.8G   0% /dev
tmpfs           996M  1.4M  995M   1% /run
/dev/vda1        95G   17G   78G  18% /
tmpfs           4.9G     0  4.9G   0% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           4.9G     0  4.9G   0% /sys/fs/cgroup
/dev/vda15      105M  6.1M   99M   6% /boot/efi
/dev/loop1       56M   56M     0 100% /snap/core18/2066
tmpfs           996M   24K  996M   1% /run/user/123
tmpfs           996M  4.0K  996M   1% /run/user/1000
/dev/loop3       64M   64M     0 100% /snap/core20/1852
/dev/loop4       50M   50M     0 100% /snap/snapd/18596
/dev/loop5       92M   92M     0 100% /snap/lxd/24061
/dev/loop6       56M   56M     0 100% /snap/core18/2721
/dev/loop2      112M  112M     0 100% /snap/lxd/24322
/dev/loop0      8.7M  8.7M     0 100% /snap/distrobuilder/1364
tmpfs           1.0M     0  1.0M   0% /var/snap/lxd/common/ns

Any advice on how should I resolve this?

Is that when building a container or a VM image?
I believe VM images use a loop file with a fixed size, so that could explain it.

I also believe there’s a config option that can be used to bump that size to a larger value when needed.

@monstermunchkin

HI @stgraber , Also facing the same problem. I am trying to build a container image (type: container) but still facing this problems.
Can you point me tot he config option to bump the size

Container Image.

Any update on this? @stgraber

What command(s) are you running, and could you provide logs (--debug flag)? Also, does setting --cache-dir=<dir> solve your issue?

Hi
I tried with cache-dirbut no luck. Will share the logs with --debug flag

I was able to find the issue. Its due to python PIP throwing Space Error when installing torch. I created a /tmp directory and did pip install. Still getting the space error. Is there a way to assign more space to image build process?

HI @monstermunchkin and @stgraber

I am building an image using below yaml file

image:
  name: Ubuntu20-CUDA11.3
  distribution: ubuntu
  release: focal
  description: |-
    Ubuntu {{ image.release }}
  architecture: x86_64

source:
  downloader: debootstrap
  same_as: gutsy
  url: http://archive.ubuntu.com/ubuntu
  keyserver: keyserver.ubuntu.com
  keys:
  - 0x790BC7277767219C42C86F933B4FE6ACC0B21F32
  - 0xf6ecb3762474eda9d21b7022871920d1991bc93c

targets:
  lxc:
    create_message: |-
      You just created an {{ image.description }} container.

      To enable SSH, run: apt install openssh-server
      No default root or user password are set by LXC.
    config:
    - type: all
      before: 5
      content: |-
        lxc.include = LXC_TEMPLATE_CONFIG/ubuntu.common.conf

    - type: user
      before: 5
      content: |-
        lxc.include = LXC_TEMPLATE_CONFIG/ubuntu.userns.conf

    - type: all
      after: 4
      content: |-
        lxc.include = LXC_TEMPLATE_CONFIG/common.conf

    - type: user
      after: 4
      content: |-
        lxc.include = LXC_TEMPLATE_CONFIG/userns.conf

    - type: all
      content: |-
        lxc.arch = {{ image.architecture_personality }}

files:
- path: /etc/hostname
  generator: hostname

- path: /etc/hosts
  generator: hosts

- path: /etc/resolvconf/resolv.conf.d/original
  generator: remove

- path: /etc/resolvconf/resolv.conf.d/tail
  generator: remove

- path: /etc/machine-id
  generator: dump

- path: /etc/user/profile
  generator: copy
  source: /etc/profile

- path: /var/lib/dbus/machine-id
  generator: remove

- path: /etc/netplan/10-lxc.yaml
  generator: dump
  content: |-
    network:
      version: 2
      ethernets:
        eth0:
          dhcp4: true
          dhcp-identifier: mac
  releases:
  - focal
  types:
  - container
  variants:
  - default

packages:
  manager: apt
  update: true
  cleanup: true
  sets:
  - packages:
    - language-pack-en
    - openssh-client
    - vim
    - curl
    - wget
    - git
    action: install
  
  ## Add packages required for CUDA
  - packages:
    - build-essential
    - cmake
    - g++-7
    - apt-utils
    - python3-pip
    - software-properties-common
    - initramfs-tools
    - update-motd
    - figlet
    action: install


  repositories:
  - name: sources.list
    url: |-
      deb http://archive.ubuntu.com/ubuntu {{ image.release }} main restricted universe multiverse
      deb http://archive.ubuntu.com/ubuntu {{ image.release }}-updates main restricted universe multiverse
      deb http://security.ubuntu.com/ubuntu {{ image.release }}-security main restricted universe multiverse
    architectures:
    - amd64
    - i386

  - name: sources.list
    url: |-
      deb http://ports.ubuntu.com/ubuntu-ports {{ image.release }} main restricted universe multiverse
      deb http://ports.ubuntu.com/ubuntu-ports {{ image.release }}-updates main restricted universe multiverse
      deb http://ports.ubuntu.com/ubuntu-ports {{ image.release }}-security main restricted universe multiverse
    architectures:
    - armhf
    - arm64

actions:
- trigger: post-update
  action: |-
    #!/bin/sh
    set -eux

    # Create the ubuntu user account
    getent group sudo >/dev/null 2>&1 || groupadd --system sudo
    useradd --create-home -s /bin/bash -G sudo -U ubuntu
  variants:
  - default

- trigger: post-packages
  action: |-
    #!/bin/sh
    runuser -l ubuntu -c 'mkdir -p /home/ubuntu/tmp'
    runuser -l ubuntu -c 'python3 -m pip install --cache-dir=/home/ubuntu/tmp/ torch torchvision torchaudio'
    rm -rf /home/ubuntu/tmp

  releases:
  - focal

- trigger: post-packages
  action: |-
    #!/bin/sh
    set -eux

    # Make sure the locale is built and functional
    locale-gen en_US.UTF-8
    update-locale LANG=en_US.UTF-8

    # Cleanup underlying /run
    mount -o bind / /mnt
    rm -rf /mnt/run/*
    umount /mnt

    # Cleanup temporary shadow paths
    rm /etc/*-

mappings:
  architecture_map: debian

My system has 100GB for storage

Filesystem      Size  Used Avail Use% Mounted on
udev            3.9G     0  3.9G   0% /dev
tmpfs           795M  1.4M  794M   1% /run
/dev/vda1        97G  8.4G   89G   9% /
tmpfs           3.9G     0  3.9G   0% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           3.9G     0  3.9G   0% /sys/fs/cgroup
/dev/loop0       68M   68M     0 100% /snap/lxd/20326
/dev/loop1       33M   33M     0 100% /snap/snapd/12057
/dev/vda15      105M  6.1M   99M   6% /boot/efi
/dev/loop2       56M   56M     0 100% /snap/core18/2066
tmpfs           795M   24K  795M   1% /run/user/123
tmpfs           795M  4.0K  795M   1% /run/user/1000
/dev/loop3       64M   64M     0 100% /snap/core20/1879
/dev/loop4      112M  112M     0 100% /snap/lxd/24322
/dev/loop5      8.7M  8.7M     0 100% /snap/distrobuilder/1364
/dev/loop6       56M   56M     0 100% /snap/core18/2721
tmpfs           1.0M     0  1.0M   0% /var/snap/lxd/common/ns
  • When trying to build using command: sudo distrobuilder build-lxd --debug test4.yaml, getting below error
  • it is during python package installation, getting this error.

Tried multiple ways, but still no luck. Any input highly appriciated