You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When building a large disk image, it's likely you'll receive the following error:
ERROR: cptofs failed. diskSize might be too small for closure.
This comment suggests using a module to override the behaviour: #150 (comment)
However, applying the module within the flake.nix doesn't make any difference.
packages.vm = forAllHostnames ({ system, pkgs, hostname }: nixos-generators.nixosGenerate {
system = system;
modules = [
# Pin nixpkgs to the flake input, so that the packages installed
# come from the flake inputs.nixpkgs.url.
({ ... }: { nix.registry.nixpkgs.flake = nixpkgs; })
# Make the disk bigger to avoid "ERROR: cptofs failed. diskSize might be too small for closure."
({ lib, ... }: {
system.build.qcow = lib.mkDefault {
diskSize = lib.mkForce "auto";
additionalSpace = "10G";
};
})
# Install all tools.
./tools.nix
# Apply the rest of the config.
./configuration.nix
];
format = "qcow2";
});
And neither does setting it in the configuration.nix:
{pkgs,lib,hostname,github-url, ... }: {networking={hostName=hostname;};# Enable the OpenSSH server.services.openssh={enable=true;};# Lots of other stuff...system.build.qcow=lib.mkDefault{diskSize=lib.mkForce"auto";additionalSpace="10G";};system.stateVersion="23.11";}
However, if I switch to the raw image format, everything works well. Presumably because raw images use the "auto" setting?
Is there a reason why diskSize isn't set to auto for qcow2 images?
The text was updated successfully, but these errors were encountered:
From reading @jalseth's PR, it looks like it resolves this issue. I've moved to using raw images as a result of the issue, so I haven't got a test to hand.
The qcow2 disk image seems set to 8192 in https://github.com/nix-community/nixos-generators/blob/896f6589db5b25023b812bbb6c1f5d3a499b1132/formats/qcow.nix#L32C16-L32C20
When building a large disk image, it's likely you'll receive the following error:
This comment suggests using a module to override the behaviour: #150 (comment)
However, applying the module within the
flake.nix
doesn't make any difference.And neither does setting it in the
configuration.nix
:However, if I switch to the
raw
image format, everything works well. Presumably becauseraw
images use the "auto" setting?Is there a reason why
diskSize
isn't set to auto forqcow2
images?The text was updated successfully, but these errors were encountered: