nix-community / nix-community/disko

Error during copy: Read-only file system (os error 30)

Open
#1,237 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Nix
Stars
3.3k
Forks
332
Avg merge
1d 11h
Merged PRs (30d)
1

Description

I can certainly reproduce the following error now on one of my systems on "bare metal", which seems weird because it should not happen.

I run following command: disko-install --flake 'github:Zocker1999NET/server/gaming-setup-steamos#steamos.pc.6nw.de' --disk main /dev/sda --mode format (IMO the config should be irrelevant for this issue, but just in case)

Every time I executed this for the last 4 times, disko-install succeeds to build the config, then starts to partition the device, then starts the manual transfer of the /nix/store, and then fails to complete because (last log lines):

+ device=/dev/sda
+ efiGptPartitionFirst=1
+ type=gpt
+ device=/dev/disk/by-partlabel/disk-main-root
+ extraArgs=()
+ declare -a extraArgs
+ format=ext4
+ mountOptions=('defaults')
+ declare -a mountOptions
+ mountpoint=/
+ type=filesystem
+ findmnt /dev/disk/by-partlabel/disk-main-root /mnt/disko-install-root/
+ mount /dev/disk/by-partlabel/disk-main-root /mnt/disko-install-root/ -t ext4 -o defaults -o X-mount.mkdir
+ destroy=1
+ device=/dev/sda
+ imageName=main
+ imageSize=2G
+ name=main
+ type=disk
+ device=/dev/sda
+ efiGptPartitionFirst=1
+ type=gpt
+ device=/dev/disk/by-partlabel/disk-main-ESP
+ extraArgs=()
+ declare -a extraArgs
+ format=vfat
+ mountOptions=('defaults')
+ declare -a mountOptions
+ mountpoint=/boot
+ type=filesystem
+ findmnt /dev/disk/by-partlabel/disk-main-ESP /mnt/disko-install-root/boot
+ mount /dev/disk/by-partlabel/disk-main-ESP /mnt/disko-install-root/boot -t vfat -o defaults -o X-mount.mkdir
+ rm -rf /tmp/tmp.5HpXTbdhe2
Copying store paths
[################################################################################################################>---------------------------------------------------]    2.66 GiB / 3.87 GiB    |  69% |  35.01 MiB/s  | 00:00:35 remaining00:37:52 [ERROR] Received error: Error during copy: Read-only file system (os error 30)
00:37:52 [ERROR] Error copying: "/nix/store/hscvhz3bg5yzagpj2hgxi8y4f4zqz4ny-nix-2.31.2-man/share/man/man1/nix-env-uninstall.1.gz" -> "/mnt/disko-install-root/nix/store/hscvhz3bg5yzagpj2hgxi8y4f4zqz4ny-nix-2.31.2-man/share/man/man1/nix-env-uninstall.1.gz"; aborting.
00:37:52 [ERROR] Error copying: "/nix/store/hscvhz3bg5yzagpj2hgxi8y4f4zqz4ny-nix-2.31.2-man/share/man/man1/nix3-store-repair.1.gz" -> "/mnt/disko-install-root/nix/store/hscvhz3bg5yzagpj2hgxi8y4f4zqz4ny-nix-2.31.2-man/share/man/man1/nix3-store-repair.1.gz"; aborting.
00:37:52 [ERROR] Error copying: "/nix/store/hscvhz3bg5yzagpj2hgxi8y4f4zqz4ny-nix-2.31.2-man/share/man/man1/nix3-derivation-show.1.gz" -> "/mnt/disko-install-root/nix/store/hscvhz3bg5yzagpj2hgxi8y4f4zqz4ny-nix-2.31.2-man/share/man/man1/nix3-derivation-show.1.gz"; aborting.
Error: Error during copy: Read-only file system (os error 30)
00:37:52 [ERROR] Error copying: "/nix/store/hscvhz3bg5yzagpj2hgxi8y4f4zqz4ny-nix-2.31.2-man/share/man/man1/nix3-flake-init.1.gz" -> "/mnt/disko-install-root/nix/store/hscvhz3bg5yzagpj2hgxi8y4f4zqz4ny-nix-2.31.2-man/share/man/man1/nix3-flake-init.1.gz"; aborting.
Loading nix database
installing the boot loader...
chroot: failed to run command ‘/nix/var/nix/profiles/system/activate’: No such file or directory
chroot: failed to run command ‘/nix/var/nix/profiles/system/sw/bin/bash’: No such file or directory
disko-install failed

I am very certain that the drive I’m using is good for two reasons: a) I do not run into problems when running e.g. pv /dev/zero > /dev/sda. b) The kernel (dmesg) does log no error whatsover while disko-install fails.

And, to add, I can also reproduce this issue in a NixOS test of my subproject disko-install-menu, more certain in the installDefault test. While there the issue only occurs roughly every 2nd or 3rd run, the issue occurs on 3 completely different systems I am able to run this test on.
For a long time, I thought this issue is limited to a quirky misbehavior of qemu/KVM/…, but now that I see this issue with "real" hardware, I do no longer think that this is the case here.

And also, as well as on "real" hardware & when running as a NixOS test, the installation does not always fail at the same files, but always in a similar ballpark of gibibytes transferred.

I have no idea how to further debug this, therefore I decided to report this here.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure with the documented disko-install command and the disko-install-menu tests/installDefault.nix test. Start by tracing the manual /nix/store copy after the root and boot filesystems are mounted, using the reported destination and failing paths. Done means identifying why the destination becomes read-only and making installation complete reliably across repeated runs.

Written by the indexing model from the issue text.

Assessment

Tech stack
linux, shell
Domain
cli, operating-systems, tooling
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.