Hi,

Quoting Francesco Poli (wintermute) (2024-01-10 23:54:30)
> I am giving mmdebstrap-autopkgtest-build-qemu a try.

thank you!

> The following command fails:
> 
>   $ mmdebstrap-autopkgtest-build-qemu --boot=efi sid sid_amd64.img
> 
> during some package installation with "no space left on device" error,
> since I have /tmp on a somewhat small physical partition:
> 
>   $ df --si /tmp/
>   Filesystem      Size  Used Avail Use% Mounted on
>   /dev/md3        868M   99k  806M   1% /tmp

yes, that looks too small.

> I tried with a TMPDIR in system memory:
> 
>   $ TMPDIR=/dev/shm mmdebstrap-autopkgtest-build-qemu \
>                     --boot=efi sid sid_amd64.img
> 
> but it again fails with the following (final chunk of) output:
> 
>   [...]
>   cp: warning: behavior of -n is non-portable and may change in future; use 
> --update=none instead
>   I: running special hook: download vmlinuz '/dev/shm/tmp.uNRUbVgiOu/kernel'
>   I: running special hook: download initrd.img 
> '/dev/shm/tmp.uNRUbVgiOu/initrd'
>   I: running --customize-hook in shell: sh -c 'mount --bind "$1" "$1/mnt"' 
> exec /dev/shm/mmdebstrap.IXehDNUWIf
>   I: running --customize-hook in shell: sh -c 'mount --bind "$1/mnt/mnt" 
> "$1/mnt/dev"' exec /dev/shm/mmdebstrap.IXehDNUWIf
>   I: running --customize-hook in shell: sh -c '/sbin/mkfs.ext4 -d "$1/mnt" -L 
> autopkgtestvm -E 'offset=134217728,assume_storage_prezeroed=1' 
> 'sid_amd64.img' '25G'' exec /dev/shm/mmdebstrap.IXehDNUWIf
>   mke2fs 1.47.0 (5-Feb-2023)
>   mkfs.ext4: Permission denied while trying to determine filesystem size
>   E: setup failed: E: command failed: /sbin/mkfs.ext4 -d "$1/mnt" -L 
> autopkgtestvm -E 'offset=134217728,assume_storage_prezeroed=1' 
> 'sid_amd64.img' '25G'
>   W: hooklistener errored out: E: received eof on socket
>   
>   I: main() received signal PIPE: waiting for setup...
>   I: removing tempdir /dev/shm/mmdebstrap.IXehDNUWIf...
>   E: mmdebstrap failed to run
>   mmdebstrap failed
> 
> Does it fail because I do not have enough system memory?
> 
>   $ df --si /dev/shm/
>   Filesystem      Size  Used Avail Use% Mounted on
>   tmpfs           8.3G  108M  8.2G   2% /dev/shm
> 
> Is this the explanation?
> Otherwise, what went wrong?

Interesting! I'm unable to reproduce either of these issues and I'm also
puzzled why you get this "permission denied" error. On my system, I'm able run
your command with the default (in /tmp) as well as in /dev/shm. Here is the
free space each:

    $ df --si /tmp /dev/shm
    Filesystem      Size  Used Avail Use% Mounted on
    tmpfs           8.6G  4.1k  8.6G   1% /tmp
    tmpfs           2.0G  418k  2.0G   1% /dev/shm

Maybe something is mounted in a funny way? Both my /tmp and my /dev/shm are
tmpfs. The former is mounted with
rw,nosuid,nodev,relatime,size=8388608k,inode64 and the latter with
rw,nosuid,nodev,inode64.

I doubt that it fails for lack of system memory unless you have less than 3.7
GB of RAM.

Maybe permissions are somehow whacky? Both my /tmp and my /dev/shm are set to
drwxrwxrwt (so there is a sticky bit set) and owned by root:root.

What happens with other locations for TMPDIR?

> By the way, the old script that used guestfish (with all its limitations)
> was able to create a QEMU image in .qcow2 format and my /dev/shm was
> enough for it to work correctly.

It should be enough. Your /dev/shm is 8G large and it works with my 2G.

> Why does the current mmdebstrap-autopkgtest-build-qemu create a QEMU
> image in .img format? Isn't the .qcow2 format better?

Maybe. It's currently .img because it's easier to debug stuff and use kpartx
with it without having to extract it first. :)

> Please clarify and/or improve mmdebstrap-autopkgtest-build-qemu .
> Thanks for your time!

Thanks for your bug! Lets hope we get to the bottom of this.

cheers, josch

Attachment: signature.asc
Description: signature

Reply via email to