systemd-nspawn error: "Failed to mount image file system: Value too large for defined data type"
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
systemd (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Jammy |
Confirmed
|
Low
|
Unassigned |
Bug Description
Two-line reproducer: run this on an Ubuntu 22.04 server.
sudo machinectl pull-raw http://
sudo machinectl start jammy-rootfs
Response:
Job for <email address hidden> failed because the control process exited with error code.
Here's the relevant output from "journalctl -xeu <email address hidden>"
--------
░░ A start job for unit <email address hidden> has begun execution.
░░
░░ The job identifier is 3223.
Oct 06 13:13:21 brian-kit systemd-
Oct 06 13:13:21 brian-kit systemd-
Oct 06 13:13:21 brian-kit systemd[1]: <email address hidden>: Main process exited, code=exited, status=1/FAILURE
░░ Subject: Unit process exited
░░ Defined-By: systemd
░░ Support: http://
░░
░░ An ExecStart= process belonging to unit <email address hidden> has exited.
░░
░░ The process' exit code is 'exited' and its exit status is 1.
Oct 06 13:13:21 brian-kit systemd[1]: <email address hidden>: Failed with result 'exit-code'.
--------
This appears to be similar to https:/
If so, a fix was committed in March 2022: https:/
but maybe that was too late for 22.04? Or this is a different problem?
EDIT: the reproducer from https:/
# rm -rf /var/lib/
# mkdir -p /var/lib/
# cp /etc/os-release /var/lib/
# systemd-nspawn -U -b -D /var/lib/
Spawning container my-container on /var/lib/
Press ^] three times within 1s to kill container.
Selected user namespace base 972619776 and range 65536.
Failed to create directory at /var/lib/
ProblemType: Bug
DistroRelease: Ubuntu 22.04
Package: systemd-container 249.11-0ubuntu3.10
ProcVersionSign
Uname: Linux 5.15.0-84-generic x86_64
NonfreeKernelMo
ApportVersion: 2.20.11-0ubuntu82.5
Architecture: amd64
CasperMD5CheckR
CloudArchitecture: x86_64
CloudID: none
CloudName: none
CloudPlatform: none
CloudSubPlatform: config
Date: Fri Oct 6 13:10:41 2023
InstallationDate: Installed on 2022-11-04 (335 days ago)
InstallationMedia: Ubuntu-Server 22.04.1 LTS "Jammy Jellyfish" - Release amd64 (20220809)
ProcEnviron:
TERM=xterm-
PATH=(custom, no user)
LANG=en_GB.UTF-8
SHELL=/bin/bash
SourcePackage: systemd
UpgradeStatus: No upgrade log present (probably fresh install)
description: | updated |
description: | updated |
Changed in systemd (Ubuntu): | |
status: | New → Fix Released |
Changed in systemd (Ubuntu Jammy): | |
status: | New → Confirmed |
importance: | Undecided → Low |
Grr... it works if I first run a dummy command within the machine:
systemd-nspawn -M jammy-rootfs --as-pid2 passwd root
machinectl start jammy-rootfs # it's working now!
machinectl login jammy-rootfs
(Even just "echo hello world" does the job)
However if you go back to a *fresh* image then it fails:
machinectl stop jammy-rootfs cloud-images. ubuntu. com/jammy/ current/ jammy-server- cloudimg- amd64.img jammy-rootfs
machinectl remove jammy-rootfs
machinectl pull-raw http://
# Both of these commands consistently fail:
machinectl start jammy-rootfs
systemd-nspawn -M jammy-rootfs -U -b -n
Conclusion: this is confusing. The solution is to manually spawn any command within the image, *before* attempting to start the image with --boot.