Skip to content

Temp file aka loop device on custom location #78

Open

Description

@niekvanderven

Can I manipulate the location of the loop device as my partition table is custom setup and overloading:
df -h
Filesystem Size Used Avail Use% Mounted on
devtmpfs 4.0M 0 4.0M 0% /dev
tmpfs 126G 0 126G 0% /dev/shm
tmpfs 51G 15M 51G 1% /run
/dev/mapper/rl_kvm02--nikhef-root 16G 16G 365M 98% /
/dev/mapper/rl_kvm02--nikhef-home 2.0G 71M 2.0G 4% /home
/dev/sda1 1006M 353M 654M 36% /boot
/dev/mapper/rl_kvm02--nikhef-var_lib_libvirt 90G 33G 58G 37% /var/lib/libvirt
/dev/mapper/rl_kvm02--nikhef-var_log 2.0G 145M 1.9G 8% /var/log
tmpfs 26G 16K 26G 1% /run/user/0
/dev/mapper/loop0p1 9.8G 664M 8.6G 8% /tmp/d2vm/7bbba60b-9041-4741-a261-8bcd856e1461/mnt

Activity

  1. Adphi commented on Jan 9, 2026

    @Adphi
    Member

    Hello @niekvanderven,

    d2vm uses os.TempDir(), so the temp image and loop device location can be controlled via the TMPDIR environment variables.

    For example:

    TMPDIR=/path/on/your/partition d2vm build …

    Let us know if TMPDIR works for your setup.

  2. niekvanderven commented on Jan 13, 2026

    @niekvanderven
    Author

    Hi, thank you for the prompt reply, much appreciated !!!
    So far it runs lets see if it also work what I was intended to achieve.
    Output of succesfull command:
    TMPDIR=/var/lib/libvirt/iso/ ./d2vm convert ghcr.io/nokia/srlinux -o /var/lib/libvirt/iso/srlinux.qcow2 -p MyP4Ssw0r
    Pulling image ghcr.io/nokia/srlinux
    Inspecting image ghcr.io/nokia/srlinux
    No network manager specified, using distribution defaults: ifupdown
    Docker image based on Debian GNU/Linux 12 (bookworm)
    Building kernel enabled image
    Creating vm image
    Creating raw image
    Mounting raw image
    Creating raw image file system
    Copying rootfs to raw image
    Setting up rootfs
    Installing bootloader
    Setting up syslinux bootloader
    Writing MBR
    Unmounting raw image
    Converting to qcow2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions