Skip to content

roughly estimate the disk space required before write to disk using bootc install to-existing-root #1214

@shi2wei3

Description

@shi2wei3

When deploy bootc container image on a package mode system which doesn't have enough disk space left, installation process with report error and system is unable to boot.
It's better to check if free space left is enough before write anything to the disk.

# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda4       4.0G  1.5G  2.1G  42% /
...
# podman run --tls-verify=false --rm --privileged --pid=host --security-opt label=type:unconfined_t -v /var/lib/containers:/var/lib/containers -v /:/target <fedora-bootc-rawhide-standard> bootc install to-existing-root
Installing image: docker://<fedora-bootc-rawhide-standard>
Digest: sha256:4d258383017c1a2148b1c3caa722ce683a7adec335ae8c229128d4f1e7a24b04
----------------------------
WARNING: This operation will OVERWRITE THE BOOTED HOST ROOT FILESYSTEM and is NOT REVERSIBLE.
Waiting 20s to continue; interrupt (Control-C) to cancel.
----------------------------
Initializing ostree layout
layers already present: 0; layers needed: 1 (840.5 MB)
ERROR Installing to filesystem: Creating ostree deployment: Pulling: Importing: Parsing layer blob sha256:2876214f12fdbf39fbf1cd9281ceddd463d04350e6b68fb1bf69710fa703e6e1: error: ostree-tar:
Failed to handle file: ostree-tar: Failed to import file: Writing content object: fallocate: No space left on device: Processing tar: Failed to commit tar: ExitStatus(unix_wait_status(256))

# reboot

Booting from Hard Disk...
GRUB loading.......
Welcome to GRUB!

                               GRUB version 2.12

   Minimal BASH-like line editing is supported. For the first word, TAB
   lists possible command completions. Anywhere else TAB lists possible
   device or file completions. To enable less(1)-like paging, "set
   pager=1".


grub>

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions